Public Key

Index

pubkey/algo-name pubkey/check-key pubkey/estimated_strength pubkey/export pubkey/fingerprint pubkey/get-field pubkey/get-public-point pubkey/load pubkey/load-dh pubkey/load-dsa pubkey/load-ecdh pubkey/load-ecdsa pubkey/load-elgamal pubkey/load-kyber pubkey/load-rsa pubkey/load-sm2 pubkey/to-der pubkey/to-pem

Reference

(pubkey/algo-name pubkey)

Returns the algorithm name.

(pubkey/check-key pubkey rng &opt weak)

Test the key for consistency. If weak is provided then less expensive tests are performed.

(pubkey/estimated_strength pubkey)

Returns the estimated strength of this key against known attacks (NFS, Pollard’s rho, etc)

pubkey/exportcfunction
(pubkey/export pubkey &opt pem)

Exports the public key using the usual X.509 SPKI representation. If `pem` is provided, the result is a PEM encoded string. Otherwise it is a binary DER value.

(pubkey/fingerprint pubkey &opt hash)

Returns a hash of the public key. "SHA-256" is used as a default hash, if `hash` is not provided.

(pubkey/get-field pubkey filed-name)

Return an integer field related to the public key. The valid field names vary depending on the algorithm. For example RSA public modulus can be extracted with (pubkey/get-field "n").

(pubkey/get-public-point pubkey)

Return a public point of the key.

pubkey/loadcfunction
(pubkey/load value)

Load a public key. The value should be a PEM or DER blob.

(pubkey/load-dh p g y)

Return a public DH key.

(pubkey/load-dsa p q g y)

Return a public DSA key.

(pubkey/load-ecdh curve x y)

Return a public ECDH key.

(pubkey/load-ecdsa curve x y)

Return a public ECDSA key.

(pubkey/load-elgamal p g y)

Return a public ElGamal key.

(pubkey/load-kyber key)

Return a public Kyber key.

(pubkey/load-rsa n e)

Load an RSA public key giving the modulus and public exponent as integers.

(pubkey/load-sm2 curve x y)

Return a public SM2 key.

pubkey/to-dercfunction
(pubkey/to-pem pubkey)

Return the DER encoded public key (unencrypted).

pubkey/to-pemcfunction
(pubkey/to-pem pubkey)

Return the PEM encoded public key (unencrypted).