8 #ifndef _PKCS15_DEFINED
10 #define _PKCS15_DEFINED
99 #define PKCS15_USAGE_ENCRYPT 0x0001
100 #define PKCS15_USAGE_DECRYPT 0x0002
101 #define PKCS15_USAGE_SIGN 0x0004
102 #define PKCS15_USAGE_SIGNRECOVER 0x0008
103 #define PKCS15_USAGE_WRAP 0x0010
104 #define PKCS15_USAGE_UNWRAP 0x0020
105 #define PKCS15_USAGE_VERIFY 0x0040
106 #define PKCS15_USAGE_VERIFYRECOVER 0x0080
107 #define PKCS15_USAGE_DERIVE 0x0100
108 #define PKCS15_USAGE_NONREPUDIATION 0x0200
112 #define PKSC15_USAGE_FLAG_NONE 0x0000
113 #define PKCS15_USAGE_FLAG_MAX 0x03FF
118 #define PUBKEY_USAGE_MASK ~( PKCS15_USAGE_DECRYPT | PKCS15_USAGE_SIGN | \
119 PKCS15_USAGE_SIGNRECOVER | PKCS15_USAGE_UNWRAP )
124 #define ENCR_USAGE_MASK ( PKCS15_USAGE_ENCRYPT | PKCS15_USAGE_DECRYPT | \
125 PKCS15_USAGE_WRAP | PKCS15_USAGE_UNWRAP )
126 #define SIGN_USAGE_MASK ( PKCS15_USAGE_SIGN | PKCS15_USAGE_SIGNRECOVER | \
127 PKCS15_USAGE_VERIFY | PKCS15_USAGE_VERIFYRECOVER | \
128 PKCS15_USAGE_NONREPUDIATION )
134 #define KEYATTR_ACCESS_PUBLIC 0x02
135 #define KEYATTR_ACCESS_PRIVATE 0x0D
176 #define CRYPT_KEYIDEX_ID CRYPT_KEYID_LAST
177 #define CRYPT_KEYIDEX_SUBJECTNAMEID ( CRYPT_KEYID_LAST + 1 )
182 #define MIN_OBJECT_SIZE 16
193 #define KEYATTR_BUFFER_SIZE 512
322 IN_FLAGS_Z( KEYMGMT )
const int requestedUsage );
380 const void *pubKeyAttributes,
394 void *newPrivKeyData,
398 const void *privKeyAttributes,
404 void **newPrivKeyDataPtr,
407 const void *origPrivKeyData,
419 const void *privKeyAttributes,
429 int writeKeyAttributes(
OUT_BUFFER( privKeyAttributeMaxLen, \
430 *privKeyAttributeSize )
431 void *privKeyAttributes,
433 const int privKeyAttributeMaxLen,
437 void *pubKeyAttributes,
439 const int pubKeyAttributeMaxLen,
473 int readPublicKeyComponents(
const PKCS15_INFO *pkcs15infoPtr,
477 IN_BUFFER( keyIDlength )
const void *keyID,
487 int readPrivateKeyComponents(
const PKCS15_INFO *pkcs15infoPtr,
490 const void *password,