pub struct AttributeMap(_);

Implementations§

source§

impl AttributeMap

source

pub fn all() -> &'static [AttributeType]

Generates a list of all AttributeTypes known to the cryptoki library. This list can be used to retrieve all attributes of an HSM-object to faciltate showing, exporting or modifying objects.

This function only generates the list of known attributes once.

source

pub fn insert( &mut self, key: AttributeType, value: AttrData ) -> Option<AttrData>

Inserts a key/value pair into the mapping, returing the previous value (if any).

source

pub fn get(&self, key: &AttributeType) -> Option<&AttrData>

Retrieves an AttrData value for the given key.

source

pub fn is_empty(&self) -> bool

Returns true if the AttributeMap is empty.

source

pub fn to_vec(&self) -> Result<Vec<Attribute>>

Converts the AttributeMap to a cryptoki ready list of Attributes.

source

pub fn merge(&mut self, other: AttributeMap)

Merges an other mapping into self.

source

pub fn redact(&mut self, redactions: &HashSet<AttributeType>)

source

pub fn from_object(session: &Session, object: ObjectHandle) -> Result<Self>

Retrieves an object from the PKCS#11 interface as an AttributeMap.

Trait Implementations§

source§

impl Clone for AttributeMap

source§

fn clone(&self) -> AttributeMap

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 AttributeMap

source§

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

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

impl Default for AttributeMap

source§

fn default() -> AttributeMap

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AttributeMap

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&[Attribute]> for AttributeMap

source§

fn from(a: &[Attribute]) -> Self

Converts to this type from the input type.
source§

impl FromStr for AttributeMap

source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses an AttributeMap from a string or file.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl Serialize for AttributeMap

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&AttributeMap> for RsaPrivateKey

source§

fn try_from(a: &AttributeMap) -> Result<Self, Self::Error>

Converts an AttributeMap into an RsaPrivateKey.

§

type Error = HsmError

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

impl TryFrom<&AttributeMap> for RsaPublicKey

source§

fn try_from(a: &AttributeMap) -> Result<Self, Self::Error>

Converts an AttributeMap into an RsaPublicKey.

§

type Error = HsmError

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

impl TryFrom<&AttributeMap> for SigningKey

source§

fn try_from(a: &AttributeMap) -> Result<Self, Self::Error>

Converts an AttributeMap into an SigningKey.

§

type Error = HsmError

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

impl TryFrom<&AttributeMap> for VerifyingKey

source§

fn try_from(a: &AttributeMap) -> Result<Self, Self::Error>

Converts an AttributeMap into an VerifyingKey.

§

type Error = HsmError

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

impl TryFrom<&RsaPrivateKey> for AttributeMap

source§

fn try_from(k: &RsaPrivateKey) -> Result<Self, Self::Error>

Converts an RsaPrivateKey into an AttributeMap that can be sent to an HSM.

§

type Error = HsmError

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

impl TryFrom<&RsaPublicKey> for AttributeMap

source§

fn try_from(k: &RsaPublicKey) -> Result<Self, Self::Error>

Converts an RsaPublicKey into an AttributeMap that can be sent to an HSM.

§

type Error = HsmError

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

impl TryFrom<&SigningKey<NistP256>> for AttributeMap

source§

fn try_from(k: &SigningKey) -> Result<Self, Self::Error>

Converts an SigningKey into an AttributeMap that can be sent to an HSM.

§

type Error = HsmError

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

impl TryFrom<&VerifyingKey<NistP256>> for AttributeMap

source§

fn try_from(k: &VerifyingKey) -> Result<Self, Self::Error>

Converts an VerifyingKey into an AttributeMap that can be sent to an HSM.

§

type Error = HsmError

The type returned in the event of a conversion error.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Annotate for Twhere T: Serialize + ?Sized,

§

default fn format( &self, _variant: Option<&str>, _field: &MemberId<'_> ) -> Option<Format>

§

default fn comment( &self, _variant: Option<&str>, _field: &MemberId<'_> ) -> Option<String>

§

default fn as_annotate(&self) -> Option<&dyn Annotate>

§

default fn thunk_serialize( &self, serializer: &mut AnnotatedSerializer<'_> ) -> Result<Document, Error>

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,