pub struct TpmRsaExternalKey { /* private fields */ }Expand description
RSA public key parameters.
Implementations§
Source§impl TpmRsaExternalKey
impl TpmRsaExternalKey
Sourcepub fn try_new(
public_key: Tpm2bPublicKeyRsa,
exponent: TpmUint32,
key_bits: TpmUint16,
) -> Result<Self, TpmCryptoError>
pub fn try_new( public_key: Tpm2bPublicKeyRsa, exponent: TpmUint32, key_bits: TpmUint16, ) -> Result<Self, TpmCryptoError>
Creates RSA public key parameters after validating the modulus shape.
§Errors
Returns InvalidKeyBits when
key_bits is zero or not byte-aligned.
Returns InvalidRsaModulus
when the modulus length does not match key_bits.
Returns InvalidRsaExponent
when the exponent is not zero, odd, and at least three.
Sourcepub fn public_key(&self) -> &Tpm2bPublicKeyRsa
pub fn public_key(&self) -> &Tpm2bPublicKeyRsa
Returns the public key modulus.
Trait Implementations§
Source§impl Clone for TpmRsaExternalKey
impl Clone for TpmRsaExternalKey
Source§impl Debug for TpmRsaExternalKey
impl Debug for TpmRsaExternalKey
impl Eq for TpmRsaExternalKey
Source§impl PartialEq for TpmRsaExternalKey
impl PartialEq for TpmRsaExternalKey
impl StructuralPartialEq for TpmRsaExternalKey
Source§impl TpmExternalKey for TpmRsaExternalKey
impl TpmExternalKey for TpmRsaExternalKey
Source§type Sensitive = TpmBuffer<tpm2_protocol::::data::Tpm2bPrivateKeyRsa::{constant#0}>
type Sensitive = TpmBuffer<tpm2_protocol::::data::Tpm2bPrivateKeyRsa::{constant#0}>
TPM buffer type holding the sensitive private component.
Source§fn from_der(bytes: &[u8]) -> Result<(Self, Self::Sensitive), TpmCryptoError>
fn from_der(bytes: &[u8]) -> Result<(Self, Self::Sensitive), TpmCryptoError>
Parses a DER-encoded private key. Read more
Source§fn to_public(&self, template: &TpmPublicTemplate) -> TpmtPublic
fn to_public(&self, template: &TpmPublicTemplate) -> TpmtPublic
Converts the public key to a
TpmtPublic structure. Populates
objectAttributes nameALg and symmetric fields from the provided
template.Source§fn to_seed(
&self,
name_alg: TpmHash,
) -> Result<(Tpm2bDigest, Tpm2bEncryptedSecret), TpmCryptoError>
fn to_seed( &self, name_alg: TpmHash, ) -> Result<(Tpm2bDigest, Tpm2bEncryptedSecret), TpmCryptoError>
Source§impl TryFrom<&TpmtPublic> for TpmRsaExternalKey
impl TryFrom<&TpmtPublic> for TpmRsaExternalKey
Source§type Error = TpmCryptoError
type Error = TpmCryptoError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for TpmRsaExternalKey
impl RefUnwindSafe for TpmRsaExternalKey
impl Send for TpmRsaExternalKey
impl Sync for TpmRsaExternalKey
impl Unpin for TpmRsaExternalKey
impl UnsafeUnpin for TpmRsaExternalKey
impl UnwindSafe for TpmRsaExternalKey
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