Struct pkcs1::RsaPublicKeyDocument
source · pub struct RsaPublicKeyDocument(/* private fields */);
Expand description
PKCS#1 RSA PUBLIC KEY
document.
This type provides storage for RsaPublicKey
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 RsaPublicKeyDocument
impl AsRef<[u8]> for RsaPublicKeyDocument
source§impl Clone for RsaPublicKeyDocument
impl Clone for RsaPublicKeyDocument
source§fn clone(&self) -> RsaPublicKeyDocument
fn clone(&self) -> RsaPublicKeyDocument
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 RsaPublicKeyDocument
impl Debug for RsaPublicKeyDocument
source§impl DecodeRsaPublicKey for RsaPublicKeyDocument
impl DecodeRsaPublicKey for RsaPublicKeyDocument
source§impl<'a> Document<'a> for RsaPublicKeyDocument
impl<'a> Document<'a> for RsaPublicKeyDocument
§type Message = RsaPublicKey<'a>
type Message = RsaPublicKey<'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 EncodeRsaPublicKey for RsaPublicKeyDocument
impl EncodeRsaPublicKey for RsaPublicKeyDocument
source§fn to_pkcs1_der(&self) -> Result<RsaPublicKeyDocument>
fn to_pkcs1_der(&self) -> Result<RsaPublicKeyDocument>
Serialize a
RsaPublicKeyDocument
containing a PKCS#1-encoded public key.source§fn to_pkcs1_pem(&self, line_ending: LineEnding) -> Result<String>
fn to_pkcs1_pem(&self, line_ending: LineEnding) -> Result<String>
Serialize this public key as PEM-encoded PKCS#1 with the given line ending.
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 public 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 public key to the given path.
source§impl FromStr for RsaPublicKeyDocument
impl FromStr for RsaPublicKeyDocument
source§impl PemLabel for RsaPublicKeyDocument
impl PemLabel for RsaPublicKeyDocument
source§const TYPE_LABEL: &'static str = "RSA PUBLIC KEY"
const TYPE_LABEL: &'static str = "RSA PUBLIC KEY"
Expected PEM type label for a given document, e.g.
"PRIVATE KEY"
source§impl TryFrom<&[u8]> for RsaPublicKeyDocument
impl TryFrom<&[u8]> for RsaPublicKeyDocument
source§impl TryFrom<&RsaPublicKey<'_>> for RsaPublicKeyDocument
impl TryFrom<&RsaPublicKey<'_>> for RsaPublicKeyDocument
source§fn try_from(public_key: &RsaPublicKey<'_>) -> Result<RsaPublicKeyDocument>
fn try_from(public_key: &RsaPublicKey<'_>) -> Result<RsaPublicKeyDocument>
Performs the conversion.
source§impl TryFrom<RsaPublicKey<'_>> for RsaPublicKeyDocument
impl TryFrom<RsaPublicKey<'_>> for RsaPublicKeyDocument
source§fn try_from(public_key: RsaPublicKey<'_>) -> Result<RsaPublicKeyDocument>
fn try_from(public_key: RsaPublicKey<'_>) -> Result<RsaPublicKeyDocument>
Performs the conversion.
Auto Trait Implementations§
impl RefUnwindSafe for RsaPublicKeyDocument
impl Send for RsaPublicKeyDocument
impl Sync for RsaPublicKeyDocument
impl Unpin for RsaPublicKeyDocument
impl UnwindSafe for RsaPublicKeyDocument
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