pub struct AttributeMap(/* private fields */);Implementations§
Source§impl AttributeMap
impl AttributeMap
Sourcepub fn all() -> &'static [AttributeType]
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.
Sourcepub fn sensitive_attrs() -> &'static [AttributeType]
pub fn sensitive_attrs() -> &'static [AttributeType]
Generates a list of sensitive attributes that should be redacted when exporting an object. This list is used to prevent sensitive data from being accidentally read. Some HSMs will not mark theses attributes as sensitive, so we have to do it manually.
Sourcepub fn insert(
&mut self,
key: AttributeType,
value: AttrData,
) -> Option<AttrData>
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).
Sourcepub fn get(&self, key: &AttributeType) -> Option<&AttrData>
pub fn get(&self, key: &AttributeType) -> Option<&AttrData>
Retrieves an AttrData value for the given key.
Sourcepub fn to_vec(&self) -> Result<Vec<Attribute>>
pub fn to_vec(&self) -> Result<Vec<Attribute>>
Converts the AttributeMap to a cryptoki ready list of Attributes.
Sourcepub fn merge(&mut self, other: AttributeMap)
pub fn merge(&mut self, other: AttributeMap)
Merges an other mapping into self.
pub fn redact(&mut self, redactions: &HashSet<AttributeType>)
Sourcepub fn from_object(session: &Session, object: ObjectHandle) -> Result<Self>
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
impl Clone for AttributeMap
Source§fn clone(&self) -> AttributeMap
fn clone(&self) -> AttributeMap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more