Struct pkcs1::RsaPrivateKeyDocument
source · pub struct RsaPrivateKeyDocument(/* private fields */);
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§
source§impl AsRef<[u8]> for RsaPrivateKeyDocument
impl AsRef<[u8]> for RsaPrivateKeyDocument
source§impl Clone for RsaPrivateKeyDocument
impl Clone for RsaPrivateKeyDocument
source§fn clone(&self) -> RsaPrivateKeyDocument
fn clone(&self) -> RsaPrivateKeyDocument
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RsaPrivateKeyDocument
impl Debug for RsaPrivateKeyDocument
source§impl DecodeRsaPrivateKey for RsaPrivateKeyDocument
impl DecodeRsaPrivateKey for RsaPrivateKeyDocument
source§fn from_pkcs1_der(bytes: &[u8]) -> Result<Self>
fn from_pkcs1_der(bytes: &[u8]) -> Result<Self>
Deserialize PKCS#1 private key from ASN.1 DER-encoded data
(binary format).
source§fn from_pkcs1_pem(s: &str) -> Result<Self>
fn from_pkcs1_pem(s: &str) -> Result<Self>
Deserialize PKCS#1-encoded private key from PEM. Read more
source§impl<'a> Document<'a> for RsaPrivateKeyDocument
impl<'a> Document<'a> for RsaPrivateKeyDocument
§type Message = RsaPrivateKey<'a>
type Message = RsaPrivateKey<'a>
ASN.1 message type this document decodes to.
source§fn from_der(bytes: &[u8]) -> Result<Self, Error>
fn from_der(bytes: &[u8]) -> Result<Self, Error>
Create a new document from the provided ASN.1 DER bytes.
source§fn from_msg(msg: &Self::Message) -> Result<Self, Error>
fn from_msg(msg: &Self::Message) -> Result<Self, Error>
Encode the provided type as ASN.1 DER.
source§fn from_pem(s: &str) -> Result<Self, Error>where
Self: PemLabel,
fn from_pem(s: &str) -> Result<Self, Error>where
Self: PemLabel,
Decode ASN.1 DER document from PEM.
source§fn to_pem(&self, line_ending: LineEnding) -> Result<String, Error>where
Self: PemLabel,
fn to_pem(&self, line_ending: LineEnding) -> Result<String, Error>where
Self: PemLabel,
Encode ASN.1 DER document as a PEM string.
source§fn read_der_file(path: impl AsRef<Path>) -> Result<Self, Error>
fn read_der_file(path: impl AsRef<Path>) -> Result<Self, Error>
Read ASN.1 DER document from a file.
source§fn read_pem_file(path: impl AsRef<Path>) -> Result<Self, Error>where
Self: PemLabel,
fn read_pem_file(path: impl AsRef<Path>) -> Result<Self, Error>where
Self: PemLabel,
Read PEM-encoded ASN.1 DER document from a file.
source§fn write_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn write_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
Write ASN.1 DER document to a file.
source§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.
source§impl EncodeRsaPrivateKey for RsaPrivateKeyDocument
impl EncodeRsaPrivateKey for RsaPrivateKeyDocument
source§fn to_pkcs1_der(&self) -> Result<RsaPrivateKeyDocument>
fn to_pkcs1_der(&self) -> Result<RsaPrivateKeyDocument>
Serialize a
RsaPrivateKeyDocument
containing a PKCS#1-encoded private key.source§fn to_pkcs1_pem(&self, line_ending: LineEnding) -> Result<Zeroizing<String>>
fn to_pkcs1_pem(&self, line_ending: LineEnding) -> Result<Zeroizing<String>>
Serialize this private key as PEM-encoded PKCS#1 with the given
LineEnding
.source§fn write_pkcs1_der_file(&self, path: impl AsRef<Path>) -> Result<()>
fn write_pkcs1_der_file(&self, path: impl AsRef<Path>) -> Result<()>
Write ASN.1 DER-encoded PKCS#1 private key to the given path.
source§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<()>
Write ASN.1 DER-encoded PKCS#1 private key to the given path.
source§impl FromStr for RsaPrivateKeyDocument
impl FromStr for RsaPrivateKeyDocument
source§impl PemLabel for RsaPrivateKeyDocument
impl PemLabel for RsaPrivateKeyDocument
source§const TYPE_LABEL: &'static str = "RSA PRIVATE KEY"
const TYPE_LABEL: &'static str = "RSA PRIVATE KEY"
Expected PEM type label for a given document, e.g.
"PRIVATE KEY"
source§impl TryFrom<&[u8]> for RsaPrivateKeyDocument
impl TryFrom<&[u8]> for RsaPrivateKeyDocument
source§impl TryFrom<&RsaPrivateKey<'_>> for RsaPrivateKeyDocument
impl TryFrom<&RsaPrivateKey<'_>> for RsaPrivateKeyDocument
source§fn try_from(private_key: &RsaPrivateKey<'_>) -> Result<RsaPrivateKeyDocument>
fn try_from(private_key: &RsaPrivateKey<'_>) -> Result<RsaPrivateKeyDocument>
Performs the conversion.
source§impl TryFrom<RsaPrivateKey<'_>> for RsaPrivateKeyDocument
impl TryFrom<RsaPrivateKey<'_>> for RsaPrivateKeyDocument
source§fn try_from(private_key: RsaPrivateKey<'_>) -> Result<RsaPrivateKeyDocument>
fn try_from(private_key: RsaPrivateKey<'_>) -> Result<RsaPrivateKeyDocument>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more