@@ -122,6 +122,8 @@ pub enum AttributeType {
122122 Token ,
123123 /// Determines if the object is trusted
124124 Trusted ,
125+ /// Unique Object Id
126+ UniqueId ,
125127 /// Determines if a key supports unwrapping
126128 Unwrap ,
127129 /// Gives the URL where the complete certificate can be obtained
@@ -258,6 +260,7 @@ impl AttributeType {
258260 CKA_UNWRAP_TEMPLATE => String :: from ( stringify ! ( CKA_UNWRAP_TEMPLATE ) ) ,
259261 CKA_DERIVE_TEMPLATE => String :: from ( stringify ! ( CKA_DERIVE_TEMPLATE ) ) ,
260262 CKA_ALLOWED_MECHANISMS => String :: from ( stringify ! ( CKA_ALLOWED_MECHANISMS ) ) ,
263+ CKA_UNIQUE_ID => String :: from ( stringify ! ( CKA_UNIQUE_ID ) ) ,
261264 CKA_VENDOR_DEFINED ..=MAX_CU_ULONG => {
262265 format ! ( "{}_{}" , stringify!( CKA_VENDOR_DEFINED ) , val)
263266 }
@@ -327,6 +330,7 @@ impl From<AttributeType> for CK_ATTRIBUTE_TYPE {
327330 AttributeType :: Subject => CKA_SUBJECT ,
328331 AttributeType :: Token => CKA_TOKEN ,
329332 AttributeType :: Trusted => CKA_TRUSTED ,
333+ AttributeType :: UniqueId => CKA_UNIQUE_ID ,
330334 AttributeType :: Unwrap => CKA_UNWRAP ,
331335 AttributeType :: Url => CKA_URL ,
332336 AttributeType :: Value => CKA_VALUE ,
@@ -396,6 +400,7 @@ impl TryFrom<CK_ATTRIBUTE_TYPE> for AttributeType {
396400 CKA_SUBJECT => Ok ( AttributeType :: Subject ) ,
397401 CKA_TOKEN => Ok ( AttributeType :: Token ) ,
398402 CKA_TRUSTED => Ok ( AttributeType :: Trusted ) ,
403+ CKA_UNIQUE_ID => Ok ( AttributeType :: UniqueId ) ,
399404 CKA_UNWRAP => Ok ( AttributeType :: Unwrap ) ,
400405 CKA_URL => Ok ( AttributeType :: Url ) ,
401406 CKA_VALUE => Ok ( AttributeType :: Value ) ,
@@ -519,6 +524,8 @@ pub enum Attribute {
519524 Token ( bool ) ,
520525 /// Determines if an object is trusted
521526 Trusted ( bool ) ,
527+ /// Unique Object Id
528+ UniqueId ( Vec < u8 > ) ,
522529 /// Determines if a key supports unwrapping
523530 Unwrap ( bool ) ,
524531 /// Gives the URL where the complete certificate can ber obtained
@@ -594,6 +601,7 @@ impl Attribute {
594601 Attribute :: Subject ( _) => AttributeType :: Subject ,
595602 Attribute :: Token ( _) => AttributeType :: Token ,
596603 Attribute :: Trusted ( _) => AttributeType :: Trusted ,
604+ Attribute :: UniqueId ( _) => AttributeType :: UniqueId ,
597605 Attribute :: Unwrap ( _) => AttributeType :: Unwrap ,
598606 Attribute :: Url ( _) => AttributeType :: Url ,
599607 Attribute :: Value ( _) => AttributeType :: Value ,
@@ -663,6 +671,7 @@ impl Attribute {
663671 Attribute :: PublicKeyInfo ( bytes) => bytes. len ( ) ,
664672 Attribute :: SerialNumber ( bytes) => bytes. len ( ) ,
665673 Attribute :: Subject ( bytes) => bytes. len ( ) ,
674+ Attribute :: UniqueId ( bytes) => bytes. len ( ) ,
666675 Attribute :: Value ( bytes) => bytes. len ( ) ,
667676 Attribute :: ValueLen ( _) => size_of :: < CK_ULONG > ( ) ,
668677 Attribute :: EndDate ( _) | Attribute :: StartDate ( _) => size_of :: < CK_DATE > ( ) ,
@@ -741,6 +750,7 @@ impl Attribute {
741750 | Attribute :: Owner ( bytes)
742751 | Attribute :: SerialNumber ( bytes)
743752 | Attribute :: Subject ( bytes)
753+ | Attribute :: UniqueId ( bytes)
744754 | Attribute :: Url ( bytes)
745755 | Attribute :: Value ( bytes)
746756 | Attribute :: VendorDefined ( ( _, bytes) )
@@ -868,6 +878,7 @@ impl TryFrom<CK_ATTRIBUTE> for Attribute {
868878 AttributeType :: Owner => Ok ( Attribute :: Owner ( val. to_vec ( ) ) ) ,
869879 AttributeType :: SerialNumber => Ok ( Attribute :: SerialNumber ( val. to_vec ( ) ) ) ,
870880 AttributeType :: Subject => Ok ( Attribute :: Subject ( val. to_vec ( ) ) ) ,
881+ AttributeType :: UniqueId => Ok ( Attribute :: UniqueId ( val. to_vec ( ) ) ) ,
871882 AttributeType :: Url => Ok ( Attribute :: Url ( val. to_vec ( ) ) ) ,
872883 AttributeType :: Value => Ok ( Attribute :: Value ( val. to_vec ( ) ) ) ,
873884 AttributeType :: Id => Ok ( Attribute :: Id ( val. to_vec ( ) ) ) ,
0 commit comments