pub enum Public {
Rsa {
object_attributes: ObjectAttributes,
name_hashing_algorithm: HashingAlgorithm,
auth_policy: Digest,
parameters: PublicRsaParameters,
unique: PublicKeyRsa,
},
KeyedHash {
object_attributes: ObjectAttributes,
name_hashing_algorithm: HashingAlgorithm,
auth_policy: Digest,
parameters: PublicKeyedHashParameters,
unique: Digest,
},
Ecc {
object_attributes: ObjectAttributes,
name_hashing_algorithm: HashingAlgorithm,
auth_policy: Digest,
parameters: PublicEccParameters,
unique: EccPoint,
},
SymCipher {
object_attributes: ObjectAttributes,
name_hashing_algorithm: HashingAlgorithm,
auth_policy: Digest,
parameters: SymmetricCipherParameters,
unique: Digest,
},
}Expand description
Enum representing the Public structure.
§Details
This corresponds to TPMT_PUBLIC
This object can be serialized and deserialized
using serde if the serde feature is enabled.
Variants§
Rsa
Fields
§
object_attributes: ObjectAttributes§
name_hashing_algorithm: HashingAlgorithm§
parameters: PublicRsaParameters§
unique: PublicKeyRsaKeyedHash
Fields
§
object_attributes: ObjectAttributes§
name_hashing_algorithm: HashingAlgorithm§
parameters: PublicKeyedHashParametersEcc
Fields
§
object_attributes: ObjectAttributes§
name_hashing_algorithm: HashingAlgorithm§
parameters: PublicEccParametersSymCipher
Fields
§
object_attributes: ObjectAttributes§
name_hashing_algorithm: HashingAlgorithm§
parameters: SymmetricCipherParametersImplementations§
Source§impl Public
impl Public
Sourcepub fn object_attributes(&self) -> ObjectAttributes
pub fn object_attributes(&self) -> ObjectAttributes
Returns the object attributes
Sourcepub fn name_hashing_algorithm(&self) -> HashingAlgorithm
pub fn name_hashing_algorithm(&self) -> HashingAlgorithm
Returns the name hashing algorithm
Sourcepub fn symmetric_algorithm(&self) -> Result<SymmetricDefinitionObject>
pub fn symmetric_algorithm(&self) -> Result<SymmetricDefinitionObject>
Returns the name symmetric definition object if available
Sourcepub fn auth_policy(&self) -> &Digest
pub fn auth_policy(&self) -> &Digest
Returns the auth policy digest.
Sourcepub const fn builder() -> PublicBuilder
pub const fn builder() -> PublicBuilder
Get a builder for this structure
Trait Implementations§
Source§impl From<Public> for TPMT_PUBLIC
impl From<Public> for TPMT_PUBLIC
Source§impl Marshall for Public
impl Marshall for Public
const BUFFER_SIZE: usize
Source§impl<C> TryFrom<&Public> for PublicKey<C>where
C: CurveArithmetic + AssociatedTpmCurve,
FieldBytesSize<C>: ModulusSize,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
impl<C> TryFrom<&Public> for PublicKey<C>where
C: CurveArithmetic + AssociatedTpmCurve,
FieldBytesSize<C>: ModulusSize,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
Source§impl TryFrom<&Public> for SubjectPublicKeyInfoOwned
impl TryFrom<&Public> for SubjectPublicKeyInfoOwned
Source§fn try_from(value: &Public) -> Result<Self, Self::Error>
fn try_from(value: &Public) -> Result<Self, Self::Error>
Converts crate::structures::Public::Rsa and crate::structures::Public::Ecc to x509_cert::spki::SubjectPublicKeyInfoOwned.
§Details
The result can be used to convert TPM public keys to DER using x509-cert.
§Errors
- if other instances of
crate::structures::Publicare usedUnsupportedParamwill be returned.
Source§impl TryFrom<Public> for PublicBuffer
impl TryFrom<Public> for PublicBuffer
Source§impl TryFrom<Public> for TPM2B_PUBLIC
impl TryFrom<Public> for TPM2B_PUBLIC
Source§impl TryFrom<PublicBuffer> for Public
impl TryFrom<PublicBuffer> for Public
Source§impl TryFrom<TPM2B_PUBLIC> for Public
impl TryFrom<TPM2B_PUBLIC> for Public
Source§impl TryFrom<TPMT_PUBLIC> for Public
impl TryFrom<TPMT_PUBLIC> for Public
Source§impl UnMarshall for Public
impl UnMarshall for Public
Source§fn unmarshall_offset(marshalled_data: &[u8], offset: &mut usize) -> Result<Self>
fn unmarshall_offset(marshalled_data: &[u8], offset: &mut usize) -> Result<Self>
Creates the type from the marshalled data, and modifies
the
offset to point to the first byte in the marshalled_data
buffer which was not used in the conversion.Source§fn unmarshall(marshalled_data: &[u8]) -> Result<Self>
fn unmarshall(marshalled_data: &[u8]) -> Result<Self>
Creates the type from marshalled data.
impl Eq for Public
impl StructuralPartialEq for Public
Auto Trait Implementations§
impl Freeze for Public
impl RefUnwindSafe for Public
impl Send for Public
impl Sync for Public
impl Unpin for Public
impl UnsafeUnpin for Public
impl UnwindSafe for Public
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