Struct ed25519::pkcs8::Document

pub struct Document { /* private fields */ }
Available on crate features pkcs8 and alloc only.
Expand description

ASN.1 DER-encoded document.

This type wraps an encoded ASN.1 DER message. The document checked to ensure it contains a valid DER-encoded SEQUENCE.

It implements common functionality related to encoding/decoding such documents, such as PEM encapsulation as well as reading/writing documents from/to the filesystem.

The SecretDocument provides a wrapper for this type with additional hardening applied.

Implementations§

Get the ASN.1 DER-encoded bytes of this document.

Available on crate feature zeroize only.

Convert to a SecretDocument.

Convert to an ASN.1 DER-encoded byte vector.

Return an ASN.1 DER-encoded byte vector.

Get the length of the encoded ASN.1 DER in bytes.

Try to decode the inner ASN.1 DER message contained in this Document as the given type.

Encode the provided type as ASN.1 DER, storing the resulting encoded DER as a Document.

Available on crate feature pem only.

Decode ASN.1 DER document from PEM.

Returns the PEM label and decoded Document on success.

Available on crate feature pem only.

Encode ASN.1 DER document as a PEM string with encapsulation boundaries containing the provided PEM type label (e.g. CERTIFICATE).

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Attempt to decode this message using the provided decoder.
Parse Self from the provided DER-encoded byte slice.
Compute the length of this value in bytes when encoded as ASN.1 DER.
Encode this value as ASN.1 DER using the provided [Writer].
Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.
Available on crate feature alloc only.
Encode this message as ASN.1 DER, appending it to the provided byte vector.
Available on crate feature alloc only.
Serialize this message as a byte vector.
ASN.1 tag
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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
Is the provided [Tag] decodable as a variant of this CHOICE?

Returns the argument unchanged.

Calls U::from(self).

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

Get the ASN.1 tag that this type is encoded with.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.