Struct pkcs1::RsaPrivateKeyDocument
source · [−]pub struct RsaPrivateKeyDocument(_);
alloc
only.Expand description
PKCS#1 RSA PRIVATE KEY
document.
This type provides storage for RsaPrivateKey
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.
Trait Implementations
Deserialize PKCS#1 private key from ASN.1 DER-encoded data (binary format). Read more
pem
only.Deserialize PKCS#1-encoded private key from PEM. Read more
std
only.Load PKCS#1 private key from an ASN.1 DER-encoded file on the local filesystem (binary format). Read more
pem
and std
only.Load PKCS#1 private key from a PEM-encoded file on the local filesystem.
type Message = RsaPrivateKey<'a>
type Message = RsaPrivateKey<'a>
ASN.1 message type this document decodes to.
Borrow the inner serialized bytes of this document.
Return an allocated ASN.1 DER serialization as a boxed slice.
Create a new document from the provided ASN.1 DER bytes.
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.
fn write_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding
) -> Result<(), Error> where
Self: PemLabel,
fn write_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding
) -> Result<(), Error> where
Self: PemLabel,
Write PEM-encoded ASN.1 DER document to a file.
alloc
only.Serialize a RsaPrivateKeyDocument
containing a PKCS#1-encoded private key.
alloc
and pem
only.Serialize this private key as PEM-encoded PKCS#1 with the given LineEnding
.
alloc
and std
only.Write ASN.1 DER-encoded PKCS#1 private key to the given path.
fn write_pkcs1_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding
) -> Result<()>
fn write_pkcs1_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding
) -> Result<()>
pem
and std
and alloc
only.Write ASN.1 DER-encoded PKCS#1 private key to the given path.
Expected PEM type label for a given document, e.g. "PRIVATE KEY"
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for RsaPrivateKeyDocument
impl Send for RsaPrivateKeyDocument
impl Sync for RsaPrivateKeyDocument
impl Unpin for RsaPrivateKeyDocument
impl UnwindSafe for RsaPrivateKeyDocument
Blanket Implementations
Mutably borrows from an owned value. Read more