Struct mbedtls::pk::Pk

source ·
#[repr(C)]
pub struct Pk { /* private fields */ }

Implementations

Takes both DER and PEM forms of PKCS#1 or PKCS#8 encoded keys.

When calling on PEM-encoded data, key must be NULL-terminated

Takes both DER and PEM encoded SubjectPublicKeyInfo keys.

When calling on PEM-encoded data, key must be NULL-terminated

Panics if the options are not valid for this key type.

Sign the hash hash of type md, placing the signature in sig. rng must be a cryptographically secure RNG.

For RSA signatures, the length of sig must be greater than or equal to the RSA modulus length, otherwise sign() fails with Error::PkSigLenMismatch.

For EC signatures, the length of sig must be greater than or equal to ECDSA_MAX_LEN, otherwise sign() fails with Error::PkSigLenMismatch.

On success, returns the actual number of bytes written to sig.

Agree on a shared secret with another public key.

Trait Implementations

Executes the destructor for this type. Read more
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.