Trait askar_crypto::jwk::ToJwk
source · [−]pub trait ToJwk {
fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>;
fn to_jwk_thumbprint(&self, alg: Option<KeyAlg>) -> Result<String, Error> { ... }
fn to_jwk_public(&self, alg: Option<KeyAlg>) -> Result<String, Error> { ... }
fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error> { ... }
}
Expand description
Support for converting a key into a JWK
Required Methods
fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>
fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>
Write the JWK representation to an encoder
Provided Methods
Available on crate feature
alloc
only.Create the JWK thumbprint of the key
Available on crate feature
alloc
only.Create a JWK of the public key
fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error>
fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error>
Available on crate feature
alloc
only.Create a JWK of the secret key
Implementors
impl ToJwk for Ed25519KeyPair
Available on crate feature
ed25519
only.impl ToJwk for K256KeyPair
Available on crate feature
k256
only.impl ToJwk for P256KeyPair
Available on crate feature
p256
only.impl ToJwk for X25519KeyPair
Available on crate feature
ed25519
only.impl ToJwk for AnyKey
impl<Pk: BlsPublicKeyType> ToJwk for BlsKeyPair<Pk>
Available on crate feature
bls
only.impl<T: AesType> ToJwk for AesKey<T>
Available on crate feature
aes
only.impl<T: Chacha20Type> ToJwk for Chacha20Key<T>
Available on crate feature
chacha
only.