pub struct PublicKey(/* private fields */);Expand description
An RSA public key.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_der_rsa_public_key(der: &[u8]) -> Option<Self>
pub fn from_der_rsa_public_key(der: &[u8]) -> Option<Self>
Parse a DER-encoded RSAPublicKey structure (from RFC 8017).
Sourcepub fn to_der_rsa_public_key(&self) -> Buffer
pub fn to_der_rsa_public_key(&self) -> Buffer
Serialize to a DER-encoded RSAPublicKey structure (from RFC 8017).
Sourcepub fn from_der_subject_public_key_info(spki: &[u8]) -> Option<Self>
pub fn from_der_subject_public_key_info(spki: &[u8]) -> Option<Self>
Parse a DER-encoded SubjectPublicKeyInfo. This format is found in, for example, X.509 certificates.
Sourcepub fn to_der_subject_public_key_info(&self) -> Buffer
pub fn to_der_subject_public_key_info(&self) -> Buffer
Serialize to a DER-encoded SubjectPublicKeyInfo. This format is found in, for example, X.509 certificates.
Sourcepub fn verify_pkcs1<Hash: Algorithm>(
&self,
signed_msg: &[u8],
signature: &[u8],
) -> Result<(), InvalidSignatureError>
pub fn verify_pkcs1<Hash: Algorithm>( &self, signed_msg: &[u8], signature: &[u8], ) -> Result<(), InvalidSignatureError>
Verify that signature is a valid signature of a digest of
signed_msg, by this public key. The digest of the message will be
computed with the specified hash function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
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