Struct pkcs1::RsaPublicKey
source · [−]Expand description
PKCS#1 RSA Public Keys as defined in RFC 8017 Appendix 1.1.
ASN.1 structure containing a serialized RSA public key:
RSAPublicKey ::= SEQUENCE {
modulus INTEGER, -- n
publicExponent INTEGER -- e
}
Fields
modulus: UIntBytes<'a>
n
: RSA modulus
public_exponent: UIntBytes<'a>
e
: RSA public exponent
Implementations
sourceimpl<'a> RsaPublicKey<'a>
impl<'a> RsaPublicKey<'a>
sourcepub fn to_der(self) -> RsaPublicKeyDocument
pub fn to_der(self) -> RsaPublicKeyDocument
Encode this RsaPublicKey
as ASN.1 DER.
sourcepub fn to_pem(self) -> Result<String>
pub fn to_pem(self) -> Result<String>
Encode this RsaPublicKey
as PEM-encoded ASN.1 DER.
sourcepub fn to_pem_with_le(self, line_ending: LineEnding) -> Result<String>
pub fn to_pem_with_le(self, line_ending: LineEnding) -> Result<String>
Encode this RsaPublicKey
as PEM-encoded ASN.1 DER with the given
LineEnding
.
Trait Implementations
sourceimpl<'a> Clone for RsaPublicKey<'a>
impl<'a> Clone for RsaPublicKey<'a>
sourcefn clone(&self) -> RsaPublicKey<'a>
fn clone(&self) -> RsaPublicKey<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for RsaPublicKey<'a>
impl<'a> Debug for RsaPublicKey<'a>
sourceimpl<'a> From<&'_ RsaPrivateKey<'a>> for RsaPublicKey<'a>
impl<'a> From<&'_ RsaPrivateKey<'a>> for RsaPublicKey<'a>
sourcefn from(private_key: &RsaPrivateKey<'a>) -> RsaPublicKey<'a>
fn from(private_key: &RsaPrivateKey<'a>) -> RsaPublicKey<'a>
Converts to this type from the input type.
sourceimpl From<&'_ RsaPublicKey<'_>> for RsaPublicKeyDocument
impl From<&'_ RsaPublicKey<'_>> for RsaPublicKeyDocument
sourcefn from(public_key: &RsaPublicKey<'_>) -> RsaPublicKeyDocument
fn from(public_key: &RsaPublicKey<'_>) -> RsaPublicKeyDocument
Converts to this type from the input type.
sourceimpl<'a> From<RsaPrivateKey<'a>> for RsaPublicKey<'a>
impl<'a> From<RsaPrivateKey<'a>> for RsaPublicKey<'a>
sourcefn from(private_key: RsaPrivateKey<'a>) -> RsaPublicKey<'a>
fn from(private_key: RsaPrivateKey<'a>) -> RsaPublicKey<'a>
Converts to this type from the input type.
sourceimpl From<RsaPublicKey<'_>> for RsaPublicKeyDocument
impl From<RsaPublicKey<'_>> for RsaPublicKeyDocument
sourcefn from(public_key: RsaPublicKey<'_>) -> RsaPublicKeyDocument
fn from(public_key: RsaPublicKey<'_>) -> RsaPublicKeyDocument
Converts to this type from the input type.
sourceimpl<'a> Message<'a> for RsaPublicKey<'a>
impl<'a> Message<'a> for RsaPublicKey<'a>
sourceimpl<'a> PartialEq<RsaPublicKey<'a>> for RsaPublicKey<'a>
impl<'a> PartialEq<RsaPublicKey<'a>> for RsaPublicKey<'a>
sourcefn eq(&self, other: &RsaPublicKey<'a>) -> bool
fn eq(&self, other: &RsaPublicKey<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RsaPublicKey<'a>) -> bool
fn ne(&self, other: &RsaPublicKey<'a>) -> bool
This method tests for !=
.
sourceimpl<'a> TryFrom<Any<'a>> for RsaPublicKey<'a>
impl<'a> TryFrom<Any<'a>> for RsaPublicKey<'a>
impl<'a> Copy for RsaPublicKey<'a>
impl<'a> Eq for RsaPublicKey<'a>
impl<'a> StructuralEq for RsaPublicKey<'a>
impl<'a> StructuralPartialEq for RsaPublicKey<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for RsaPublicKey<'a>
impl<'a> Send for RsaPublicKey<'a>
impl<'a> Sync for RsaPublicKey<'a>
impl<'a> Unpin for RsaPublicKey<'a>
impl<'a> UnwindSafe for RsaPublicKey<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> Choice<'a> for T where
T: Decodable<'a> + Encodable + Tagged,
impl<'a, T> Choice<'a> for T where
T: Decodable<'a> + Encodable + Tagged,
sourcefn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided Tag
decodable as a variant of this CHOICE
?
sourceimpl<'a, M> Encodable for M where
M: Message<'a>,
impl<'a, M> Encodable for M where
M: Message<'a>,
sourcefn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
sourcefn encode(&self, encoder: &mut Encoder<'_>) -> Result<(), Error>
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Encoder
.
sourcefn encode_to_slice(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice containing the encoded message. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more