Type Definition askar_crypto::alg::AnyKey[][src]

type AnyKey = KeyT<dyn AnyKeyAlg + Send + Sync>;
Expand description

The type-erased representation for a concrete key instance

Trait Implementations

impl KeyAeadInPlace for AnyKey[src]

fn encrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<usize, Error>
[src]

Encrypt a secret value in place, appending the verification tag and returning the length of the ciphertext Read more

fn decrypt_in_place(
    &self,
    buffer: &mut dyn ResizeBuffer,
    nonce: &[u8],
    aad: &[u8]
) -> Result<(), Error>
[src]

Decrypt an encrypted (verification tag appended) value in place

fn aead_params(&self) -> KeyAeadParams[src]

Get the nonce and tag length for encryption

impl KeySigVerify for AnyKey[src]

fn verify_signature(
    &self,
    message: &[u8],
    signature: &[u8],
    sig_type: Option<SignatureType>
) -> Result<bool, Error>
[src]

Check the validity of signature over a message with the specified signature type. Read more

impl KeySign for AnyKey[src]

fn write_signature(
    &self,
    message: &[u8],
    sig_type: Option<SignatureType>,
    out: &mut dyn WriteBuffer
) -> Result<(), Error>
[src]

Create a signature of the requested type and write it to the provided buffer. Read more

fn create_signature(
    &self,
    message: &[u8],
    sig_type: Option<SignatureType>
) -> Result<SecretBytes, Error>
[src]

This is supported on crate feature alloc only.

Create a signature of the requested type and return an allocated buffer. Read more

impl ToJwk for AnyKey[src]

fn encode_jwk(&self, enc: &mut JwkEncoder<'_>) -> Result<(), Error>[src]

Write the JWK representation to an encoder

fn to_jwk_thumbprint(&self, alg: Option<KeyAlg>) -> Result<String, Error>[src]

This is supported on crate feature alloc only.

Create the JWK thumbprint of the key

fn to_jwk_public(&self, alg: Option<KeyAlg>) -> Result<String, Error>[src]

This is supported on crate feature alloc only.

Create a JWK of the public key

fn to_jwk_secret(&self) -> Result<SecretBytes, Error>[src]

This is supported on crate feature alloc only.

Create a JWK of the secret key

impl ToPublicBytes for AnyKey[src]

fn public_bytes_length(&self) -> Result<usize, Error>[src]

Get the length of a public key

fn write_public_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>[src]

Write the key public bytes to a buffer.

fn to_public_bytes(&self) -> Result<SecretBytes, Error>[src]

This is supported on crate feature alloc only.

Write the key public bytes to a new allocated buffer.

impl ToSecretBytes for AnyKey[src]

fn secret_bytes_length(&self) -> Result<usize, Error>[src]

Get the length of a secret key

fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>[src]

Write the key secret bytes to a buffer.

fn to_secret_bytes(&self) -> Result<SecretBytes, Error>[src]

This is supported on crate feature alloc only.

Write the key secret bytes to a new allocated buffer.

impl RefUnwindSafe for AnyKey[src]

impl UnwindSafe for AnyKey[src]