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-ed25519 pubkey/load-elgamal pubkey/load-ml-kem pubkey/load-rsa pubkey/load-sm2 pubkey/oid pubkey/to-der pubkey/to-pem pubkey/to-raw

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-ed25519 key)

Return a public ed25519 key created from a 32-byte raw key value.

(pubkey/load-elgamal p g y)

Return a public ElGamal key.

(pubkey/load-ml-kem key mode)

Return a public ML-KEM key based on the given mode.

(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/oidcfunction
(pubkey/oid pubkey)

Return the key's associated OID.

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

Return the unencrypted DER encoding of the public key.

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

Return the unencrypted PEM encoding of the public key.

pubkey/to-rawcfunction
(pubkey/to-raw pubkey)

Return the unencrypted canonical raw encoding of the public key. This might not be defined for all key types.