[][src]Struct openssl::crypto::pkey::PKey

pub struct PKey { /* fields omitted */ }

Methods

impl PKey
[src]

Represents a public key, optionally with a private key attached.

Reads private key from PEM, takes ownership of handle

Reads public key from PEM, takes ownership of handle

Reads an RSA private key from PEM, takes ownership of handle

Reads an RSA public key from PEM, takes ownership of handle

assign RSA key to this pkey

get a reference to the interal RSA key for direct access to the key components

Returns a DER serialized form of the public key, suitable for load_pub().

Loads a DER serialized form of the public key, as produced by save_pub().

Returns a serialized form of the public and private keys, suitable for load_priv().

Loads a serialized form of the public and private keys, as produced by save_priv().

Stores private key as a PEM

Stores public key as a PEM

Returns the size of the public key modulus.

Returns whether this pkey object can perform the specified role.

Returns the maximum amount of data that can be encrypted by an encrypt() call.

Encrypts data with the public key, using OAEP padding, returning the encrypted data. The supplied data must not be larger than max_data().

Encrypts data with the public key, using provided padding, returning the encrypted data. The supplied data must not be larger than max_data().

Encrypts data with the public key, using OAEP padding, returning the encrypted data. The supplied data must not be larger than max_data().

Decrypts data with the public key, using PKCS1v15 padding, returning the decrypted data.

Decrypts data with the private key, expecting OAEP padding, returning the decrypted data.

Decrypts data with the private key, using provided padding, returning the encrypted data. The supplied data must not be larger than max_data().

Decrypts data with the private key, expecting OAEP padding, returning the decrypted data.

Encrypts data with the private key, using PKCS1v15 padding, returning the encrypted data. The supplied data must not be larger than max_data().

Signs data, using OpenSSL's default scheme and adding sha256 ASN.1 information to the signature. The bytes to sign must be the result of a sha256 hashing; returns the signature.

Verifies a signature s (using OpenSSL's default scheme and sha256) on the SHA256 hash of a message. Returns true if the signature is valid, and false otherwise.

Signs data, using OpenSSL's default scheme and add ASN.1 information for the given hash type to the signature. The bytes to sign must be the result of this type of hashing; returns the signature.

Trait Implementations

impl Clone for PKey
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Drop for PKey
[src]

Executes the destructor for this type. Read more

impl Sync for PKey
[src]

impl Send for PKey
[src]

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more