#[non_exhaustive]pub enum AttributeType {
Show 78 variants
AcIssuer,
AllowedMechanisms,
AlwaysAuthenticate,
AlwaysSensitive,
Application,
AttrTypes,
Base,
CertificateType,
CheckValue,
Class,
Coefficient,
Copyable,
Decapsulate,
Decrypt,
Derive,
Destroyable,
EcParams,
EcPoint,
Encapsulate,
Encrypt,
EndDate,
Exponent1,
Exponent2,
Extractable,
HashOfIssuerPublicKey,
HashOfSubjectPublicKey,
Id,
Issuer,
KeyGenMechanism,
KeyType,
Label,
Local,
Modifiable,
Modulus,
ModulusBits,
NeverExtractable,
ObjectId,
ObjectValidationFlags,
Owner,
ParameterSet,
Prime,
Prime1,
Prime2,
Private,
PrivateExponent,
PublicExponent,
PublicKeyInfo,
ProfileId,
Seed,
Sensitive,
SerialNumber,
Sign,
SignRecover,
StartDate,
Subject,
Token,
Trusted,
UniqueId,
Unwrap,
Url,
ValidationType,
ValidationVersion,
ValidationLevel,
ValidationModuleId,
ValidationFlag,
ValidationAuthorityType,
ValidationCountry,
ValidationCertificateIdentifier,
ValidationCertificateUri,
ValidationVendorUri,
ValidationProfile,
Value,
ValueLen,
VendorDefined(CK_ATTRIBUTE_TYPE),
Verify,
VerifyRecover,
Wrap,
WrapWithTrusted,
}Expand description
Type of an attribute
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AcIssuer
DER-encoding of the attribute certificate’s issuer
AllowedMechanisms
List of mechanisms allowed to be used with the key
AlwaysAuthenticate
Indicates that the user has to supply the PIN for each use with the key
AlwaysSensitive
Indicates if the key has always had the Sensitive attribute set to true
Application
Description of the application that manages the object
AttrTypes
BER-encoding of a sequence of object identifier values
Base
Base number value of a key
CertificateType
Type of certificate
CheckValue
Checksum
Class
Type of an object
Coefficient
The CRT coefficient iqmp of an RSA private key
Copyable
Determines if an object can be copied
Decapsulate
Determines if a key supports key decapsulation
Decrypt
Determines if a key supports decryption
Derive
Determines if it is possible to derive other keys from the key
Destroyable
Determines if it is possible to destroy an object
EcParams
Parameters defining an elliptic curve
EcPoint
DER-encoded Elliptic Curve point
Encapsulate
Determines if a key supports key encapsulation
Encrypt
Determines if a key supports encryption
EndDate
The end date for the object
Exponent1
The private exponent dmp1 of an RSA private key
Exponent2
The private exponent dmq1 of an RSA private key
Extractable
Determines if a key is extractable and can be wrapped
HashOfIssuerPublicKey
Hash of issuer public key
HashOfSubjectPublicKey
Hash of subject public key
Id
Key identifier for key
Issuer
DER-encoding of the certificate issuer name
KeyGenMechanism
Identifier of the mechanism used to generate the key material
KeyType
Type of a key
Label
Description of the object
Local
Indicates if the key was generated locally or copied from a locally created object
Modifiable
Determines if the object can be modified
Modulus
Modulus value of a key
ModulusBits
Length in bits of the modulus of a key
NeverExtractable
Indicates if the key has never had the Extractable attribute set to true
ObjectId
Object ID
ObjectValidationFlags
Object Validation flags
Owner
DER encoding of the attribute certificate’s subject field
ParameterSet
Algorithm-specific parameter set
Prime
Prime number value of a key
Prime1
The prime p of an RSA private key
Prime2
The prime q of an RSA private key
Private
Determines if the object is private
PrivateExponent
Private exponent d
PublicExponent
Public exponent value of a key
PublicKeyInfo
DER-encoding of the SubjectPublicKeyInfo
ProfileId
Profile ID
Seed
Seed to derive private key
Sensitive
Determines if the key is sensitive
SerialNumber
DER encoding of the certificate serial number
Sign
Determines if a key supports signing
SignRecover
Determines if a key supports signing where the data can be recovered from the signature
StartDate
The start date of the object
Subject
DER-encoding of certificate subject name
Token
Determines if the object is a token object
Trusted
Determines if the object is trusted
UniqueId
Unique Object Id
Unwrap
Determines if a key supports unwrapping
Url
Gives the URL where the complete certificate can be obtained
ValidationType
Identifier indicating the validation type
ValidationVersion
Version of the validation standard or specification
ValidationLevel
Validation level, Meaning is Validation type specific
ValidationModuleId
How the module is identified in the validation documentation
ValidationFlag
Flags identifying this validation in sessions and objects
ValidationAuthorityType
Identifies the authority that issues the validation
ValidationCountry
2 letter ISO country code
ValidationCertificateIdentifier
Identifier of the validation certificate
ValidationCertificateUri
Validation authority URI from which information related to the validation is available. If the Validation Certificate URI is not provided, the validation object SHOULD include a Validation Vendor URI.
ValidationVendorUri
Validation Vendor URI from which information related to the validation is available.
ValidationProfile
Profile used for validation
Value
Value of the object
ValueLen
Length in bytes of the value
VendorDefined(CK_ATTRIBUTE_TYPE)
Vendor defined attribute
Verify
Determines if a key supports verifying
VerifyRecover
Determines if a key supports verifying where the data can be recovered from the signature
Wrap
Determines if a key supports wrapping
WrapWithTrusted
Indicates that the key can only be wrapped with a wrapping key that has the Trusted attribute
Implementations§
Source§impl AttributeType
impl AttributeType
Sourcepub fn fixed_size(&self) -> Option<usize>
pub fn fixed_size(&self) -> Option<usize>
Returns the fixed size of an attribute type if known.
This method returns Some(size) for attributes with a known fixed size,
and None for variable-length attributes. This is useful for optimizing
attribute retrieval by pre-allocating buffers of the correct size.
§Returns
Some(usize)- The fixed size in bytes for attributes with known fixed sizeNone- For variable-length attributes (e.g., Label, Modulus, Value, etc.)
§Examples
use cryptoki::object::AttributeType;
use std::mem::size_of;
use cryptoki_sys::{CK_ULONG, CK_BBOOL};
// Fixed-size attributes
assert_eq!(AttributeType::Class.fixed_size(), Some(size_of::<CK_ULONG>()));
assert_eq!(AttributeType::Token.fixed_size(), Some(size_of::<CK_BBOOL>()));
// Variable-length attributes
assert_eq!(AttributeType::Label.fixed_size(), None);
assert_eq!(AttributeType::Modulus.fixed_size(), None);Trait Implementations§
Source§impl Clone for AttributeType
impl Clone for AttributeType
Source§fn clone(&self) -> AttributeType
fn clone(&self) -> AttributeType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more