pub struct PublicEncryptingKey(/* private fields */);
Expand description
An RSA public key used for encrypting plaintext that is decrypted by a PrivateDecryptingKey
.
Implementations§
Source§impl PublicEncryptingKey
impl PublicEncryptingKey
Sourcepub fn from_der(value: &[u8]) -> Result<Self, KeyRejected>
pub fn from_der(value: &[u8]) -> Result<Self, KeyRejected>
Construct a PublicEncryptingKey
from X.509 SubjectPublicKeyInfo
DER encoded bytes.
§Errors
Unspecified
for any error that occurs deserializing from bytes.
Sourcepub fn key_size_bytes(&self) -> usize
pub fn key_size_bytes(&self) -> usize
Returns the RSA key size in bytes.
Sourcepub fn key_size_bits(&self) -> usize
pub fn key_size_bits(&self) -> usize
Returns the RSA key size in bits.
Trait Implementations§
Source§impl AsDer<PublicKeyX509Der<'static>> for PublicEncryptingKey
impl AsDer<PublicKeyX509Der<'static>> for PublicEncryptingKey
Source§fn as_der(&self) -> Result<PublicKeyX509Der<'static>, Unspecified>
fn as_der(&self) -> Result<PublicKeyX509Der<'static>, Unspecified>
Serialize this PublicEncryptingKey
to a X.509 SubjectPublicKeyInfo
structure as DER encoded bytes.
§Errors
Unspecified
for any error that occurs serializing to bytes.
Source§impl Clone for PublicEncryptingKey
impl Clone for PublicEncryptingKey
Auto Trait Implementations§
impl Freeze for PublicEncryptingKey
impl RefUnwindSafe for PublicEncryptingKey
impl !Send for PublicEncryptingKey
impl !Sync for PublicEncryptingKey
impl Unpin for PublicEncryptingKey
impl UnwindSafe for PublicEncryptingKey
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