buddy.core.keys

PEM reader, JWK file reading writing and JCA conversions

NOTE: Supports only public/private key reading - no symmetric keys support available/

References:

jwk

(jwk private public)

Converts JCA private and public key to clojure map representing JWK object

jwk->private-key

(jwk->private-key jwk)

Converts clojure map representing JWK object to java.security.PrivateKey

jwk->public-key

(jwk->public-key jwk)

Converts clojure map representing JWK object to java.security.PublicKey

jwk-thumbprint

(jwk-thumbprint jwk)

Calculate the thumbprint of the jwk key according to the RFC7638.

private-key

(private-key path)(private-key path passphrase)

Private key constructor from file path.

private-key?

(private-key? k)

Return true if key k is a private key.

public-key

(public-key path)

Public key constructor from file path.

public-key->jwk

(public-key->jwk public)

Converts JCA public key to clojure map representing JWK object

public-key?

(public-key? k)

Return true if key k is a public key.

str->private-key

(str->private-key keydata)(str->private-key keydata passphrase)

Private key constructor from string.

str->public-key

(str->public-key keydata)

Public key constructor from string.

unwrap

multimethod

Wrap a key using some of key wrapping algorithms.

wrap

multimethod

Wrap a key using some of key wrapping algorithms.