Struct pkcs8::PrivateKeyDocument[][src]

pub struct PrivateKeyDocument(_);
This is supported on crate feature alloc only.
Expand description

PKCS#8 private key document.

This type provides storage for PrivateKeyInfo encoded as ASN.1 DER with the invariant that the contained-document is “well-formed”, i.e. it will parse successfully according to this crate’s parsing rules.

Implementations

This is supported on crate feature encryption only.

Encrypt this private key using a symmetric encryption key derived from the provided password.

Uses the following algorithms for encryption:

  • PBKDF: scrypt with default parameters:
    • log₂(N): 15
    • r: 8
    • p: 1
  • Cipher: AES-256-CBC (best available option for PKCS#5 encryption)
This is supported on crate feature encryption only.

Encrypt this private key using a symmetric encryption key derived from the provided password and pbes2::Parameters.

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format). Read more

This is supported on crate feature pem only.

Deserialize PKCS#8-encoded private key from PEM. Read more

This is supported on crate feature std only.

Load PKCS#8 private key from an ASN.1 DER-encoded file on the local filesystem (binary format). Read more

This is supported on crate features pem and std only.

Load PKCS#8 private key from a PEM-encoded file on the local filesystem.

This is supported on crate feature encryption only.

Deserialize encrypted PKCS#8 private key from ASN.1 DER-encoded data (binary format) and attempt to decrypt it using the provided password. Read more

This is supported on crate feature alloc only.

Deserialize PKCS#8 private key from a PrivateKeyDocument.

This is supported on crate features encryption and pem only.

Deserialize encrypted PKCS#8-encoded private key from PEM and attempt to decrypt it using the provided password. Read more

ASN.1 message type this document decodes to.

Does this type contain potentially sensitive data? Read more

Borrow the inner serialized bytes of this document.

Return an allocated ASN.1 DER serialization as a boxed slice.

Decode this document as ASN.1 DER.

Create a new document from the provided ASN.1 DER bytes.

Encode the provided type as ASN.1 DER.

Decode ASN.1 DER document from PEM.

Encode ASN.1 DER document as a PEM string.

Read ASN.1 DER document from a file.

Read PEM-encoded ASN.1 DER document from a file.

Write ASN.1 DER document to a file.

Write PEM-encoded ASN.1 DER document to a file.

This is supported on crate feature alloc only.

Serialize a PrivateKeyDocument containing a PKCS#8-encoded private key.

This is supported on crate features alloc and pem only.

Serialize this private key as PEM-encoded PKCS#8 with the given LineEnding.

This is supported on crate features alloc and std only.

Write ASN.1 DER-encoded PKCS#8 private key to the given path

This is supported on crate features pem and std and alloc only.

Write ASN.1 DER-encoded PKCS#8 private key to the given path

This is supported on crate features alloc and encryption only.

Create an EncryptedPrivateKeyDocument containing the ciphertext of a PKCS#8 encoded private key encrypted under the given password. Read more

This is supported on crate features encryption and pem and alloc only.

Serialize this private key as an encrypted PEM-encoded PKCS#8 private key using the provided to derive an encryption key. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Expected PEM type label for a given document, e.g. "PRIVATE KEY"

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.

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.

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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

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.