Enum tss_esapi::structures::Public

source ·
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

Variants§

§

Rsa

Fields

§object_attributes: ObjectAttributes
§name_hashing_algorithm: HashingAlgorithm
§auth_policy: Digest
§

KeyedHash

Fields

§object_attributes: ObjectAttributes
§name_hashing_algorithm: HashingAlgorithm
§auth_policy: Digest
§unique: Digest
§

Ecc

Fields

§object_attributes: ObjectAttributes
§name_hashing_algorithm: HashingAlgorithm
§auth_policy: Digest
§unique: EccPoint
§

SymCipher

Fields

§object_attributes: ObjectAttributes
§name_hashing_algorithm: HashingAlgorithm
§auth_policy: Digest
§unique: Digest

Implementations§

source§

impl Public

source

pub fn object_attributes(&self) -> ObjectAttributes

Returns the object attributes

source

pub fn name_hashing_algorithm(&self) -> HashingAlgorithm

Returns the name hashing algorithm

source

pub fn auth_policy(&self) -> &Digest

Returns the auth policy digest.

source

pub const fn builder() -> PublicBuilder

Get a builder for this structure

Trait Implementations§

source§

impl Clone for Public

source§

fn clone(&self) -> Public

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Public

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Public> for TPMT_PUBLIC

source§

fn from(public: Public) -> Self

Converts to this type from the input type.
source§

impl Marshall for Public

source§

fn marshall(&self) -> Result<Vec<u8>>

Produce a marshalled TPMT_PUBLIC

Note: for TPM2B_PUBLIC marshalling use PublicBuffer

source§

const BUFFER_SIZE: usize = 612usize

source§

impl PartialEq for Public

source§

fn eq(&self, other: &Public) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<Public> for DecodedKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Public) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Public> for PublicBuffer

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(public: Public) -> Result<PublicBuffer>

Performs the conversion.
source§

impl TryFrom<Public> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(public: Public) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Public> for SubjectPublicKeyInfo

source§

fn try_from(value: Public) -> Result<Self, Self::Error>

Converts crate::structures::Public::Rsa and crate::structures::Public::Ecc to picky_asn1_x509::SubjectPublicKeyInfo.

§Details

The result can be used to convert TPM public keys to DER using picky_asn1_der.

§Errors
§

type Error = Error

The type returned in the event of a conversion error.
source§

impl TryFrom<Public> for TPM2B_PUBLIC

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(public: Public) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<PublicBuffer> for Public

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(buf: PublicBuffer) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<TPM2B_PUBLIC> for Public

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(tpm2b_public: TPM2B_PUBLIC) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<TPMT_PUBLIC> for Public

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(tpmt_public: TPMT_PUBLIC) -> Result<Self>

Performs the conversion.
source§

impl UnMarshall for Public

source§

fn unmarshall(marshalled_data: &[u8]) -> Result<Self>

Unmarshall the structure from TPMT_PUBLIC

Note: for TPM2B_PUBLIC unmarshalling use PublicBuffer

source§

impl Eq for Public

source§

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 UnwindSafe for Public

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Free for T

source§

unsafe fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.