Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

p11.h
Go to the documentation of this file.
1 /*
2 * PKCS#11
3 * (C) 2016 Daniel Neus, Sirrix AG
4 * (C) 2016 Philipp Weber, Sirrix AG
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9 #ifndef BOTAN_P11_H__
10 #define BOTAN_P11_H__
11
12 #include <botan/secmem.h>
13 #include <botan/exceptn.h>
14 #include <botan/dyn_load.h>
15
16 #include <vector>
17 #include <string>
18 #include <map>
19
20 #define CK_PTR *
21
22 #if defined(_MSC_VER)
23 #define CK_DECLARE_FUNCTION(returnType, name) \
24 returnType __declspec(dllimport) name
25 #else
26 #define CK_DECLARE_FUNCTION(returnType, name) \
27 returnType name
28 #endif
29
30 #if defined(_MSC_VER)
31 #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
32 returnType __declspec(dllimport) (* name)
33 #else
34 #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
35 returnType (* name)
36 #endif
37
38 #define CK_CALLBACK_FUNCTION(returnType, name) \
39 returnType (* name)
40
41 #ifndef NULL_PTR
42 #define NULL_PTR nullptr
43 #endif
44
45 #if defined(_MSC_VER)
46 #pragma pack(push, cryptoki, 1)
47 #endif
48
49 #include "pkcs11.h"
50
51 #if defined(_MSC_VER)
52 #pragma pack(pop, cryptoki)
53 #endif
54
55 static_assert(CRYPTOKI_VERSION_MAJOR == 2 && CRYPTOKI_VERSION_MINOR == 40,
56 "The Botan PKCS#11 module was implemented against PKCS#11 v2.40. Please use the correct PKCS#11 headers.");
57
58 namespace Botan {
59 namespace PKCS11 {
60
61 using secure_string = secure_vector<uint8_t>;
62
63 enum class AttributeType : CK_ATTRIBUTE_TYPE
64 {
65 Class = CKA_CLASS,
66 Token = CKA_TOKEN,
67 Private = CKA_PRIVATE,
68 Label = CKA_LABEL,
69 Application = CKA_APPLICATION,
70 Value = CKA_VALUE,
71 ObjectId = CKA_OBJECT_ID,
72 CertificateType = CKA_CERTIFICATE_TYPE,
73 Issuer = CKA_ISSUER,
74 SerialNumber = CKA_SERIAL_NUMBER,
75 AcIssuer = CKA_AC_ISSUER,
76 Owner = CKA_OWNER,
77 AttrTypes = CKA_ATTR_TYPES,
78 Trusted = CKA_TRUSTED,
79 CertificateCategory = CKA_CERTIFICATE_CATEGORY,
80 JavaMidpSecurityDomain = CKA_JAVA_MIDP_SECURITY_DOMAIN,
81 Url = CKA_URL,
82 HashOfSubjectPublicKey = CKA_HASH_OF_SUBJECT_PUBLIC_KEY,
83 HashOfIssuerPublicKey = CKA_HASH_OF_ISSUER_PUBLIC_KEY,
84 NameHashAlgorithm = CKA_NAME_HASH_ALGORITHM,
85 CheckValue = CKA_CHECK_VALUE,
86 KeyType = CKA_KEY_TYPE,
87 Subject = CKA_SUBJECT,
88 Id = CKA_ID,
89 Sensitive = CKA_SENSITIVE,
90 Encrypt = CKA_ENCRYPT,
91 Decrypt = CKA_DECRYPT,
92 Wrap = CKA_WRAP,
93 Unwrap = CKA_UNWRAP,
94 Sign = CKA_SIGN,
95 SignRecover = CKA_SIGN_RECOVER,
96 Verify = CKA_VERIFY,
97 VerifyRecover = CKA_VERIFY_RECOVER,
98 Derive = CKA_DERIVE,
99 StartDate = CKA_START_DATE,
100 EndDate = CKA_END_DATE,
101 Modulus = CKA_MODULUS,
102 ModulusBits = CKA_MODULUS_BITS,
103 PublicExponent = CKA_PUBLIC_EXPONENT,
104 PrivateExponent = CKA_PRIVATE_EXPONENT,
105 Prime1 = CKA_PRIME_1,
106 Prime2 = CKA_PRIME_2,
107 Exponent1 = CKA_EXPONENT_1,
108 Exponent2 = CKA_EXPONENT_2,
109 Coefficient = CKA_COEFFICIENT,
110 PublicKeyInfo = CKA_PUBLIC_KEY_INFO,
111 Prime = CKA_PRIME,
112 Subprime = CKA_SUBPRIME,
113 Base = CKA_BASE,
114 PrimeBits = CKA_PRIME_BITS,
115 SubprimeBits = CKA_SUBPRIME_BITS,
116 SubPrimeBits = CKA_SUB_PRIME_BITS,
117 ValueBits = CKA_VALUE_BITS,
118 ValueLen = CKA_VALUE_LEN,
119 Extractable = CKA_EXTRACTABLE,
120 Local = CKA_LOCAL,
121 NeverExtractable = CKA_NEVER_EXTRACTABLE,
122 AlwaysSensitive = CKA_ALWAYS_SENSITIVE,
123 KeyGenMechanism = CKA_KEY_GEN_MECHANISM,
124 Modifiable = CKA_MODIFIABLE,
125 Copyable = CKA_COPYABLE,
126 Destroyable = CKA_DESTROYABLE,
127 EcdsaParams = CKA_ECDSA_PARAMS,
128 EcParams = CKA_EC_PARAMS,
129 EcPoint = CKA_EC_POINT,
130 SecondaryAuth = CKA_SECONDARY_AUTH,
131 AuthPinFlags = CKA_AUTH_PIN_FLAGS,
132 AlwaysAuthenticate = CKA_ALWAYS_AUTHENTICATE,
133 WrapWithTrusted = CKA_WRAP_WITH_TRUSTED,
134 WrapTemplate = CKA_WRAP_TEMPLATE,
135 UnwrapTemplate = CKA_UNWRAP_TEMPLATE,
136 DeriveTemplate = CKA_DERIVE_TEMPLATE,
137 OtpFormat = CKA_OTP_FORMAT,
138 OtpLength = CKA_OTP_LENGTH,
139 OtpTimeInterval = CKA_OTP_TIME_INTERVAL,
140 OtpUserFriendlyMode = CKA_OTP_USER_FRIENDLY_MODE,
141 OtpChallengeRequirement = CKA_OTP_CHALLENGE_REQUIREMENT,
142 OtpTimeRequirement = CKA_OTP_TIME_REQUIREMENT,
143 OtpCounterRequirement = CKA_OTP_COUNTER_REQUIREMENT,
144 OtpPinRequirement = CKA_OTP_PIN_REQUIREMENT,
145 OtpCounter = CKA_OTP_COUNTER,
146 OtpTime = CKA_OTP_TIME,
147 OtpUserIdentifier = CKA_OTP_USER_IDENTIFIER,
148 OtpServiceIdentifier = CKA_OTP_SERVICE_IDENTIFIER,
149 OtpServiceLogo = CKA_OTP_SERVICE_LOGO,
150 OtpServiceLogoType = CKA_OTP_SERVICE_LOGO_TYPE,
151 Gostr3410Params = CKA_GOSTR3410_PARAMS,
152 Gostr3411Params = CKA_GOSTR3411_PARAMS,
153 Gost28147Params = CKA_GOST28147_PARAMS,
154 HwFeatureType = CKA_HW_FEATURE_TYPE,
155 ResetOnInit = CKA_RESET_ON_INIT,
156 HasReset = CKA_HAS_RESET,
157 PixelX = CKA_PIXEL_X,
158 PixelY = CKA_PIXEL_Y,
159 Resolution = CKA_RESOLUTION,
160 CharRows = CKA_CHAR_ROWS,
161 CharColumns = CKA_CHAR_COLUMNS,
162 Color = CKA_COLOR,
163 BitsPerPixel = CKA_BITS_PER_PIXEL,
164 CharSets = CKA_CHAR_SETS,
165 EncodingMethods = CKA_ENCODING_METHODS,
166 MimeTypes = CKA_MIME_TYPES,
167 MechanismType = CKA_MECHANISM_TYPE,
168 RequiredCmsAttributes = CKA_REQUIRED_CMS_ATTRIBUTES,
169 DefaultCmsAttributes = CKA_DEFAULT_CMS_ATTRIBUTES,
170 SupportedCmsAttributes = CKA_SUPPORTED_CMS_ATTRIBUTES,
171 AllowedMechanisms = CKA_ALLOWED_MECHANISMS,
172 VendorDefined = CKA_VENDOR_DEFINED,
173 };
174
175 enum class CertificateType : CK_CERTIFICATE_TYPE
176 {
177 X509 = CKC_X_509,
178 X509AttrCert = CKC_X_509_ATTR_CERT,
179 Wtls = CKC_WTLS,
180 VendorDefined = CKC_VENDOR_DEFINED,
181 };
182
183 /// Indicates if a stored certificate is a user certificate for which the corresponding private key is available
184 /// on the token ("token user"), a CA certificate ("authority"), or another end-entity certificate ("other entity").
185 enum class CertificateCategory : CK_ULONG
186 {
187 Unspecified = CK_CERTIFICATE_CATEGORY_UNSPECIFIED,
188 TokenUser = CK_CERTIFICATE_CATEGORY_TOKEN_USER,
189 Authority = CK_CERTIFICATE_CATEGORY_AUTHORITY,
190 OtherEntity = CK_CERTIFICATE_CATEGORY_OTHER_ENTITY
191 };
192
193 enum class KeyDerivation : CK_ULONG
194 {
195 Null = CKD_NULL,
196 Sha1Kdf = CKD_SHA1_KDF,
197 Sha1KdfAsn1 = CKD_SHA1_KDF_ASN1,
198 Sha1KdfConcatenate = CKD_SHA1_KDF_CONCATENATE,
199 Sha224Kdf = CKD_SHA224_KDF,
200 Sha256Kdf = CKD_SHA256_KDF,
201 Sha384Kdf = CKD_SHA384_KDF,
202 Sha512Kdf = CKD_SHA512_KDF,
203 CpdiversifyKdf = CKD_CPDIVERSIFY_KDF,
204 };
205
206 enum class Flag : CK_FLAGS
207 {
208 None = 0,
209 TokenPresent = CKF_TOKEN_PRESENT,
210 RemovableDevice = CKF_REMOVABLE_DEVICE,
211 HwSlot = CKF_HW_SLOT,
212 Rng = CKF_RNG,
213 WriteProtected = CKF_WRITE_PROTECTED,
214 LoginRequired = CKF_LOGIN_REQUIRED,
215 UserPinInitialized = CKF_USER_PIN_INITIALIZED,
216 RestoreKeyNotNeeded = CKF_RESTORE_KEY_NOT_NEEDED,
217 ClockOnToken = CKF_CLOCK_ON_TOKEN,
218 ProtectedAuthenticationPath = CKF_PROTECTED_AUTHENTICATION_PATH,
219 DualCryptoOperations = CKF_DUAL_CRYPTO_OPERATIONS,
220 TokenInitialized = CKF_TOKEN_INITIALIZED,
221 SecondaryAuthentication = CKF_SECONDARY_AUTHENTICATION,
222 UserPinCountLow = CKF_USER_PIN_COUNT_LOW,
223 UserPinFinalTry = CKF_USER_PIN_FINAL_TRY,
224 UserPinLocked = CKF_USER_PIN_LOCKED,
225 UserPinToBeChanged = CKF_USER_PIN_TO_BE_CHANGED,
226 SoPinCountLow = CKF_SO_PIN_COUNT_LOW,
227 SoPinFinalTry = CKF_SO_PIN_FINAL_TRY,
228 SoPinLocked = CKF_SO_PIN_LOCKED,
229 SoPinToBeChanged = CKF_SO_PIN_TO_BE_CHANGED,
230 ErrorState = CKF_ERROR_STATE,
231 RwSession = CKF_RW_SESSION,
232 SerialSession = CKF_SERIAL_SESSION,
233 ArrayAttribute = CKF_ARRAY_ATTRIBUTE,
234 Hw = CKF_HW,
235 Encrypt = CKF_ENCRYPT,
236 Decrypt = CKF_DECRYPT,
237 Digest = CKF_DIGEST,
238 Sign = CKF_SIGN,
239 SignRecover = CKF_SIGN_RECOVER,
240 Verify = CKF_VERIFY,
241 VerifyRecover = CKF_VERIFY_RECOVER,
242 Generate = CKF_GENERATE,
243 GenerateKeyPair = CKF_GENERATE_KEY_PAIR,
244 Wrap = CKF_WRAP,
245 Unwrap = CKF_UNWRAP,
246 Derive = CKF_DERIVE,
247 EcFP = CKF_EC_F_P,
248 EcF2m = CKF_EC_F_2M,
249 EcEcparameters = CKF_EC_ECPARAMETERS,
250 EcNamedcurve = CKF_EC_NAMEDCURVE,
251 EcUncompress = CKF_EC_UNCOMPRESS,
252 EcCompress = CKF_EC_COMPRESS,
253 Extension = CKF_EXTENSION,
254 LibraryCantCreateOsThreads = CKF_LIBRARY_CANT_CREATE_OS_THREADS,
255 OsLockingOk = CKF_OS_LOCKING_OK,
256 DontBlock = CKF_DONT_BLOCK,
257 NextOtp = CKF_NEXT_OTP,
258 ExcludeTime = CKF_EXCLUDE_TIME,
259 ExcludeCounter = CKF_EXCLUDE_COUNTER,
260 ExcludeChallenge = CKF_EXCLUDE_CHALLENGE,
261 ExcludePin = CKF_EXCLUDE_PIN,
262 UserFriendlyOtp = CKF_USER_FRIENDLY_OTP,
263 };
264
265 inline Flag operator | (Flag a, Flag b)
266 {
267 return static_cast< Flag >(static_cast< CK_FLAGS >(a) | static_cast< CK_FLAGS >(b));
268 }
269
270 enum class MGF : CK_RSA_PKCS_MGF_TYPE
271 {
272 Mgf1Sha1 = CKG_MGF1_SHA1,
273 Mgf1Sha256 = CKG_MGF1_SHA256,
274 Mgf1Sha384 = CKG_MGF1_SHA384,
275 Mgf1Sha512 = CKG_MGF1_SHA512,
276 Mgf1Sha224 = CKG_MGF1_SHA224,
277 };
278
279 enum class HardwareType : CK_HW_FEATURE_TYPE
280 {
281 MonotonicCounter = CKH_MONOTONIC_COUNTER,
282 Clock = CKH_CLOCK,
283 UserInterface = CKH_USER_INTERFACE,
284 VendorDefined = CKH_VENDOR_DEFINED,
285 };
286
287 enum class KeyType : CK_KEY_TYPE
288 {
289 Rsa = CKK_RSA,
290 Dsa = CKK_DSA,
291 Dh = CKK_DH,
292 Ecdsa = CKK_ECDSA,
293 Ec = CKK_EC,
294 X942Dh = CKK_X9_42_DH,
295 Kea = CKK_KEA,
296 GenericSecret = CKK_GENERIC_SECRET,
297 Rc2 = CKK_RC2,
298 Rc4 = CKK_RC4,
299 Des = CKK_DES,
300 Des2 = CKK_DES2,
301 Des3 = CKK_DES3,
302 Cast = CKK_CAST,
303 Cast3 = CKK_CAST3,
304 Cast5 = CKK_CAST5,
305 Cast128 = CKK_CAST128,
306 Rc5 = CKK_RC5,
307 Idea = CKK_IDEA,
308 Skipjack = CKK_SKIPJACK,
309 Baton = CKK_BATON,
310 Juniper = CKK_JUNIPER,
311 Cdmf = CKK_CDMF,
312 Aes = CKK_AES,
313 Blowfish = CKK_BLOWFISH,
314 Twofish = CKK_TWOFISH,
315 Securid = CKK_SECURID,
316 Hotp = CKK_HOTP,
317 Acti = CKK_ACTI,
318 Camellia = CKK_CAMELLIA,
319 Aria = CKK_ARIA,
320 Md5Hmac = CKK_MD5_HMAC,
321 Sha1Hmac = CKK_SHA_1_HMAC,
322 Ripemd128Hmac = CKK_RIPEMD128_HMAC,
323 Ripemd160Hmac = CKK_RIPEMD160_HMAC,
324 Sha256Hmac = CKK_SHA256_HMAC,
325 Sha384Hmac = CKK_SHA384_HMAC,
326 Sha512Hmac = CKK_SHA512_HMAC,
327 Sha224Hmac = CKK_SHA224_HMAC,
328 Seed = CKK_SEED,
329 Gostr3410 = CKK_GOSTR3410,
330 Gostr3411 = CKK_GOSTR3411,
331 Gost28147 = CKK_GOST28147,
332 VendorDefined = CKK_VENDOR_DEFINED,
333 };
334
335 enum class MechanismType : CK_MECHANISM_TYPE
336 {
337 RsaPkcsKeyPairGen = CKM_RSA_PKCS_KEY_PAIR_GEN,
338 RsaPkcs = CKM_RSA_PKCS,
339 Rsa9796 = CKM_RSA_9796,
340 RsaX509 = CKM_RSA_X_509,
341 Md2RsaPkcs = CKM_MD2_RSA_PKCS,
342 Md5RsaPkcs = CKM_MD5_RSA_PKCS,
343 Sha1RsaPkcs = CKM_SHA1_RSA_PKCS,
344 Ripemd128RsaPkcs = CKM_RIPEMD128_RSA_PKCS,
345 Ripemd160RsaPkcs = CKM_RIPEMD160_RSA_PKCS,
346 RsaPkcsOaep = CKM_RSA_PKCS_OAEP,
347 RsaX931KeyPairGen = CKM_RSA_X9_31_KEY_PAIR_GEN,
348 RsaX931 = CKM_RSA_X9_31,
349 Sha1RsaX931 = CKM_SHA1_RSA_X9_31,
350 RsaPkcsPss = CKM_RSA_PKCS_PSS,
351 Sha1RsaPkcsPss = CKM_SHA1_RSA_PKCS_PSS,
352 DsaKeyPairGen = CKM_DSA_KEY_PAIR_GEN,
353 Dsa = CKM_DSA,
354 DsaSha1 = CKM_DSA_SHA1,
355 DsaSha224 = CKM_DSA_SHA224,
356 DsaSha256 = CKM_DSA_SHA256,
357 DsaSha384 = CKM_DSA_SHA384,
358 DsaSha512 = CKM_DSA_SHA512,
359 DhPkcsKeyPairGen = CKM_DH_PKCS_KEY_PAIR_GEN,
360 DhPkcsDerive = CKM_DH_PKCS_DERIVE,
361 X942DhKeyPairGen = CKM_X9_42_DH_KEY_PAIR_GEN,
362 X942DhDerive = CKM_X9_42_DH_DERIVE,
363 X942DhHybridDerive = CKM_X9_42_DH_HYBRID_DERIVE,
364 X942MqvDerive = CKM_X9_42_MQV_DERIVE,
365 Sha256RsaPkcs = CKM_SHA256_RSA_PKCS,
366 Sha384RsaPkcs = CKM_SHA384_RSA_PKCS,
367 Sha512RsaPkcs = CKM_SHA512_RSA_PKCS,
368 Sha256RsaPkcsPss = CKM_SHA256_RSA_PKCS_PSS,
369 Sha384RsaPkcsPss = CKM_SHA384_RSA_PKCS_PSS,
370 Sha512RsaPkcsPss = CKM_SHA512_RSA_PKCS_PSS,
371 Sha224RsaPkcs = CKM_SHA224_RSA_PKCS,
372 Sha224RsaPkcsPss = CKM_SHA224_RSA_PKCS_PSS,
373 Sha512224 = CKM_SHA512_224,
374 Sha512224Hmac = CKM_SHA512_224_HMAC,
375 Sha512224HmacGeneral = CKM_SHA512_224_HMAC_GENERAL,
376 Sha512224KeyDerivation = CKM_SHA512_224_KEY_DERIVATION,
377 Sha512256 = CKM_SHA512_256,
378 Sha512256Hmac = CKM_SHA512_256_HMAC,
379 Sha512256HmacGeneral = CKM_SHA512_256_HMAC_GENERAL,
380 Sha512256KeyDerivation = CKM_SHA512_256_KEY_DERIVATION,
381 Sha512T = CKM_SHA512_T,
382 Sha512THmac = CKM_SHA512_T_HMAC,
383 Sha512THmacGeneral = CKM_SHA512_T_HMAC_GENERAL,
384 Sha512TKeyDerivation = CKM_SHA512_T_KEY_DERIVATION,
385 Rc2KeyGen = CKM_RC2_KEY_GEN,
386 Rc2Ecb = CKM_RC2_ECB,
387 Rc2Cbc = CKM_RC2_CBC,
388 Rc2Mac = CKM_RC2_MAC,
389 Rc2MacGeneral = CKM_RC2_MAC_GENERAL,
390 Rc2CbcPad = CKM_RC2_CBC_PAD,
391 Rc4KeyGen = CKM_RC4_KEY_GEN,
392 Rc4 = CKM_RC4,
393 DesKeyGen = CKM_DES_KEY_GEN,
394 DesEcb = CKM_DES_ECB,
395 DesCbc = CKM_DES_CBC,
396 DesMac = CKM_DES_MAC,
397 DesMacGeneral = CKM_DES_MAC_GENERAL,
398 DesCbcPad = CKM_DES_CBC_PAD,
399 Des2KeyGen = CKM_DES2_KEY_GEN,
400 Des3KeyGen = CKM_DES3_KEY_GEN,
401 Des3Ecb = CKM_DES3_ECB,
402 Des3Cbc = CKM_DES3_CBC,
403 Des3Mac = CKM_DES3_MAC,
404 Des3MacGeneral = CKM_DES3_MAC_GENERAL,
405 Des3CbcPad = CKM_DES3_CBC_PAD,
406 Des3CmacGeneral = CKM_DES3_CMAC_GENERAL,
407 Des3Cmac = CKM_DES3_CMAC,
408 CdmfKeyGen = CKM_CDMF_KEY_GEN,
409 CdmfEcb = CKM_CDMF_ECB,
410 CdmfCbc = CKM_CDMF_CBC,
411 CdmfMac = CKM_CDMF_MAC,
412 CdmfMacGeneral = CKM_CDMF_MAC_GENERAL,
413 CdmfCbcPad = CKM_CDMF_CBC_PAD,
414 DesOfb64 = CKM_DES_OFB64,
415 DesOfb8 = CKM_DES_OFB8,
416 DesCfb64 = CKM_DES_CFB64,
417 DesCfb8 = CKM_DES_CFB8,
418 Md2 = CKM_MD2,
419 Md2Hmac = CKM_MD2_HMAC,
420 Md2HmacGeneral = CKM_MD2_HMAC_GENERAL,
421 Md5 = CKM_MD5,
422 Md5Hmac = CKM_MD5_HMAC,
423 Md5HmacGeneral = CKM_MD5_HMAC_GENERAL,
424 Sha1 = CKM_SHA_1,
425 Sha1Hmac = CKM_SHA_1_HMAC,
426 Sha1HmacGeneral = CKM_SHA_1_HMAC_GENERAL,
427 Ripemd128 = CKM_RIPEMD128,
428 Ripemd128Hmac = CKM_RIPEMD128_HMAC,
429 Ripemd128HmacGeneral = CKM_RIPEMD128_HMAC_GENERAL,
430 Ripemd160 = CKM_RIPEMD160,
431 Ripemd160Hmac = CKM_RIPEMD160_HMAC,
432 Ripemd160HmacGeneral = CKM_RIPEMD160_HMAC_GENERAL,
433 Sha256 = CKM_SHA256,
434 Sha256Hmac = CKM_SHA256_HMAC,
435 Sha256HmacGeneral = CKM_SHA256_HMAC_GENERAL,
436 Sha224 = CKM_SHA224,
437 Sha224Hmac = CKM_SHA224_HMAC,
438 Sha224HmacGeneral = CKM_SHA224_HMAC_GENERAL,
439 Sha384 = CKM_SHA384,
440 Sha384Hmac = CKM_SHA384_HMAC,
441 Sha384HmacGeneral = CKM_SHA384_HMAC_GENERAL,
442 Sha512 = CKM_SHA512,
443 Sha512Hmac = CKM_SHA512_HMAC,
444 Sha512HmacGeneral = CKM_SHA512_HMAC_GENERAL,
445 SecuridKeyGen = CKM_SECURID_KEY_GEN,
446 Securid = CKM_SECURID,
447 HotpKeyGen = CKM_HOTP_KEY_GEN,
448 Hotp = CKM_HOTP,
449 Acti = CKM_ACTI,
450 ActiKeyGen = CKM_ACTI_KEY_GEN,
451 CastKeyGen = CKM_CAST_KEY_GEN,
452 CastEcb = CKM_CAST_ECB,
453 CastCbc = CKM_CAST_CBC,
454 CastMac = CKM_CAST_MAC,
455 CastMacGeneral = CKM_CAST_MAC_GENERAL,
456 CastCbcPad = CKM_CAST_CBC_PAD,
457 Cast3KeyGen = CKM_CAST3_KEY_GEN,
458 Cast3Ecb = CKM_CAST3_ECB,
459 Cast3Cbc = CKM_CAST3_CBC,
460 Cast3Mac = CKM_CAST3_MAC,
461 Cast3MacGeneral = CKM_CAST3_MAC_GENERAL,
462 Cast3CbcPad = CKM_CAST3_CBC_PAD,
463 Cast5KeyGen = CKM_CAST5_KEY_GEN,
464 Cast128KeyGen = CKM_CAST128_KEY_GEN,
465 Cast5Ecb = CKM_CAST5_ECB,
466 Cast128Ecb = CKM_CAST128_ECB,
467 Cast5Cbc = CKM_CAST5_CBC,
468 Cast128Cbc = CKM_CAST128_CBC,
469 Cast5Mac = CKM_CAST5_MAC,
470 Cast128Mac = CKM_CAST128_MAC,
471 Cast5MacGeneral = CKM_CAST5_MAC_GENERAL,
472 Cast128MacGeneral = CKM_CAST128_MAC_GENERAL,
473 Cast5CbcPad = CKM_CAST5_CBC_PAD,
474 Cast128CbcPad = CKM_CAST128_CBC_PAD,
475 Rc5KeyGen = CKM_RC5_KEY_GEN,
476 Rc5Ecb = CKM_RC5_ECB,
477 Rc5Cbc = CKM_RC5_CBC,
478 Rc5Mac = CKM_RC5_MAC,
479 Rc5MacGeneral = CKM_RC5_MAC_GENERAL,
480 Rc5CbcPad = CKM_RC5_CBC_PAD,
481 IdeaKeyGen = CKM_IDEA_KEY_GEN,
482 IdeaEcb = CKM_IDEA_ECB,
483 IdeaCbc = CKM_IDEA_CBC,
484 IdeaMac = CKM_IDEA_MAC,
485 IdeaMacGeneral = CKM_IDEA_MAC_GENERAL,
486 IdeaCbcPad = CKM_IDEA_CBC_PAD,
487 GenericSecretKeyGen = CKM_GENERIC_SECRET_KEY_GEN,
488 ConcatenateBaseAndKey = CKM_CONCATENATE_BASE_AND_KEY,
489 ConcatenateBaseAndData = CKM_CONCATENATE_BASE_AND_DATA,
490 ConcatenateDataAndBase = CKM_CONCATENATE_DATA_AND_BASE,
491 XorBaseAndData = CKM_XOR_BASE_AND_DATA,
492 ExtractKeyFromKey = CKM_EXTRACT_KEY_FROM_KEY,
493 Ssl3PreMasterKeyGen = CKM_SSL3_PRE_MASTER_KEY_GEN,
494 Ssl3MasterKeyDerive = CKM_SSL3_MASTER_KEY_DERIVE,
495 Ssl3KeyAndMacDerive = CKM_SSL3_KEY_AND_MAC_DERIVE,
496 Ssl3MasterKeyDeriveDh = CKM_SSL3_MASTER_KEY_DERIVE_DH,
497 TlsPreMasterKeyGen = CKM_TLS_PRE_MASTER_KEY_GEN,
498 TlsMasterKeyDerive = CKM_TLS_MASTER_KEY_DERIVE,
499 TlsKeyAndMacDerive = CKM_TLS_KEY_AND_MAC_DERIVE,
500 TlsMasterKeyDeriveDh = CKM_TLS_MASTER_KEY_DERIVE_DH,
501 TlsPrf = CKM_TLS_PRF,
502 Ssl3Md5Mac = CKM_SSL3_MD5_MAC,
503 Ssl3Sha1Mac = CKM_SSL3_SHA1_MAC,
504 Md5KeyDerivation = CKM_MD5_KEY_DERIVATION,
505 Md2KeyDerivation = CKM_MD2_KEY_DERIVATION,
506 Sha1KeyDerivation = CKM_SHA1_KEY_DERIVATION,
507 Sha256KeyDerivation = CKM_SHA256_KEY_DERIVATION,
508 Sha384KeyDerivation = CKM_SHA384_KEY_DERIVATION,
509 Sha512KeyDerivation = CKM_SHA512_KEY_DERIVATION,
510 Sha224KeyDerivation = CKM_SHA224_KEY_DERIVATION,
511 PbeMd2DesCbc = CKM_PBE_MD2_DES_CBC,
512 PbeMd5DesCbc = CKM_PBE_MD5_DES_CBC,
513 PbeMd5CastCbc = CKM_PBE_MD5_CAST_CBC,
514 PbeMd5Cast3Cbc = CKM_PBE_MD5_CAST3_CBC,
515 PbeMd5Cast5Cbc = CKM_PBE_MD5_CAST5_CBC,
516 PbeMd5Cast128Cbc = CKM_PBE_MD5_CAST128_CBC,
517 PbeSha1Cast5Cbc = CKM_PBE_SHA1_CAST5_CBC,
518 PbeSha1Cast128Cbc = CKM_PBE_SHA1_CAST128_CBC,
519 PbeSha1Rc4128 = CKM_PBE_SHA1_RC4_128,
520 PbeSha1Rc440 = CKM_PBE_SHA1_RC4_40,
521 PbeSha1Des3EdeCbc = CKM_PBE_SHA1_DES3_EDE_CBC,
522 PbeSha1Des2EdeCbc = CKM_PBE_SHA1_DES2_EDE_CBC,
523 PbeSha1Rc2128Cbc = CKM_PBE_SHA1_RC2_128_CBC,
524 PbeSha1Rc240Cbc = CKM_PBE_SHA1_RC2_40_CBC,
525 Pkcs5Pbkd2 = CKM_PKCS5_PBKD2,
526 PbaSha1WithSha1Hmac = CKM_PBA_SHA1_WITH_SHA1_HMAC,
527 WtlsPreMasterKeyGen = CKM_WTLS_PRE_MASTER_KEY_GEN,
528 WtlsMasterKeyDerive = CKM_WTLS_MASTER_KEY_DERIVE,
529 WtlsMasterKeyDeriveDhEcc = CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC,
530 WtlsPrf = CKM_WTLS_PRF,
531 WtlsServerKeyAndMacDerive = CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE,
532 WtlsClientKeyAndMacDerive = CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE,
533 Tls10MacServer = CKM_TLS10_MAC_SERVER,
534 Tls10MacClient = CKM_TLS10_MAC_CLIENT,
535 Tls12Mac = CKM_TLS12_MAC,
536 Tls12Kdf = CKM_TLS12_KDF,
537 Tls12MasterKeyDerive = CKM_TLS12_MASTER_KEY_DERIVE,
538 Tls12KeyAndMacDerive = CKM_TLS12_KEY_AND_MAC_DERIVE,
539 Tls12MasterKeyDeriveDh = CKM_TLS12_MASTER_KEY_DERIVE_DH,
540 Tls12KeySafeDerive = CKM_TLS12_KEY_SAFE_DERIVE,
541 TlsMac = CKM_TLS_MAC,
542 TlsKdf = CKM_TLS_KDF,
543 KeyWrapLynks = CKM_KEY_WRAP_LYNKS,
544 KeyWrapSetOaep = CKM_KEY_WRAP_SET_OAEP,
545 CmsSig = CKM_CMS_SIG,
546 KipDerive = CKM_KIP_DERIVE,
547 KipWrap = CKM_KIP_WRAP,
548 KipMac = CKM_KIP_MAC,
549 CamelliaKeyGen = CKM_CAMELLIA_KEY_GEN,
550 CamelliaEcb = CKM_CAMELLIA_ECB,
551 CamelliaCbc = CKM_CAMELLIA_CBC,
552 CamelliaMac = CKM_CAMELLIA_MAC,
553 CamelliaMacGeneral = CKM_CAMELLIA_MAC_GENERAL,
554 CamelliaCbcPad = CKM_CAMELLIA_CBC_PAD,
555 CamelliaEcbEncryptData = CKM_CAMELLIA_ECB_ENCRYPT_DATA,
556 CamelliaCbcEncryptData = CKM_CAMELLIA_CBC_ENCRYPT_DATA,
557 CamelliaCtr = CKM_CAMELLIA_CTR,
558 AriaKeyGen = CKM_ARIA_KEY_GEN,
559 AriaEcb = CKM_ARIA_ECB,
560 AriaCbc = CKM_ARIA_CBC,
561 AriaMac = CKM_ARIA_MAC,
562 AriaMacGeneral = CKM_ARIA_MAC_GENERAL,
563 AriaCbcPad = CKM_ARIA_CBC_PAD,
564 AriaEcbEncryptData = CKM_ARIA_ECB_ENCRYPT_DATA,
565 AriaCbcEncryptData = CKM_ARIA_CBC_ENCRYPT_DATA,
566 SeedKeyGen = CKM_SEED_KEY_GEN,
567 SeedEcb = CKM_SEED_ECB,
568 SeedCbc = CKM_SEED_CBC,
569 SeedMac = CKM_SEED_MAC,
570 SeedMacGeneral = CKM_SEED_MAC_GENERAL,
571 SeedCbcPad = CKM_SEED_CBC_PAD,
572 SeedEcbEncryptData = CKM_SEED_ECB_ENCRYPT_DATA,
573 SeedCbcEncryptData = CKM_SEED_CBC_ENCRYPT_DATA,
574 SkipjackKeyGen = CKM_SKIPJACK_KEY_GEN,
575 SkipjackEcb64 = CKM_SKIPJACK_ECB64,
576 SkipjackCbc64 = CKM_SKIPJACK_CBC64,
577 SkipjackOfb64 = CKM_SKIPJACK_OFB64,
578 SkipjackCfb64 = CKM_SKIPJACK_CFB64,
579 SkipjackCfb32 = CKM_SKIPJACK_CFB32,
580 SkipjackCfb16 = CKM_SKIPJACK_CFB16,
581 SkipjackCfb8 = CKM_SKIPJACK_CFB8,
582 SkipjackWrap = CKM_SKIPJACK_WRAP,
583 SkipjackPrivateWrap = CKM_SKIPJACK_PRIVATE_WRAP,
584 SkipjackRelayx = CKM_SKIPJACK_RELAYX,
585 KeaKeyPairGen = CKM_KEA_KEY_PAIR_GEN,
586 KeaKeyDerive = CKM_KEA_KEY_DERIVE,
587 KeaDerive = CKM_KEA_DERIVE,
588 FortezzaTimestamp = CKM_FORTEZZA_TIMESTAMP,
589 BatonKeyGen = CKM_BATON_KEY_GEN,
590 BatonEcb128 = CKM_BATON_ECB128,
591 BatonEcb96 = CKM_BATON_ECB96,
592 BatonCbc128 = CKM_BATON_CBC128,
593 BatonCounter = CKM_BATON_COUNTER,
594 BatonShuffle = CKM_BATON_SHUFFLE,
595 BatonWrap = CKM_BATON_WRAP,
596 EcdsaKeyPairGen = CKM_ECDSA_KEY_PAIR_GEN,
597 EcKeyPairGen = CKM_EC_KEY_PAIR_GEN,
598 Ecdsa = CKM_ECDSA,
599 EcdsaSha1 = CKM_ECDSA_SHA1,
600 EcdsaSha224 = CKM_ECDSA_SHA224,
601 EcdsaSha256 = CKM_ECDSA_SHA256,
602 EcdsaSha384 = CKM_ECDSA_SHA384,
603 EcdsaSha512 = CKM_ECDSA_SHA512,
604 Ecdh1Derive = CKM_ECDH1_DERIVE,
605 Ecdh1CofactorDerive = CKM_ECDH1_COFACTOR_DERIVE,
606 EcmqvDerive = CKM_ECMQV_DERIVE,
607 EcdhAesKeyWrap = CKM_ECDH_AES_KEY_WRAP,
608 RsaAesKeyWrap = CKM_RSA_AES_KEY_WRAP,
609 JuniperKeyGen = CKM_JUNIPER_KEY_GEN,
610 JuniperEcb128 = CKM_JUNIPER_ECB128,
611 JuniperCbc128 = CKM_JUNIPER_CBC128,
612 JuniperCounter = CKM_JUNIPER_COUNTER,
613 JuniperShuffle = CKM_JUNIPER_SHUFFLE,
614 JuniperWrap = CKM_JUNIPER_WRAP,
615 Fasthash = CKM_FASTHASH,
616 AesKeyGen = CKM_AES_KEY_GEN,
617 AesEcb = CKM_AES_ECB,
618 AesCbc = CKM_AES_CBC,
619 AesMac = CKM_AES_MAC,
620 AesMacGeneral = CKM_AES_MAC_GENERAL,
621 AesCbcPad = CKM_AES_CBC_PAD,
622 AesCtr = CKM_AES_CTR,
623 AesGcm = CKM_AES_GCM,
624 AesCcm = CKM_AES_CCM,
625 AesCts = CKM_AES_CTS,
626 AesCmac = CKM_AES_CMAC,
627 AesCmacGeneral = CKM_AES_CMAC_GENERAL,
628 AesXcbcMac = CKM_AES_XCBC_MAC,
629 AesXcbcMac96 = CKM_AES_XCBC_MAC_96,
630 AesGmac = CKM_AES_GMAC,
631 BlowfishKeyGen = CKM_BLOWFISH_KEY_GEN,
632 BlowfishCbc = CKM_BLOWFISH_CBC,
633 TwofishKeyGen = CKM_TWOFISH_KEY_GEN,
634 TwofishCbc = CKM_TWOFISH_CBC,
635 BlowfishCbcPad = CKM_BLOWFISH_CBC_PAD,
636 TwofishCbcPad = CKM_TWOFISH_CBC_PAD,
637 DesEcbEncryptData = CKM_DES_ECB_ENCRYPT_DATA,
638 DesCbcEncryptData = CKM_DES_CBC_ENCRYPT_DATA,
639 Des3EcbEncryptData = CKM_DES3_ECB_ENCRYPT_DATA,
640 Des3CbcEncryptData = CKM_DES3_CBC_ENCRYPT_DATA,
641 AesEcbEncryptData = CKM_AES_ECB_ENCRYPT_DATA,
642 AesCbcEncryptData = CKM_AES_CBC_ENCRYPT_DATA,
643 Gostr3410KeyPairGen = CKM_GOSTR3410_KEY_PAIR_GEN,
644 Gostr3410 = CKM_GOSTR3410,
645 Gostr3410WithGostr3411 = CKM_GOSTR3410_WITH_GOSTR3411,
646 Gostr3410KeyWrap = CKM_GOSTR3410_KEY_WRAP,
647 Gostr3410Derive = CKM_GOSTR3410_DERIVE,
648 Gostr3411 = CKM_GOSTR3411,
649 Gostr3411Hmac = CKM_GOSTR3411_HMAC,
650 Gost28147KeyGen = CKM_GOST28147_KEY_GEN,
651 Gost28147Ecb = CKM_GOST28147_ECB,
652 Gost28147 = CKM_GOST28147,
653 Gost28147Mac = CKM_GOST28147_MAC,
654 Gost28147KeyWrap = CKM_GOST28147_KEY_WRAP,
655 DsaParameterGen = CKM_DSA_PARAMETER_GEN,
656 DhPkcsParameterGen = CKM_DH_PKCS_PARAMETER_GEN,
657 X942DhParameterGen = CKM_X9_42_DH_PARAMETER_GEN,
658 DsaProbablisticParameterGen = CKM_DSA_PROBABLISTIC_PARAMETER_GEN,
659 DsaShaweTaylorParameterGen = CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN,
660 AesOfb = CKM_AES_OFB,
661 AesCfb64 = CKM_AES_CFB64,
662 AesCfb8 = CKM_AES_CFB8,
663 AesCfb128 = CKM_AES_CFB128,
664 AesCfb1 = CKM_AES_CFB1,
665 AesKeyWrap = CKM_AES_KEY_WRAP,
666 AesKeyWrapPad = CKM_AES_KEY_WRAP_PAD,
667 RsaPkcsTpm11 = CKM_RSA_PKCS_TPM_1_1,
668 RsaPkcsOaepTpm11 = CKM_RSA_PKCS_OAEP_TPM_1_1,
669 VendorDefined = CKM_VENDOR_DEFINED,
670 };
671
672 enum class Notification : CK_NOTIFICATION
673 {
674 Surrender = CKN_SURRENDER,
675 OtpChanged = CKN_OTP_CHANGED,
676 };
677
678 enum class ObjectClass : CK_OBJECT_CLASS
679 {
680 Data = CKO_DATA,
681 Certificate = CKO_CERTIFICATE,
682 PublicKey = CKO_PUBLIC_KEY,
683 PrivateKey = CKO_PRIVATE_KEY,
684 SecretKey = CKO_SECRET_KEY,
685 HwFeature = CKO_HW_FEATURE,
686 DomainParameters = CKO_DOMAIN_PARAMETERS,
687 Mechanism = CKO_MECHANISM,
688 OtpKey = CKO_OTP_KEY,
689 VendorDefined = CKO_VENDOR_DEFINED,
690 };
691
692 enum class PseudoRandom : CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE
693 {
694 Pkcs5Pbkd2HmacSha1 = CKP_PKCS5_PBKD2_HMAC_SHA1,
695 Pkcs5Pbkd2HmacGostr3411 = CKP_PKCS5_PBKD2_HMAC_GOSTR3411,
696 Pkcs5Pbkd2HmacSha224 = CKP_PKCS5_PBKD2_HMAC_SHA224,
697 Pkcs5Pbkd2HmacSha256 = CKP_PKCS5_PBKD2_HMAC_SHA256,
698 Pkcs5Pbkd2HmacSha384 = CKP_PKCS5_PBKD2_HMAC_SHA384,
699 Pkcs5Pbkd2HmacSha512 = CKP_PKCS5_PBKD2_HMAC_SHA512,
700 Pkcs5Pbkd2HmacSha512224 = CKP_PKCS5_PBKD2_HMAC_SHA512_224,
701 Pkcs5Pbkd2HmacSha512256 = CKP_PKCS5_PBKD2_HMAC_SHA512_256,
702 };
703
704 enum class SessionState : CK_STATE
705 {
706 RoPublicSession = CKS_RO_PUBLIC_SESSION,
707 RoUserFunctions = CKS_RO_USER_FUNCTIONS,
708 RwPublicSession = CKS_RW_PUBLIC_SESSION,
709 RwUserFunctions = CKS_RW_USER_FUNCTIONS,
710 RwSoFunctions = CKS_RW_SO_FUNCTIONS,
711 };
712
713 enum class ReturnValue : CK_RV
714 {
715 OK = CKR_OK,
716 Cancel = CKR_CANCEL,
717 HostMemory = CKR_HOST_MEMORY,
718 SlotIdInvalid = CKR_SLOT_ID_INVALID,
719 GeneralError = CKR_GENERAL_ERROR,
720 FunctionFailed = CKR_FUNCTION_FAILED,
721 ArgumentsBad = CKR_ARGUMENTS_BAD,
722 NoEvent = CKR_NO_EVENT,
723 NeedToCreateThreads = CKR_NEED_TO_CREATE_THREADS,
724 CantLock = CKR_CANT_LOCK,
725 AttributeReadOnly = CKR_ATTRIBUTE_READ_ONLY,
726 AttributeSensitive = CKR_ATTRIBUTE_SENSITIVE,
727 AttributeTypeInvalid = CKR_ATTRIBUTE_TYPE_INVALID,
728 AttributeValueInvalid = CKR_ATTRIBUTE_VALUE_INVALID,
729 ActionProhibited = CKR_ACTION_PROHIBITED,
730 DataInvalid = CKR_DATA_INVALID,
731 DataLenRange = CKR_DATA_LEN_RANGE,
732 DeviceError = CKR_DEVICE_ERROR,
733 DeviceMemory = CKR_DEVICE_MEMORY,
734 DeviceRemoved = CKR_DEVICE_REMOVED,
735 EncryptedDataInvalid = CKR_ENCRYPTED_DATA_INVALID,
736 EncryptedDataLenRange = CKR_ENCRYPTED_DATA_LEN_RANGE,
737 FunctionCanceled = CKR_FUNCTION_CANCELED,
738 FunctionNotParallel = CKR_FUNCTION_NOT_PARALLEL,
739 FunctionNotSupported = CKR_FUNCTION_NOT_SUPPORTED,
740 KeyHandleInvalid = CKR_KEY_HANDLE_INVALID,
741 KeySizeRange = CKR_KEY_SIZE_RANGE,
742 KeyTypeInconsistent = CKR_KEY_TYPE_INCONSISTENT,
743 KeyNotNeeded = CKR_KEY_NOT_NEEDED,
744 KeyChanged = CKR_KEY_CHANGED,
745 KeyNeeded = CKR_KEY_NEEDED,
746 KeyIndigestible = CKR_KEY_INDIGESTIBLE,
747 KeyFunctionNotPermitted = CKR_KEY_FUNCTION_NOT_PERMITTED,
748 KeyNotWrappable = CKR_KEY_NOT_WRAPPABLE,
749 KeyUnextractable = CKR_KEY_UNEXTRACTABLE,
750 MechanismInvalid = CKR_MECHANISM_INVALID,
751 MechanismParamInvalid = CKR_MECHANISM_PARAM_INVALID,
752 ObjectHandleInvalid = CKR_OBJECT_HANDLE_INVALID,
753 OperationActive = CKR_OPERATION_ACTIVE,
754 OperationNotInitialized = CKR_OPERATION_NOT_INITIALIZED,
755 PinIncorrect = CKR_PIN_INCORRECT,
756 PinInvalid = CKR_PIN_INVALID,
757 PinLenRange = CKR_PIN_LEN_RANGE,
758 PinExpired = CKR_PIN_EXPIRED,
759 PinLocked = CKR_PIN_LOCKED,
760 SessionClosed = CKR_SESSION_CLOSED,
761 SessionCount = CKR_SESSION_COUNT,
762 SessionHandleInvalid = CKR_SESSION_HANDLE_INVALID,
763 SessionParallelNotSupported = CKR_SESSION_PARALLEL_NOT_SUPPORTED,
764 SessionReadOnly = CKR_SESSION_READ_ONLY,
765 SessionExists = CKR_SESSION_EXISTS,
766 SessionReadOnlyExists = CKR_SESSION_READ_ONLY_EXISTS,
767 SessionReadWriteSoExists = CKR_SESSION_READ_WRITE_SO_EXISTS,
768 SignatureInvalid = CKR_SIGNATURE_INVALID,
769 SignatureLenRange = CKR_SIGNATURE_LEN_RANGE,
770 TemplateIncomplete = CKR_TEMPLATE_INCOMPLETE,
771 TemplateInconsistent = CKR_TEMPLATE_INCONSISTENT,
772 TokenNotPresent = CKR_TOKEN_NOT_PRESENT,
773 TokenNotRecognized = CKR_TOKEN_NOT_RECOGNIZED,
774 TokenWriteProtected = CKR_TOKEN_WRITE_PROTECTED,
775 UnwrappingKeyHandleInvalid = CKR_UNWRAPPING_KEY_HANDLE_INVALID,
776 UnwrappingKeySizeRange = CKR_UNWRAPPING_KEY_SIZE_RANGE,
777 UnwrappingKeyTypeInconsistent = CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT,
778 UserAlreadyLoggedIn = CKR_USER_ALREADY_LOGGED_IN,
779 UserNotLoggedIn = CKR_USER_NOT_LOGGED_IN,
780 UserPinNotInitialized = CKR_USER_PIN_NOT_INITIALIZED,
781 UserTypeInvalid = CKR_USER_TYPE_INVALID,
782 UserAnotherAlreadyLoggedIn = CKR_USER_ANOTHER_ALREADY_LOGGED_IN,
783 UserTooManyTypes = CKR_USER_TOO_MANY_TYPES,
784 WrappedKeyInvalid = CKR_WRAPPED_KEY_INVALID,
785 WrappedKeyLenRange = CKR_WRAPPED_KEY_LEN_RANGE,
786 WrappingKeyHandleInvalid = CKR_WRAPPING_KEY_HANDLE_INVALID,
787 WrappingKeySizeRange = CKR_WRAPPING_KEY_SIZE_RANGE,
788 WrappingKeyTypeInconsistent = CKR_WRAPPING_KEY_TYPE_INCONSISTENT,
789 RandomSeedNotSupported = CKR_RANDOM_SEED_NOT_SUPPORTED,
790 RandomNoRng = CKR_RANDOM_NO_RNG,
791 DomainParamsInvalid = CKR_DOMAIN_PARAMS_INVALID,
792 CurveNotSupported = CKR_CURVE_NOT_SUPPORTED,
793 BufferTooSmall = CKR_BUFFER_TOO_SMALL,
794 SavedStateInvalid = CKR_SAVED_STATE_INVALID,
795 InformationSensitive = CKR_INFORMATION_SENSITIVE,
796 StateUnsaveable = CKR_STATE_UNSAVEABLE,
797 CryptokiNotInitialized = CKR_CRYPTOKI_NOT_INITIALIZED,
798 CryptokiAlreadyInitialized = CKR_CRYPTOKI_ALREADY_INITIALIZED,
799 MutexBad = CKR_MUTEX_BAD,
800 MutexNotLocked = CKR_MUTEX_NOT_LOCKED,
801 NewPinMode = CKR_NEW_PIN_MODE,
802 NextOtp = CKR_NEXT_OTP,
803 ExceededMaxIterations = CKR_EXCEEDED_MAX_ITERATIONS,
804 FipsSelfTestFailed = CKR_FIPS_SELF_TEST_FAILED,
805 LibraryLoadFailed = CKR_LIBRARY_LOAD_FAILED,
806 PinTooWeak = CKR_PIN_TOO_WEAK,
807 PublicKeyInvalid = CKR_PUBLIC_KEY_INVALID,
808 FunctionRejected = CKR_FUNCTION_REJECTED,
809 VendorDefined = CKR_VENDOR_DEFINED,
810 };
811
812 enum class UserType : CK_USER_TYPE
813 {
814 SO = CKU_SO,
815 User = CKU_USER,
816 ContextSpecific = CKU_CONTEXT_SPECIFIC,
817 };
818
819 enum class PublicPointEncoding : uint32_t
820 {
821 Raw,
822 Der
823 };
824
825 using FunctionListPtr = CK_FUNCTION_LIST_PTR;
826 using VoidPtr = CK_VOID_PTR;
827 using C_InitializeArgs = CK_C_INITIALIZE_ARGS;
828 using CreateMutex = CK_CREATEMUTEX;
829 using DestroyMutex = CK_DESTROYMUTEX;
830 using LockMutex = CK_LOCKMUTEX;
831 using UnlockMutex = CK_UNLOCKMUTEX;
832 using Flags = CK_FLAGS;
833 using Info = CK_INFO;
834 using Bbool = CK_BBOOL;
835 using SlotId = CK_SLOT_ID;
836 using Ulong = CK_ULONG;
837 using SlotInfo = CK_SLOT_INFO;
838 using TokenInfo = CK_TOKEN_INFO;
839 using Mechanism = CK_MECHANISM;
840 using MechanismInfo = CK_MECHANISM_INFO;
841 using Utf8Char = CK_UTF8CHAR;
842 using Notify = CK_NOTIFY;
843 using SessionHandle = CK_SESSION_HANDLE;
844 using SessionInfo = CK_SESSION_INFO;
845 using Attribute = CK_ATTRIBUTE;
846 using ObjectHandle = CK_OBJECT_HANDLE;
847 using Byte = CK_BYTE;
848 using RsaPkcsOaepParams = CK_RSA_PKCS_OAEP_PARAMS;
849 using RsaPkcsPssParams = CK_RSA_PKCS_PSS_PARAMS;
850 using Ecdh1DeriveParams = CK_ECDH1_DERIVE_PARAMS;
851 using Date = CK_DATE;
852
853 BOTAN_DLL extern ReturnValue* ThrowException;
854
855 const Bbool True = CK_TRUE;
856 const Bbool False = CK_FALSE;
857
858 inline Flags flags(Flag flags)
859 {
860 return static_cast<Flags>(flags);
861 }
862
863 class Slot;
864
865 /**
866 * Initializes a token
867 * @param slot The slot with the attached token that should be initialized
868 * @param label The token label
869 * @param so_pin PIN of the security officer. Will be set if the token is uninitialized other this has to be the current SO_PIN
870 * @param pin The user PIN that will be set
871 */
872 BOTAN_DLL void initialize_token(Slot& slot, const std::string& label, const secure_string& so_pin,
873 const secure_string& pin);
874
875 /**
876 * Change PIN with old PIN to new PIN
877 * @param slot The slot with the attached token
878 * @param old_pin The old user PIN
879 * @param new_pin The new user PIN
880 */
881
882 BOTAN_DLL void change_pin(Slot& slot, const secure_string& old_pin, const secure_string& new_pin);
883
884 /**
885 * Change SO_PIN with old SO_PIN to new SO_PIN
886 * @param slot The slot with the attached token
887 * @param old_so_pin The old SO_PIN
888 * @param new_so_pin The new SO_PIN
889 */
890 BOTAN_DLL void change_so_pin(Slot& slot, const secure_string& old_so_pin, const secure_string& new_so_pin);
891
892 /**
893 * Sets user PIN with SO_PIN
894 * @param slot The slot with the attached token
895 * @param so_pin PIN of the security officer
896 * @param pin The user PIN that should be set
897 */
898 BOTAN_DLL void set_pin(Slot& slot, const secure_string& so_pin, const secure_string& pin);
899
900 /// Provides access to all PKCS#11 functions
901 class BOTAN_DLL LowLevel
902 {
903 public:
904 /// @param ptr the functon list pointer to use. Can be retrieved via `LowLevel::C_GetFunctionList`
905 explicit LowLevel(FunctionListPtr ptr);
906
907 /****************************** General purpose functions ******************************/
908
909 /**
910 * C_Initialize initializes the Cryptoki library.
911 * @param init_args if this is not nullptr, it gets cast to (`C_InitializeArgs`) and dereferenced
912 * @param return_value default value (`ThrowException`): throw exception on error.
913 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
914 * At least the following PKCS#11 return values may be returned:
915 * \li ArgumentsBad \li CantLock \li CryptokiAlreadyInitialized
916 * \li FunctionFailed \li GeneralError \li HostMemory
917 * \li NeedToCreateThreads \li OK
918 * @return true on success, false otherwise
919 */
920 bool C_Initialize(VoidPtr init_args,
921 ReturnValue* return_value = ThrowException) const;
922
923 /**
924 * C_Finalize indicates that an application is done with the Cryptoki library.
925 * @param reserved reserved. Should be nullptr
926 * @param return_value default value (`ThrowException`): throw exception on error.
927 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
928 * At least the following PKCS#11 return values may be returned:
929 * \li ArgumentsBad \li CryptokiNotInitialized \li FunctionFailed
930 * \li GeneralError \li HostMemory \li OK
931 * @return true on success, false otherwise
932 */
933 bool C_Finalize(VoidPtr reserved,
934 ReturnValue* return_value = ThrowException) const;
935
936 /**
937 * C_GetInfo returns general information about Cryptoki.
938 * @param info_ptr location that receives information
939 * @param return_value default value (`ThrowException`): throw exception on error.
940 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
941 * At least the following PKCS#11 return values may be returned:
942 * \li ArgumentsBad \li CryptokiNotInitialized \li FunctionFailed
943 * \li GeneralError \li HostMemory \li OK
944 * @return true on success, false otherwise
945 */
946 bool C_GetInfo(Info* info_ptr,
947 ReturnValue* return_value = ThrowException) const;
948
949 /**
950 * C_GetFunctionList returns the function list.
951 * @param pkcs11_module The PKCS#11 module
952 * @param function_list_ptr_ptr receives pointer to function list
953 * @param return_value default value (`ThrowException`): throw exception on error.
954 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
955 * At least the following PKCS#11 return values may be returned:
956 * \li ArgumentsBad \li FunctionFailed \li GeneralError
957 * \li HostMemory \li OK
958 * @return true on success, false otherwise
959 */
960 static bool C_GetFunctionList(Dynamically_Loaded_Library& pkcs11_module, FunctionListPtr* function_list_ptr_ptr,
961 ReturnValue* return_value = ThrowException);
962
963 /****************************** Slot and token management functions ******************************/
964
965 /**
966 * C_GetSlotList obtains a list of slots in the system.
967 * @param token_present only slots with tokens
968 * @param slot_list_ptr receives array of slot IDs
969 * @param count_ptr receives number of slots
970 * @param return_value default value (`ThrowException`): throw exception on error.
971 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
972 * At least the following PKCS#11 return values may be returned:
973 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
974 * \li FunctionFailed \li GeneralError \li HostMemory
975 * \li OK
976 * @return true on success, false otherwise
977 */
978 bool C_GetSlotList(Bbool token_present,
979 SlotId* slot_list_ptr,
980 Ulong* count_ptr,
981 ReturnValue* return_value = ThrowException) const;
982
983 /**
984 * C_GetSlotList obtains a list of slots in the system.
985 * @param token_present only slots with tokens
986 * @param slot_ids receives vector of slot IDs
987 * @param return_value default value (`ThrowException`): throw exception on error.
988 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
989 * At least the following PKCS#11 return values may be returned:
990 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
991 * \li FunctionFailed \li GeneralError \li HostMemory
992 * \li OK
993 * @return true on success, false otherwise
994 */
995 bool C_GetSlotList(bool token_present,
996 std::vector<SlotId>& slot_ids,
997 ReturnValue* return_value = ThrowException) const;
998
999 /**
1000 * C_GetSlotInfo obtains information about a particular slot in the system.
1001 * @param slot_id the ID of the slot
1002 * @param info_ptr receives the slot information
1003 * @param return_value default value (`ThrowException`): throw exception on error.
1004 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1005 * At least the following PKCS#11 return values may be returned:
1006 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1007 * \li FunctionFailed \li GeneralError \li HostMemory
1008 * \li OK \li SlotIdInvalid
1009 * @return true on success, false otherwise
1010 */
1011 bool C_GetSlotInfo(SlotId slot_id,
1012 SlotInfo* info_ptr,
1013 ReturnValue* return_value = ThrowException) const;
1014
1015 /**
1016 * C_GetTokenInfo obtains information about a particular token in the system.
1017 * @param slot_id ID of the token's slot
1018 * @param info_ptr receives the token information
1019 * @param return_value default value (`ThrowException`): throw exception on error.
1020 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1021 * At least the following PKCS#11 return values may be returned:
1022 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1023 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1024 * \li HostMemory \li OK \li SlotIdInvalid
1025 * \li TokenNotPresent \li TokenNotRecognized \li ArgumentsBad
1026 * @return true on success, false otherwise
1027 */
1028 bool C_GetTokenInfo(SlotId slot_id,
1029 TokenInfo* info_ptr,
1030 ReturnValue* return_value = ThrowException) const;
1031
1032 /**
1033 * C_WaitForSlotEvent waits for a slot event (token insertion, removal, etc.) to occur.
1034 * @param flags blocking/nonblocking flag
1035 * @param slot_ptr location that receives the slot ID
1036 * @param reserved reserved. Should be NULL_PTR
1037 * @param return_value default value (`ThrowException`): throw exception on error.
1038 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1039 * At least the following PKCS#11 return values may be returned:
1040 * \li ArgumentsBad \li CryptokiNotInitialized \li FunctionFailed
1041 * \li GeneralError \li HostMemory \li NoEvent
1042 * \li OK
1043 * @return true on success, false otherwise
1044 */
1045 bool C_WaitForSlotEvent(Flags flags,
1046 SlotId* slot_ptr,
1047 VoidPtr reserved,
1048 ReturnValue* return_value = ThrowException) const;
1049
1050 /**
1051 * C_GetMechanismList obtains a list of mechanism types supported by a token.
1052 * @param slot_id ID of token's slot
1053 * @param mechanism_list_ptr gets mech. array
1054 * @param count_ptr gets # of mechs.
1055 * @param return_value default value (`ThrowException`): throw exception on error.
1056 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1057 * At least the following PKCS#11 return values may be returned:
1058 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1059 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1060 * \li GeneralError \li HostMemory \li OK
1061 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1062 * \li ArgumentsBad
1063 * @return true on success, false otherwise
1064 */
1065 bool C_GetMechanismList(SlotId slot_id,
1066 MechanismType* mechanism_list_ptr,
1067 Ulong* count_ptr,
1068 ReturnValue* return_value = ThrowException) const;
1069
1070 /**
1071 * C_GetMechanismList obtains a list of mechanism types supported by a token.
1072 * @param slot_id ID of token's slot
1073 * @param mechanisms receives vector of supported mechanisms
1074 * @param return_value default value (`ThrowException`): throw exception on error.
1075 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1076 * At least the following PKCS#11 return values may be returned:
1077 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1078 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1079 * \li GeneralError \li HostMemory \li OK
1080 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1081 * \li ArgumentsBad
1082 * @return true on success, false otherwise
1083 */
1084 bool C_GetMechanismList(SlotId slot_id,
1085 std::vector<MechanismType>& mechanisms,
1086 ReturnValue* return_value = ThrowException) const;
1087
1088 /**
1089 * C_GetMechanismInfo obtains information about a particular mechanism possibly supported by a token.
1090 * @param slot_id ID of the token's slot
1091 * @param type type of mechanism
1092 * @param info_ptr receives mechanism info
1093 * @param return_value default value (`ThrowException`): throw exception on error.
1094 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1095 * At least the following PKCS#11 return values may be returned:
1096 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1097 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1098 * \li HostMemory \li MechanismInvalid \li OK
1099 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1100 * \li ArgumentsBad
1101 * @return true on success, false otherwise
1102 */
1103 bool C_GetMechanismInfo(SlotId slot_id,
1104 MechanismType type,
1105 MechanismInfo* info_ptr,
1106 ReturnValue* return_value = ThrowException) const;
1107
1108 /**
1109 * C_InitToken initializes a token.
1110 * @param slot_id ID of the token's slot
1111 * @param so_pin_ptr the SO's initial PIN
1112 * @param so_pin_len length in bytes of the SO_PIN
1113 * @param label_ptr 32-byte token label (blank padded)
1114 * @param return_value default value (`ThrowException`): throw exception on error.
1115 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1116 * At least the following PKCS#11 return values may be returned:
1117 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1118 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1119 * \li GeneralError \li HostMemory \li OK
1120 * \li PinIncorrect \li PinLocked \li SessionExists
1121 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1122 * \li TokenWriteProtected \li ArgumentsBad
1123 * @return true on success, false otherwise
1124 */
1125 bool C_InitToken(SlotId slot_id,
1126 Utf8Char* so_pin_ptr,
1127 Ulong so_pin_len,
1128 Utf8Char* label_ptr,
1129 ReturnValue* return_value = ThrowException) const;
1130
1131 /**
1132 * C_InitToken initializes a token.
1133 * @param slot_id ID of the token's slot
1134 * @param so_pin the SO's initial PIN
1135 * @param label token label (at max 32 bytes long)
1136 * @param return_value default value (`ThrowException`): throw exception on error.
1137 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1138 * At least the following PKCS#11 return values may be returned:
1139 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1140 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1141 * \li GeneralError \li HostMemory \li OK
1142 * \li PinIncorrect \li PinLocked \li SessionExists
1143 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1144 * \li TokenWriteProtected \li ArgumentsBad
1145 * @return true on success, false otherwise
1146 */
1147 template<typename TAlloc>
1148 bool C_InitToken(SlotId slot_id,
1149 const std::vector<uint8_t, TAlloc>& so_pin,
1150 const std::string& label,
1151 ReturnValue* return_value = ThrowException) const
1152 {
1153 std::string padded_label = label;
1154 if(label.size() < 32)
1155 {
1156 padded_label.insert(padded_label.end(), 32 - label.size(), ' ');
1157 }
1158
1159 return C_InitToken(slot_id, reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(so_pin.data())),
1160 so_pin.size(), reinterpret_cast< Utf8Char* >(const_cast< char* >(padded_label.c_str())), return_value);
1161 }
1162
1163 /**
1164 * C_InitPIN initializes the normal user's PIN.
1165 * @param session the session's handle
1166 * @param pin_ptr the normal user's PIN
1167 * @param pin_len length in bytes of the PIN
1168 * @param return_value default value (`ThrowException`): throw exception on error.
1169 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1170 * At least the following PKCS#11 return values may be returned:
1171 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1172 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1173 * \li GeneralError \li HostMemory \li OK
1174 * \li PinInvalid \li PinLenRange \li SessionClosed
1175 * \li SessionReadOnly \li SessionHandleInvalid \li TokenWriteProtected
1176 * \li UserNotLoggedIn \li ArgumentsBad
1177 * @return true on success, false otherwise
1178 */
1179 bool C_InitPIN(SessionHandle session,
1180 Utf8Char* pin_ptr,
1181 Ulong pin_len,
1182 ReturnValue* return_value = ThrowException) const;
1183
1184 /**
1185 * C_InitPIN initializes the normal user's PIN.
1186 * @param session the session's handle
1187 * @param pin the normal user's PIN
1188 * @param return_value default value (`ThrowException`): throw exception on error.
1189 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1190 * At least the following PKCS#11 return values may be returned:
1191 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1192 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1193 * \li GeneralError \li HostMemory \li OK
1194 * \li PinInvalid \li PinLenRange \li SessionClosed
1195 * \li SessionReadOnly \li SessionHandleInvalid \li TokenWriteProtected
1196 * \li UserNotLoggedIn \li ArgumentsBad
1197 * @return true on success, false otherwise
1198 */
1199 template<typename TAlloc>
1200 bool C_InitPIN(SessionHandle session,
1201 const std::vector<uint8_t, TAlloc>& pin,
1202 ReturnValue* return_value = ThrowException) const
1203 {
1204 return C_InitPIN(session, reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(pin.data())), pin.size(), return_value);
1205 }
1206
1207 /**
1208 * C_SetPIN modifies the PIN of the user who is logged in.
1209 * @param session the session's handle
1210 * @param old_pin_ptr the old PIN
1211 * @param old_len length of the old PIN
1212 * @param new_pin_ptr the new PIN
1213 * @param new_len length of the new PIN
1214 * @param return_value default value (`ThrowException`): throw exception on error.
1215 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1216 * At least the following PKCS#11 return values may be returned:
1217 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1218 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1219 * \li GeneralError \li HostMemory \li OK
1220 * \li PinIncorrect \li PinInvalid \li PinLenRange
1221 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1222 * \li SessionReadOnly \li TokenWriteProtected \li ArgumentsBad
1223 * @return true on success, false otherwise
1224 */
1225 bool C_SetPIN(SessionHandle session,
1226 Utf8Char* old_pin_ptr,
1227 Ulong old_len,
1228 Utf8Char* new_pin_ptr,
1229 Ulong new_len,
1230 ReturnValue* return_value = ThrowException) const;
1231
1232 /**
1233 * C_SetPIN modifies the PIN of the user who is logged in.
1234 * @param session the session's handle
1235 * @param old_pin the old PIN
1236 * @param new_pin the new PIN
1237 * @param return_value default value (`ThrowException`): throw exception on error.
1238 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1239 * At least the following PKCS#11 return values may be returned:
1240 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1241 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1242 * \li GeneralError \li HostMemory \li OK
1243 * \li PinIncorrect \li PinInvalid \li PinLenRange
1244 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1245 * \li SessionReadOnly \li TokenWriteProtected \li ArgumentsBad
1246 * @return true on success, false otherwise
1247 */
1248 template<typename TAlloc>
1249 bool C_SetPIN(SessionHandle session,
1250 const std::vector<uint8_t, TAlloc>& old_pin,
1251 const std::vector<uint8_t, TAlloc>& new_pin,
1252 ReturnValue* return_value = ThrowException) const
1253 {
1254 return C_SetPIN(session,
1255 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(old_pin.data())), old_pin.size(),
1256 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(new_pin.data())), new_pin.size(),
1257 return_value);
1258 }
1259
1260
1261 /****************************** Session management ******************************/
1262
1263 /**
1264 * C_OpenSession opens a session between an application and a token.
1265 * @param slot_id the slot's ID
1266 * @param flags from CK_SESSION_INFO
1267 * @param application passed to callback
1268 * @param notify callback function
1269 * @param session_ptr gets session handle
1270 * @param return_value default value (`ThrowException`): throw exception on error.
1271 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1272 * At least the following PKCS#11 return values may be returned:
1273 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1274 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1275 * \li HostMemory \li OK \li SessionCount
1276 * \li SessionParallelNotSupported \li SessionReadWriteSoExists \li SlotIdInvalid
1277 * \li TokenNotPresent \li TokenNotRecognized \li TokenWriteProtected
1278 * \li ArgumentsBad
1279 * @return true on success, false otherwise
1280 */
1281 bool C_OpenSession(SlotId slot_id,
1282 Flags flags,
1283 VoidPtr application,
1284 Notify notify,
1285 SessionHandle* session_ptr,
1286 ReturnValue* return_value = ThrowException) const;
1287
1288 /**
1289 * C_CloseSession closes a session between an application and a token.
1290 * @param session the session's handle
1291 * @param return_value default value (`ThrowException`): throw exception on error.
1292 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1293 * At least the following PKCS#11 return values may be returned:
1294 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1295 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1296 * \li HostMemory \li OK \li SessionClosed
1297 * \li SessionHandleInvalid
1298 * @return true on success, false otherwise
1299 */
1300 bool C_CloseSession(SessionHandle session,
1301 ReturnValue* return_value = ThrowException) const;
1302
1303 /**
1304 * C_CloseAllSessions closes all sessions with a token.
1305 * @param slot_id the token's slot
1306 * @param return_value default value (`ThrowException`): throw exception on error.
1307 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1308 * At least the following PKCS#11 return values may be returned:
1309 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1310 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1311 * \li HostMemory \li OK \li SlotIdInvalid
1312 * \li TokenNotPresent
1313 * @return true on success, false otherwise
1314 */
1315 bool C_CloseAllSessions(SlotId slot_id,
1316 ReturnValue* return_value = ThrowException) const;
1317
1318 /**
1319 * C_GetSessionInfo obtains information about the session.
1320 * @param session the session's handle
1321 * @param info_ptr receives session info
1322 * @param return_value default value (`ThrowException`): throw exception on error.
1323 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1324 * At least the following PKCS#11 return values may be returned:
1325 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1326 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1327 * \li HostMemory \li OK \li SessionClosed
1328 * \li SessionHandleInvalid \li ArgumentsBad
1329 * @return true on success, false otherwise
1330 */
1331 bool C_GetSessionInfo(SessionHandle session,
1332 SessionInfo* info_ptr,
1333 ReturnValue* return_value = ThrowException) const;
1334
1335 /**
1336 * C_GetOperationState obtains the state of the cryptographic operation in a session.
1337 * @param session session's handle
1338 * @param operation_state_ptr gets state
1339 * @param operation_state_len_ptr gets state length
1340 * @param return_value default value (`ThrowException`): throw exception on error.
1341 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1342 * At least the following PKCS#11 return values may be returned:
1343 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1344 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1345 * \li GeneralError \li HostMemory \li OK
1346 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1347 * \li StateUnsaveable \li ArgumentsBad
1348 * @return true on success, false otherwise
1349 */
1350 bool C_GetOperationState(SessionHandle session,
1351 Byte* operation_state_ptr,
1352 Ulong* operation_state_len_ptr,
1353 ReturnValue* return_value = ThrowException) const;
1354
1355 /**
1356 * C_SetOperationState restores the state of the cryptographic operation in a session.
1357 * @param session session's handle
1358 * @param operation_state_ptr holds state
1359 * @param operation_state_len holds state length
1360 * @param encryption_key en/decryption key
1361 * @param authentication_key sign/verify key
1362 * @param return_value default value (`ThrowException`): throw exception on error.
1363 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1364 * At least the following PKCS#11 return values may be returned:
1365 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1366 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1367 * \li HostMemory \li KeyChanged \li KeyNeeded
1368 * \li KeyNotNeeded \li OK \li SavedStateInvalid
1369 * \li SessionClosed \li SessionHandleInvalid \li ArgumentsBad
1370 * @return true on success, false otherwise
1371 */
1372 bool C_SetOperationState(SessionHandle session,
1373 Byte* operation_state_ptr,
1374 Ulong operation_state_len,
1375 ObjectHandle encryption_key,
1376 ObjectHandle authentication_key,
1377 ReturnValue* return_value = ThrowException) const;
1378
1379 /**
1380 * C_Login logs a user into a token.
1381 * @param session the session's handle
1382 * @param user_type the user type
1383 * @param pin_ptr the user's PIN
1384 * @param pin_len the length of the PIN
1385 * @param return_value default value (`ThrowException`): throw exception on error.
1386 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1387 * At least the following PKCS#11 return values may be returned:
1388 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1389 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1390 * \li FunctionFailed \li GeneralError \li HostMemory
1391 * \li OK \li OperationNotInitialized \li PinIncorrect
1392 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1393 * \li SessionReadOnlyExists \li UserAlreadyLoggedIn \li UserAnotherAlreadyLoggedIn
1394 * \li UserPinNotInitialized \li UserTooManyTypes \li UserTypeInvalid
1395 * @return true on success, false otherwise
1396 */
1397 bool C_Login(SessionHandle session,
1398 UserType user_type,
1399 Utf8Char* pin_ptr,
1400 Ulong pin_len,
1401 ReturnValue* return_value = ThrowException) const;
1402
1403 /**
1404 * C_Login logs a user into a token.
1405 * @param session the session's handle
1406 * @param user_type the user type
1407 * @param pin the user or security officer's PIN
1408 * @param return_value default value (`ThrowException`): throw exception on error.
1409 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1410 * At least the following PKCS#11 return values may be returned:
1411 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1412 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1413 * \li FunctionFailed \li GeneralError \li HostMemory
1414 * \li OK \li OperationNotInitialized \li PinIncorrect
1415 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1416 * \li SessionReadOnlyExists \li UserAlreadyLoggedIn \li UserAnotherAlreadyLoggedIn
1417 * \li UserPinNotInitialized \li UserTooManyTypes \li UserTypeInvalid
1418 * @return true on success, false otherwise
1419 */
1420 template<typename TAlloc>
1421 bool C_Login(SessionHandle session,
1422 UserType user_type,
1423 const std::vector<uint8_t, TAlloc>& pin,
1424 ReturnValue* return_value = ThrowException) const
1425 {
1426 return C_Login(session, user_type, reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(pin.data())), pin.size(),
1427 return_value);
1428 }
1429
1430 /**
1431 * C_Logout logs a user out from a token.
1432 * @param session the session's handle
1433 * @param return_value default value (`ThrowException`): throw exception on error.
1434 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1435 * At least the following PKCS#11 return values may be returned:
1436 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1437 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1438 * \li HostMemory \li OK \li SessionClosed
1439 * \li SessionHandleInvalid \li UserNotLoggedIn
1440 * @return true on success, false otherwise
1441 */
1442 bool C_Logout(SessionHandle session,
1443 ReturnValue* return_value = ThrowException) const;
1444
1445 /****************************** Object management functions ******************************/
1446
1447 /**
1448 * C_CreateObject creates a new object.
1449 * @param session the session's handle
1450 * @param attribute_template_ptr the object's template
1451 * @param count attributes in template
1452 * @param object_ptr gets new object's handle.
1453 * @param return_value default value (`ThrowException`): throw exception on error.
1454 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1455 * At least the following PKCS#11 return values may be returned:
1456 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
1457 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
1458 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1459 * \li DomainParamsInvalid \li FunctionFailed \li GeneralError
1460 * \li HostMemory \li OK \li PinExpired
1461 * \li SessionClosed \li SessionHandleInvalid \li SessionReadOnly
1462 * \li TemplateIncomplete \li TemplateInconsistent \li TokenWriteProtected
1463 * \li UserNotLoggedIn
1464 * @return true on success, false otherwise
1465 */
1466 bool C_CreateObject(SessionHandle session,
1467 Attribute* attribute_template_ptr,
1468 Ulong count,
1469 ObjectHandle* object_ptr,
1470 ReturnValue* return_value = ThrowException) const;
1471
1472 /**
1473 * C_CopyObject copies an object, creating a new object for the copy.
1474 * @param session the session's handle
1475 * @param object the object's handle
1476 * @param attribute_template_ptr template for new object
1477 * @param count attributes in template
1478 * @param new_object_ptr receives handle of copy
1479 * @param return_value default value (`ThrowException`): throw exception on error.
1480 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1481 * At least the following PKCS#11 return values may be returned:
1482 * \li ActionProhibited \li ArgumentsBad \li AttributeReadOnly
1483 * \li AttributeTypeInvalid \li AttributeValueInvalid \li CryptokiNotInitialized
1484 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1485 * \li FunctionFailed \li GeneralError \li HostMemory
1486 * \li ObjectHandleInvalid \li OK \li PinExpired
1487 * \li SessionClosed \li SessionHandleInvalid \li SessionReadOnly
1488 * \li TemplateInconsistent \li TokenWriteProtected \li UserNotLoggedIn
1489 * @return true on success, false otherwise
1490 */
1491 bool C_CopyObject(SessionHandle session,
1492 ObjectHandle object,
1493 Attribute* attribute_template_ptr,
1494 Ulong count,
1495 ObjectHandle* new_object_ptr,
1496 ReturnValue* return_value = ThrowException) const;
1497
1498 /**
1499 * C_DestroyObject destroys an object.
1500 * @param session the session's handle
1501 * @param object the object's handle
1502 * @param return_value default value (`ThrowException`): throw exception on error.
1503 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1504 * At least the following PKCS#11 return values may be returned:
1505 * \li ActionProhibited \li CryptokiNotInitialized \li DeviceError
1506 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1507 * \li GeneralError \li HostMemory \li ObjectHandleInvalid
1508 * \li OK \li PinExpired \li SessionClosed
1509 * \li SessionHandleInvalid \li SessionReadOnly \li TokenWriteProtected
1510 * @return true on success, false otherwise
1511 */
1512 bool C_DestroyObject(SessionHandle session,
1513 ObjectHandle object,
1514 ReturnValue* return_value = ThrowException) const;
1515
1516 /**
1517 * C_GetObjectSize gets the size of an object in bytes.
1518 * @param session the session's handle
1519 * @param object the object's handle
1520 * @param size_ptr receives size of object
1521 * @param return_value default value (`ThrowException`): throw exception on error.
1522 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1523 * At least the following PKCS#11 return values may be returned:
1524 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1525 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1526 * \li GeneralError \li HostMemory \li InformationSensitive
1527 * \li ObjectHandleInvalid \li OK \li SessionClosed
1528 * \li SessionHandleInvalid
1529 * @return true on success, false otherwise
1530 */
1531 bool C_GetObjectSize(SessionHandle session,
1532 ObjectHandle object,
1533 Ulong* size_ptr,
1534 ReturnValue* return_value = ThrowException) const;
1535
1536 /**
1537 * C_GetAttributeValue obtains the value of one or more object attributes.
1538 * @param session the session's handle
1539 * @param object the object's handle
1540 * @param attribute_template_ptr specifies attrs; gets vals
1541 * @param count attributes in template
1542 * @param return_value default value (`ThrowException`): throw exception on error.
1543 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1544 * At least the following PKCS#11 return values may be returned:
1545 * \li ArgumentsBad \li AttributeSensitive \li AttributeTypeInvalid
1546 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1547 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1548 * \li GeneralError \li HostMemory \li ObjectHandleInvalid
1549 * \li OK \li SessionClosed \li SessionHandleInvalid
1550 * @return true on success, false otherwise
1551 */
1552 bool C_GetAttributeValue(SessionHandle session,
1553 ObjectHandle object,
1554 Attribute* attribute_template_ptr,
1555 Ulong count,
1556 ReturnValue* return_value = ThrowException) const;
1557
1558 /**
1559 * C_GetAttributeValue obtains the value of one or more object attributes.
1560 * @param session the session's handle
1561 * @param object the object's handle
1562 * @param attribute_values specifies attrs; gets vals
1563 * @param return_value default value (`ThrowException`): throw exception on error.
1564 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1565 * At least the following PKCS#11 return values may be returned:
1566 * \li ArgumentsBad \li AttributeSensitive \li AttributeTypeInvalid
1567 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1568 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1569 * \li GeneralError \li HostMemory \li ObjectHandleInvalid
1570 * \li OK \li SessionClosed \li SessionHandleInvalid
1571 * @return true on success, false otherwise
1572 */
1573 template<typename TAlloc>
1574 bool C_GetAttributeValue(SessionHandle session,
1575 ObjectHandle object,
1576 std::map<AttributeType, std::vector<uint8_t, TAlloc>>& attribute_values,
1577 ReturnValue* return_value = ThrowException) const
1578 {
1579 std::vector<Attribute> getter_template;
1580
1581 for(const auto& entry : attribute_values)
1582 {
1583 getter_template.emplace_back(Attribute{ static_cast< CK_ATTRIBUTE_TYPE >(entry.first), nullptr, 0 });
1584 }
1585
1586 bool success = C_GetAttributeValue(session, object, const_cast< Attribute* >(getter_template.data()),
1587 getter_template.size(), return_value);
1588
1589 if(!success)
1590 {
1591 return success;
1592 }
1593
1594 size_t i = 0;
1595 for(auto& entry : attribute_values)
1596 {
1597 entry.second.clear();
1598 entry.second.resize(getter_template.at(i).ulValueLen);
1599 getter_template.at(i).pValue = const_cast< uint8_t* >(entry.second.data());
1600 i++;
1601 }
1602
1603 return C_GetAttributeValue(session, object, const_cast< Attribute* >(getter_template.data()), getter_template.size(),
1604 return_value);
1605 }
1606
1607 /**
1608 * C_SetAttributeValue modifies the value of one or more object attributes.
1609 * @param session the session's handle
1610 * @param object the object's handle
1611 * @param attribute_template_ptr specifies attrs and values
1612 * @param count attributes in template
1613 * @param return_value default value (`ThrowException`): throw exception on error.
1614 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1615 * At least the following PKCS#11 return values may be returned:
1616 * \li ActionProhibited \li ArgumentsBad \li AttributeReadOnly
1617 * \li AttributeTypeInvalid \li AttributeValueInvalid \li CryptokiNotInitialized
1618 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1619 * \li FunctionFailed \li GeneralError \li HostMemory
1620 * \li ObjectHandleInvalid \li OK \li SessionClosed
1621 * \li SessionHandleInvalid \li SessionReadOnly \li TemplateInconsistent
1622 * \li TokenWriteProtected \li UserNotLoggedIn
1623 * @return true on success, false otherwise
1624 */
1625 bool C_SetAttributeValue(SessionHandle session,
1626 ObjectHandle object,
1627 Attribute* attribute_template_ptr,
1628 Ulong count,
1629 ReturnValue* return_value = ThrowException) const;
1630
1631 /**
1632 * C_SetAttributeValue modifies the value of one or more object attributes.
1633 * @param session the session's handle
1634 * @param object the object's handle
1635 * @param attribute_values specifies attrs and values
1636 * @param return_value default value (`ThrowException`): throw exception on error.
1637 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1638 * At least the following PKCS#11 return values may be returned:
1639 * \li ActionProhibited \li ArgumentsBad \li AttributeReadOnly
1640 * \li AttributeTypeInvalid \li AttributeValueInvalid \li CryptokiNotInitialized
1641 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1642 * \li FunctionFailed \li GeneralError \li HostMemory
1643 * \li ObjectHandleInvalid \li OK \li SessionClosed
1644 * \li SessionHandleInvalid \li SessionReadOnly \li TemplateInconsistent
1645 * \li TokenWriteProtected \li UserNotLoggedIn
1646 * @return true on success, false otherwise
1647 */
1648 template<typename TAlloc>
1649 bool C_SetAttributeValue(SessionHandle session,
1650 ObjectHandle object,
1651 std::map<AttributeType, std::vector<uint8_t, TAlloc>>& attribute_values,
1652 ReturnValue* return_value = ThrowException) const
1653 {
1654 std::vector<Attribute> setter_template;
1655
1656 for(auto& entry : attribute_values)
1657 {
1658 setter_template.emplace_back(Attribute{ static_cast< CK_ATTRIBUTE_TYPE >(entry.first), entry.second.data(), static_cast<CK_ULONG>(entry.second.size()) });
1659 }
1660
1661 return C_SetAttributeValue(session, object, const_cast< Attribute* >(setter_template.data()), setter_template.size(),
1662 return_value);
1663 }
1664
1665 /**
1666 * C_FindObjectsInit initializes a search for token and session objects that match a template.
1667 * @param session the session's handle
1668 * @param attribute_template_ptr attribute values to match
1669 * @param count attrs in search template
1670 * @param return_value default value (`ThrowException`): throw exception on error.
1671 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1672 * At least the following PKCS#11 return values may be returned:
1673 * \li ArgumentsBad \li AttributeTypeInvalid \li AttributeValueInvalid
1674 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1675 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1676 * \li HostMemory \li OK \li OperationActive
1677 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
1678 * @return true on success, false otherwise
1679 */
1680 bool C_FindObjectsInit(SessionHandle session,
1681 Attribute* attribute_template_ptr,
1682 Ulong count,
1683 ReturnValue* return_value = ThrowException) const;
1684
1685 /**
1686 * C_FindObjects continues a search for token and session objects that match a template, obtaining additional object handles.
1687 * @param session session's handle
1688 * @param object_ptr gets obj. handles
1689 * @param max_object_count max handles to get
1690 * @param object_count_ptr actual # returned
1691 * @param return_value default value (`ThrowException`): throw exception on error.
1692 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1693 * At least the following PKCS#11 return values may be returned:
1694 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1695 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1696 * \li GeneralError \li HostMemory \li OK
1697 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1698 * @return true on success, false otherwise
1699 */
1700 bool C_FindObjects(SessionHandle session,
1701 ObjectHandle* object_ptr,
1702 Ulong max_object_count,
1703 Ulong* object_count_ptr,
1704 ReturnValue* return_value = ThrowException) const;
1705
1706 /**
1707 * C_FindObjectsFinal finishes a search for token and session objects.
1708 * @param session the session's handle
1709 * @param return_value default value (`ThrowException`): throw exception on error.
1710 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1711 * At least the following PKCS#11 return values may be returned:
1712 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1713 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1714 * \li HostMemory \li OK \li OperationNotInitialized
1715 * \li SessionClosed \li SessionHandleInvalid
1716 * @return true on success, false otherwise
1717 */
1718 bool C_FindObjectsFinal(SessionHandle session,
1719 ReturnValue* return_value = ThrowException) const;
1720
1721 /****************************** Encryption functions ******************************/
1722
1723 /**
1724 * C_EncryptInit initializes an encryption operation.
1725 * @param session the session's handle
1726 * @param mechanism_ptr the encryption mechanism
1727 * @param key handle of encryption key
1728 * @param return_value default value (`ThrowException`): throw exception on error.
1729 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1730 * At least the following PKCS#11 return values may be returned:
1731 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1732 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1733 * \li GeneralError \li HostMemory \li KeyFunctionNotPermitted
1734 * \li KeyHandleInvalid \li KeySizeRange \li KeyTypeInconsistent
1735 * \li MechanismInvalid \li MechanismParamInvalid \li OK
1736 * \li OperationActive \li PinExpired \li SessionClosed
1737 * \li SessionHandleInvalid \li UserNotLoggedIn
1738 * @return true on success, false otherwise
1739 */
1740 bool C_EncryptInit(SessionHandle session,
1741 Mechanism* mechanism_ptr,
1742 ObjectHandle key,
1743 ReturnValue* return_value = ThrowException) const;
1744
1745 /**
1746 * C_Encrypt encrypts single-part data.
1747 * @param session session's handle
1748 * @param data_ptr the plaintext data
1749 * @param data_len size of plaintext data in bytes
1750 * @param encrypted_data gets ciphertext
1751 * @param encrypted_data_len_ptr gets c-text size
1752 * @param return_value default value (`ThrowException`): throw exception on error.
1753 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1754 * At least the following PKCS#11 return values may be returned:
1755 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1756 * \li DataInvalid \li DataLenRange \li DeviceError
1757 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1758 * \li FunctionFailed \li GeneralError \li HostMemory
1759 * \li OK \li OperationNotInitialized \li SessionClosed
1760 * \li SessionHandleInvalid
1761 * @return true on success, false otherwise
1762 */
1763 bool C_Encrypt(SessionHandle session,
1764 Byte* data_ptr,
1765 Ulong data_len,
1766 Byte* encrypted_data,
1767 Ulong* encrypted_data_len_ptr,
1768 ReturnValue* return_value = ThrowException) const;
1769
1770 /**
1771 * C_Encrypt encrypts single-part data.
1772 * @param session session's handle
1773 * @param plaintext_data the plaintext data
1774 * @param encrypted_data gets ciphertext
1775 * @param return_value default value (`ThrowException`): throw exception on error.
1776 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1777 * At least the following PKCS#11 return values may be returned:
1778 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1779 * \li DataInvalid \li DataLenRange \li DeviceError
1780 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1781 * \li FunctionFailed \li GeneralError \li HostMemory
1782 * \li OK \li OperationNotInitialized \li SessionClosed
1783 * \li SessionHandleInvalid
1784 * @return true on success, false otherwise
1785 */
1786 template<typename TAllocA, typename TAllocB>
1787 bool C_Encrypt(SessionHandle session,
1788 const std::vector<uint8_t, TAllocA>& plaintext_data,
1789 std::vector<uint8_t, TAllocB>& encrypted_data,
1790 ReturnValue* return_value = ThrowException) const
1791 {
1792 Ulong encrypted_size = 0;
1793 if(!C_Encrypt(session, const_cast<Byte*>((plaintext_data.data())), plaintext_data.size(), nullptr, &encrypted_size,
1794 return_value))
1795 {
1796 return false;
1797 }
1798
1799 encrypted_data.resize(encrypted_size);
1800 return C_Encrypt(session, const_cast<Byte*>(plaintext_data.data()), plaintext_data.size(), encrypted_data.data(),
1801 &encrypted_size, return_value);
1802 }
1803
1804 /**
1805 * C_EncryptUpdate continues a multiple-part encryption operation.
1806 * @param session session's handle
1807 * @param part_ptr the plaintext data
1808 * @param part_len plaintext data len
1809 * @param encrypted_part_ptr gets ciphertext
1810 * @param encrypted_part_len_ptr gets c-text size
1811 * @param return_value default value (`ThrowException`): throw exception on error.
1812 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1813 * At least the following PKCS#11 return values may be returned:
1814 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1815 * \li DataLenRange \li DeviceError \li DeviceMemory
1816 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1817 * \li GeneralError \li HostMemory \li OK
1818 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1819 * @return true on success, false otherwise
1820 */
1821 bool C_EncryptUpdate(SessionHandle session,
1822 Byte* part_ptr,
1823 Ulong part_len,
1824 Byte* encrypted_part_ptr,
1825 Ulong* encrypted_part_len_ptr,
1826 ReturnValue* return_value = ThrowException) const;
1827
1828 /**
1829 * C_EncryptFinal finishes a multiple-part encryption operation.
1830 * @param session session handle
1831 * @param last_encrypted_part_ptr last c-text
1832 * @param last_encrypted_part_len_ptr gets last size
1833 * @param return_value default value (`ThrowException`): throw exception on error.
1834 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1835 * At least the following PKCS#11 return values may be returned:
1836 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1837 * \li DataLenRange \li DeviceError \li DeviceMemory
1838 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1839 * \li GeneralError \li HostMemory \li OK
1840 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1841 * @return true on success, false otherwise
1842 */
1843 bool C_EncryptFinal(SessionHandle session,
1844 Byte* last_encrypted_part_ptr,
1845 Ulong* last_encrypted_part_len_ptr,
1846 ReturnValue* return_value = ThrowException) const;
1847
1848 /****************************** Decryption functions ******************************/
1849
1850 /**
1851 * C_DecryptInit initializes a decryption operation.
1852 * @param session the session's handle
1853 * @param mechanism_ptr the decryption mechanism
1854 * @param key handle of decryption key
1855 * @param return_value default value (`ThrowException`): throw exception on error.
1856 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1857 * At least the following PKCS#11 return values may be returned:
1858 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1859 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1860 * \li FunctionFailed \li GeneralError \li HostMemory
1861 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
1862 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
1863 * \li OK \li OperationActive \li PinExpired
1864 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
1865 * @return true on success, false otherwise
1866 */
1867 bool C_DecryptInit(SessionHandle session,
1868 Mechanism* mechanism_ptr,
1869 ObjectHandle key,
1870 ReturnValue* return_value = ThrowException) const;
1871
1872 /**
1873 * C_Decrypt decrypts encrypted data in a single part.
1874 * @param session session's handle
1875 * @param encrypted_data_ptr ciphertext
1876 * @param encrypted_data_len ciphertext length
1877 * @param data_ptr gets plaintext
1878 * @param data_len_ptr gets p-text size
1879 * @param return_value default value (`ThrowException`): throw exception on error.
1880 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1881 * At least the following PKCS#11 return values may be returned:
1882 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1883 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1884 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1885 * \li FunctionFailed \li GeneralError \li HostMemory
1886 * \li OK \li OperationNotInitialized \li SessionClosed
1887 * \li SessionHandleInvalid \li UserNotLoggedIn
1888 * @return true on success, false otherwise
1889 */
1890 bool C_Decrypt(SessionHandle session,
1891 Byte* encrypted_data_ptr,
1892 Ulong encrypted_data_len,
1893 Byte* data_ptr,
1894 Ulong* data_len_ptr,
1895 ReturnValue* return_value = ThrowException) const;
1896
1897 /**
1898 * C_Decrypt decrypts encrypted data in a single part.
1899 * @param session session's handle
1900 * @param encrypted_data ciphertext
1901 * @param decrypted_data gets plaintext
1902 * @param return_value default value (`ThrowException`): throw exception on error.
1903 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1904 * At least the following PKCS#11 return values may be returned:
1905 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1906 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1907 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1908 * \li FunctionFailed \li GeneralError \li HostMemory
1909 * \li OK \li OperationNotInitialized \li SessionClosed
1910 * \li SessionHandleInvalid \li UserNotLoggedIn
1911 * @return true on success, false otherwise
1912 */
1913 template<typename TAllocA, typename TAllocB>
1914 bool C_Decrypt(SessionHandle session,
1915 const std::vector<uint8_t, TAllocA>& encrypted_data,
1916 std::vector<uint8_t, TAllocB>& decrypted_data,
1917 ReturnValue* return_value = ThrowException) const
1918 {
1919 Ulong decrypted_size = 0;
1920 if(!C_Decrypt(session, const_cast<Byte*>((encrypted_data.data())), encrypted_data.size(), nullptr, &decrypted_size,
1921 return_value))
1922 {
1923 return false;
1924 }
1925
1926 decrypted_data.resize(decrypted_size);
1927 return C_Decrypt(session, const_cast<Byte*>(encrypted_data.data()), encrypted_data.size(), decrypted_data.data(),
1928 &decrypted_size, return_value);
1929 }
1930
1931 /**
1932 * C_DecryptUpdate continues a multiple-part decryption operation.
1933 * @param session session's handle
1934 * @param encrypted_part_ptr encrypted data
1935 * @param encrypted_part_len input length
1936 * @param part_ptr gets plaintext
1937 * @param part_len_ptr p-text size
1938 * @param return_value default value (`ThrowException`): throw exception on error.
1939 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1940 * At least the following PKCS#11 return values may be returned:
1941 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1942 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1943 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1944 * \li FunctionFailed \li GeneralError \li HostMemory
1945 * \li OK \li OperationNotInitialized \li SessionClosed
1946 * \li SessionHandleInvalid \li UserNotLoggedIn
1947 * @return true on success, false otherwise
1948 */
1949 bool C_DecryptUpdate(SessionHandle session,
1950 Byte* encrypted_part_ptr,
1951 Ulong encrypted_part_len,
1952 Byte* part_ptr,
1953 Ulong* part_len_ptr,
1954 ReturnValue* return_value = ThrowException) const;
1955
1956 /**
1957 * C_DecryptFinal finishes a multiple-part decryption operation.
1958 * @param session the session's handle
1959 * @param last_part_ptr gets plaintext
1960 * @param last_part_len_ptr p-text size
1961 * @param return_value default value (`ThrowException`): throw exception on error.
1962 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1963 * At least the following PKCS#11 return values may be returned:
1964 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1965 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1966 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1967 * \li FunctionFailed \li GeneralError \li HostMemory
1968 * \li OK \li OperationNotInitialized \li SessionClosed
1969 * \li SessionHandleInvalid \li UserNotLoggedIn
1970 * @return true on success, false otherwise
1971 */
1972 bool C_DecryptFinal(SessionHandle session,
1973 Byte* last_part_ptr,
1974 Ulong* last_part_len_ptr,
1975 ReturnValue* return_value = ThrowException) const;
1976
1977 /****************************** Message digesting functions ******************************/
1978
1979 /**
1980 * C_DigestInit initializes a message-digesting operation.
1981 * @param session the session's handle
1982 * @param mechanism_ptr the digesting mechanism
1983 * @param return_value default value (`ThrowException`): throw exception on error.
1984 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1985 * At least the following PKCS#11 return values may be returned:
1986 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1987 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1988 * \li FunctionFailed \li GeneralError \li HostMemory
1989 * \li MechanismInvalid \li MechanismParamInvalid \li OK
1990 * \li OperationActive \li PinExpired \li SessionClosed
1991 * \li SessionHandleInvalid \li UserNotLoggedIn
1992 * @return true on success, false otherwise
1993 */
1994 bool C_DigestInit(SessionHandle session,
1995 Mechanism* mechanism_ptr,
1996 ReturnValue* return_value = ThrowException) const;
1997
1998 /**
1999 * C_Digest digests data in a single part.
2000 * @param session the session's handle
2001 * @param data_ptr data to be digested
2002 * @param data_len bytes of data to digest
2003 * @param digest_ptr gets the message digest
2004 * @param digest_len_ptr gets digest length
2005 * @param return_value default value (`ThrowException`): throw exception on error.
2006 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2007 * At least the following PKCS#11 return values may be returned:
2008 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2009 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2010 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2011 * \li HostMemory \li OK \li OperationNotInitialized
2012 * \li SessionClosed \li SessionHandleInvalid
2013 * @return true on success, false otherwise
2014 */
2015 bool C_Digest(SessionHandle session,
2016 Byte* data_ptr,
2017 Ulong data_len,
2018 Byte* digest_ptr,
2019 Ulong* digest_len_ptr,
2020 ReturnValue* return_value = ThrowException) const;
2021
2022 /**
2023 * C_DigestUpdate continues a multiple-part message-digesting operation.
2024 * @param session the session's handle
2025 * @param part_ptr data to be digested
2026 * @param part_len bytes of data to be digested
2027 * @param return_value default value (`ThrowException`): throw exception on error.
2028 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2029 * At least the following PKCS#11 return values may be returned:
2030 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2031 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2032 * \li FunctionFailed \li GeneralError \li HostMemory
2033 * \li OK \li OperationNotInitialized \li SessionClosed
2034 * \li SessionHandleInvalid
2035 * @return true on success, false otherwise
2036 */
2037 bool C_DigestUpdate(SessionHandle session,
2038 Byte* part_ptr,
2039 Ulong part_len,
2040 ReturnValue* return_value = ThrowException) const;
2041
2042 /**
2043 * C_DigestKey continues a multi-part message-digesting operation, by digesting the value of a secret key as part of the data already digested.
2044 * @param session the session's handle
2045 * @param key secret key to digest
2046 * @param return_value default value (`ThrowException`): throw exception on error.
2047 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2048 * At least the following PKCS#11 return values may be returned:
2049 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
2050 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2051 * \li GeneralError \li HostMemory \li KeyHandleInvalid
2052 * \li KeyIndigestible \li KeySizeRange \li OK
2053 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2054 * @return true on success, false otherwise
2055 */
2056 bool C_DigestKey(SessionHandle session,
2057 ObjectHandle key,
2058 ReturnValue* return_value = ThrowException) const;
2059
2060 /**
2061 * C_DigestFinal finishes a multiple-part message-digesting operation.
2062 * @param session the session's handle
2063 * @param digest_ptr gets the message digest
2064 * @param digest_len_ptr gets uint8_t count of digest
2065 * @param return_value default value (`ThrowException`): throw exception on error.
2066 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2067 * At least the following PKCS#11 return values may be returned:
2068 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2069 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2070 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2071 * \li HostMemory \li OK \li OperationNotInitialized
2072 * \li SessionClosed \li SessionHandleInvalid
2073 * @return true on success, false otherwise
2074 */
2075 bool C_DigestFinal(SessionHandle session,
2076 Byte* digest_ptr,
2077 Ulong* digest_len_ptr,
2078 ReturnValue* return_value = ThrowException) const;
2079
2080 /****************************** Signing and MACing functions ******************************/
2081
2082 /**
2083 * C_SignInit initializes a signature (private key encryption) operation, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2084 * @param session the session's handle
2085 * @param mechanism_ptr the signature mechanism
2086 * @param key handle of signature key
2087 * @param return_value default value (`ThrowException`): throw exception on error.
2088 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2089 * At least the following PKCS#11 return values may be returned:
2090 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2091 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2092 * \li FunctionFailed \li GeneralError \li HostMemory
2093 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2094 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2095 * \li OK \li OperationActive \li PinExpired
2096 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2097 * @return true on success, false otherwise
2098 */
2099 bool C_SignInit(SessionHandle session,
2100 Mechanism* mechanism_ptr,
2101 ObjectHandle key,
2102 ReturnValue* return_value = ThrowException) const;
2103
2104 /**
2105 * C_Sign signs (encrypts with private key) data in a single part, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2106 * @param session the session's handle
2107 * @param data_ptr the data to sign
2108 * @param data_len count of bytes to sign
2109 * @param signature_ptr gets the signature
2110 * @param signature_len_ptr gets signature length
2111 * @param return_value default value (`ThrowException`): throw exception on error.
2112 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2113 * At least the following PKCS#11 return values may be returned:
2114 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2115 * \li DataInvalid \li DataLenRange \li DeviceError
2116 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2117 * \li FunctionFailed \li GeneralError \li HostMemory
2118 * \li OK \li OperationNotInitialized \li SessionClosed
2119 * \li SessionHandleInvalid \li UserNotLoggedIn \li FunctionRejected
2120 * @return true on success, false otherwise
2121 */
2122 bool C_Sign(SessionHandle session,
2123 Byte* data_ptr,
2124 Ulong data_len,
2125 Byte* signature_ptr,
2126 Ulong* signature_len_ptr,
2127 ReturnValue* return_value = ThrowException) const;
2128
2129 /**
2130 * C_Sign signs (encrypts with private key) data in a single part, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2131 * @param session the session's handle
2132 * @param data the data to sign
2133 * @param signature gets the signature
2134 * @param return_value default value (`ThrowException`): throw exception on error.
2135 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2136 * At least the following PKCS#11 return values may be returned:
2137 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2138 * \li DataInvalid \li DataLenRange \li DeviceError
2139 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2140 * \li FunctionFailed \li GeneralError \li HostMemory
2141 * \li OK \li OperationNotInitialized \li SessionClosed
2142 * \li SessionHandleInvalid \li UserNotLoggedIn \li FunctionRejected
2143 * @return true on success, false otherwise
2144 */
2145 template<typename TAllocA, typename TAllocB>
2146 bool C_Sign(SessionHandle session,
2147 const std::vector<uint8_t, TAllocA>& data,
2148 std::vector<uint8_t, TAllocB>& signature,
2149 ReturnValue* return_value = ThrowException) const
2150 {
2151 Ulong signature_size = 0;
2152 if(!C_Sign(session, const_cast<Byte*>((data.data())), data.size(), nullptr, &signature_size, return_value))
2153 {
2154 return false;
2155 }
2156
2157 signature.resize(signature_size);
2158 return C_Sign(session, const_cast<Byte*>(data.data()), data.size(), signature.data(), &signature_size, return_value);
2159 }
2160
2161 /**
2162 * C_SignUpdate continues a multiple-part signature operation, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2163 * @param session the session's handle
2164 * @param part_ptr the data to sign
2165 * @param part_len count of bytes to sign
2166 * @param return_value default value (`ThrowException`): throw exception on error.
2167 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2168 * At least the following PKCS#11 return values may be returned:
2169 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2170 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2171 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2172 * \li HostMemory \li OK \li OperationNotInitialized
2173 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2174 * @return true on success, false otherwise
2175 */
2176 bool C_SignUpdate(SessionHandle session,
2177 Byte* part_ptr,
2178 Ulong part_len,
2179 ReturnValue* return_value = ThrowException) const;
2180
2181 /**
2182 * C_SignUpdate continues a multiple-part signature operation, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2183 * @param session the session's handle
2184 * @param part the data to sign
2185 * @param return_value default value (`ThrowException`): throw exception on error.
2186 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2187 * At least the following PKCS#11 return values may be returned:
2188 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2189 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2190 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2191 * \li HostMemory \li OK \li OperationNotInitialized
2192 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2193 * @return true on success, false otherwise
2194 */
2195 template<typename TAlloc>
2196 bool C_SignUpdate(SessionHandle session,
2197 const std::vector<uint8_t, TAlloc>& part,
2198 ReturnValue* return_value = ThrowException) const
2199 {
2200 return C_SignUpdate(session, const_cast<Byte*>(part.data()), part.size(), return_value);
2201 }
2202
2203 /**
2204 * C_SignFinal finishes a multiple-part signature operation, returning the signature.
2205 * @param session the session's handle
2206 * @param signature_ptr gets the signature
2207 * @param signature_len_ptr gets signature length
2208 * @param return_value default value (`ThrowException`): throw exception on error.
2209 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2210 * At least the following PKCS#11 return values may be returned:
2211 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2212 * \li DataLenRange \li DeviceError \li DeviceMemory
2213 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2214 * \li GeneralError \li HostMemory \li OK
2215 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2216 * \li UserNotLoggedIn \li FunctionRejected
2217 * @return true on success, false otherwise
2218 */
2219 bool C_SignFinal(SessionHandle session,
2220 Byte* signature_ptr,
2221 Ulong* signature_len_ptr,
2222 ReturnValue* return_value = ThrowException) const;
2223
2224 /**
2225 * C_SignFinal finishes a multiple-part signature operation, returning the signature.
2226 * @param session the session's handle
2227 * @param signature gets the signature
2228 * @param return_value default value (`ThrowException`): throw exception on error.
2229 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2230 * At least the following PKCS#11 return values may be returned:
2231 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2232 * \li DataLenRange \li DeviceError \li DeviceMemory
2233 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2234 * \li GeneralError \li HostMemory \li OK
2235 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2236 * \li UserNotLoggedIn \li FunctionRejected
2237 * @return true on success, false otherwise
2238 */
2239 template<typename TAlloc>
2240 bool C_SignFinal(SessionHandle session,
2241 std::vector<uint8_t, TAlloc>& signature,
2242 ReturnValue* return_value = ThrowException) const
2243 {
2244 Ulong signature_size = 0;
2245 if(!C_SignFinal(session, nullptr, &signature_size, return_value))
2246 {
2247 return false;
2248 }
2249
2250 signature.resize(signature_size);
2251 return C_SignFinal(session, signature.data(), &signature_size, return_value);
2252 }
2253
2254 /**
2255 * C_SignRecoverInit initializes a signature operation, where the data can be recovered from the signature.
2256 * @param session the session's handle
2257 * @param mechanism_ptr the signature mechanism
2258 * @param key handle of the signature key
2259 * @param return_value default value (`ThrowException`): throw exception on error.
2260 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2261 * At least the following PKCS#11 return values may be returned:
2262 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2263 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2264 * \li FunctionFailed \li GeneralError \li HostMemory
2265 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2266 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2267 * \li OK \li OperationActive \li PinExpired
2268 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2269 * @return true on success, false otherwise
2270 */
2271 bool C_SignRecoverInit(SessionHandle session,
2272 Mechanism* mechanism_ptr,
2273 ObjectHandle key,
2274 ReturnValue* return_value = ThrowException) const;
2275
2276 /**
2277 * C_SignRecover signs data in a single operation, where the data can be recovered from the signature.
2278 * @param session the session's handle
2279 * @param data_ptr the data to sign
2280 * @param data_len count of bytes to sign
2281 * @param signature_ptr gets the signature
2282 * @param signature_len_ptr gets signature length
2283 * @param return_value default value (`ThrowException`): throw exception on error.
2284 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2285 * At least the following PKCS#11 return values may be returned:
2286 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2287 * \li DataInvalid \li DataLenRange \li DeviceError
2288 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2289 * \li FunctionFailed \li GeneralError \li HostMemory
2290 * \li OK \li OperationNotInitialized \li SessionClosed
2291 * \li SessionHandleInvalid \li UserNotLoggedIn
2292 * @return true on success, false otherwise
2293 */
2294 bool C_SignRecover(SessionHandle session,
2295 Byte* data_ptr,
2296 Ulong data_len,
2297 Byte* signature_ptr,
2298 Ulong* signature_len_ptr,
2299 ReturnValue* return_value = ThrowException) const;
2300
2301 /****************************** Functions for verifying signatures and MACs ******************************/
2302
2303 /**
2304 * C_VerifyInit initializes a verification operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature (e.g. DSA).
2305 * @param session the session's handle
2306 * @param mechanism_ptr the verification mechanism
2307 * @param key verification key
2308 * @param return_value default value (`ThrowException`): throw exception on error.
2309 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2310 * At least the following PKCS#11 return values may be returned:
2311 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2312 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2313 * \li FunctionFailed \li GeneralError \li HostMemory
2314 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2315 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2316 * \li OK \li OperationActive \li PinExpired
2317 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2318 * @return true on success, false otherwise
2319 */
2320 bool C_VerifyInit(SessionHandle session,
2321 Mechanism* mechanism_ptr,
2322 ObjectHandle key,
2323 ReturnValue* return_value = ThrowException) const;
2324
2325 /**
2326 * C_Verify verifies a signature in a single-part operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2327 * @param session the session's handle
2328 * @param data_ptr signed data
2329 * @param data_len length of signed data
2330 * @param signature_ptr signature
2331 * @param signature_len signature length
2332 * @param return_value default value (`ThrowException`): throw exception on error.
2333 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2334 * At least the following PKCS#11 return values may be returned:
2335 * \li ArgumentsBad \li CryptokiNotInitialized \li DataInvalid
2336 * \li DataLenRange \li DeviceError \li DeviceMemory
2337 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2338 * \li GeneralError \li HostMemory \li OK
2339 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2340 * \li SignatureInvalid \li SignatureLenRange
2341 * @return true on success, false otherwise
2342 */
2343 bool C_Verify(SessionHandle session,
2344 Byte* data_ptr,
2345 Ulong data_len,
2346 Byte* signature_ptr,
2347 Ulong signature_len,
2348 ReturnValue* return_value = ThrowException) const;
2349
2350 /**
2351 * C_Verify verifies a signature in a single-part operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2352 * @param session the session's handle
2353 * @param data signed data
2354 * @param signature signature
2355 * @param return_value default value (`ThrowException`): throw exception on error.
2356 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2357 * At least the following PKCS#11 return values may be returned:
2358 * \li ArgumentsBad \li CryptokiNotInitialized \li DataInvalid
2359 * \li DataLenRange \li DeviceError \li DeviceMemory
2360 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2361 * \li GeneralError \li HostMemory \li OK
2362 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2363 * \li SignatureInvalid \li SignatureLenRange
2364 * @return true on success, false otherwise
2365 */
2366 template<typename TAllocA, typename TAllocB>
2367 bool C_Verify(SessionHandle session,
2368 const std::vector<uint8_t, TAllocA>& data,
2369 std::vector<uint8_t, TAllocB>& signature,
2370 ReturnValue* return_value = ThrowException) const
2371 {
2372 return C_Verify(session, const_cast<Byte*>(data.data()), data.size(), signature.data(), signature.size(), return_value);
2373 }
2374
2375 /**
2376 * C_VerifyUpdate continues a multiple-part verification operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2377 * @param session the session's handle
2378 * @param part_ptr signed data
2379 * @param part_len length of signed data
2380 * @param return_value default value (`ThrowException`): throw exception on error.
2381 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2382 * At least the following PKCS#11 return values may be returned:
2383 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2384 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2385 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2386 * \li HostMemory \li OK \li OperationNotInitialized
2387 * \li SessionClosed \li SessionHandleInvalid
2388 * @return true on success, false otherwise
2389 */
2390 bool C_VerifyUpdate(SessionHandle session,
2391 Byte* part_ptr,
2392 Ulong part_len,
2393 ReturnValue* return_value = ThrowException) const;
2394
2395 /**
2396 * C_VerifyUpdate continues a multiple-part verification operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2397 * @param session the session's handle
2398 * @param part signed data
2399 * @param return_value default value (`ThrowException`): throw exception on error.
2400 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2401 * At least the following PKCS#11 return values may be returned:
2402 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2403 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2404 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2405 * \li HostMemory \li OK \li OperationNotInitialized
2406 * \li SessionClosed \li SessionHandleInvalid
2407 * @return true on success, false otherwise
2408 */
2409 template<typename TAlloc>
2410 bool C_VerifyUpdate(SessionHandle session,
2411 std::vector<uint8_t, TAlloc> part,
2412 ReturnValue* return_value = ThrowException) const
2413 {
2414 return C_VerifyUpdate(session, part.data(), part.size(), return_value);
2415 }
2416
2417 /**
2418 * C_VerifyFinal finishes a multiple-part verification operation, checking the signature.
2419 * @param session the session's handle
2420 * @param signature_ptr signature to verify
2421 * @param signature_len signature length
2422 * @param return_value default value (`ThrowException`): throw exception on error.
2423 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2424 * At least the following PKCS#11 return values may be returned:
2425 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2426 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2427 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2428 * \li HostMemory \li OK \li OperationNotInitialized
2429 * \li SessionClosed \li SessionHandleInvalid \li SignatureInvalid
2430 * \li SignatureLenRange
2431 * @return true on success, false otherwise
2432 */
2433 bool C_VerifyFinal(SessionHandle session,
2434 Byte* signature_ptr,
2435 Ulong signature_len,
2436 ReturnValue* return_value = ThrowException) const;
2437
2438 /**
2439 * C_VerifyRecoverInit initializes a signature verification operation, where the data is recovered from the signature.
2440 * @param session the session's handle
2441 * @param mechanism_ptr the verification mechanism
2442 * @param key verification key
2443 * @param return_value default value (`ThrowException`): throw exception on error.
2444 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2445 * At least the following PKCS#11 return values may be returned:
2446 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2447 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2448 * \li FunctionFailed \li GeneralError \li HostMemory
2449 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2450 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2451 * \li OK \li OperationActive \li PinExpired
2452 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2453 * @return true on success, false otherwise
2454 */
2455 bool C_VerifyRecoverInit(SessionHandle session,
2456 Mechanism* mechanism_ptr,
2457 ObjectHandle key,
2458 ReturnValue* return_value = ThrowException) const;
2459
2460 /**
2461 * C_VerifyRecover verifies a signature in a single-part operation, where the data is recovered from the signature.
2462 * @param session the session's handle
2463 * @param signature_ptr signature to verify
2464 * @param signature_len signature length
2465 * @param data_ptr gets signed data
2466 * @param data_len_ptr gets signed data len
2467 * @param return_value default value (`ThrowException`): throw exception on error.
2468 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2469 * At least the following PKCS#11 return values may be returned:
2470 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2471 * \li DataInvalid \li DataLenRange \li DeviceError
2472 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2473 * \li FunctionFailed \li GeneralError \li HostMemory
2474 * \li OK \li OperationNotInitialized \li SessionClosed
2475 * \li SessionHandleInvalid \li SignatureLenRange \li SignatureInvalid
2476 * @return true on success, false otherwise
2477 */
2478 bool C_VerifyRecover(SessionHandle session,
2479 Byte* signature_ptr,
2480 Ulong signature_len,
2481 Byte* data_ptr,
2482 Ulong* data_len_ptr,
2483 ReturnValue* return_value = ThrowException) const;
2484
2485 /****************************** Dual-purpose cryptographic functions ******************************/
2486
2487 /**
2488 * C_DigestEncryptUpdate continues a multiple-part digesting and encryption operation.
2489 * @param session session's handle
2490 * @param part_ptr the plaintext data
2491 * @param part_len plaintext length
2492 * @param encrypted_part_ptr gets ciphertext
2493 * @param encrypted_part_len_ptr gets c-text length
2494 * @param return_value default value (`ThrowException`): throw exception on error.
2495 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2496 * At least the following PKCS#11 return values may be returned:
2497 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2498 * \li DataLenRange \li DeviceError \li DeviceMemory
2499 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2500 * \li GeneralError \li HostMemory \li OK
2501 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2502 * @return true on success, false otherwise
2503 */
2504 bool C_DigestEncryptUpdate(SessionHandle session,
2505 Byte* part_ptr,
2506 Ulong part_len,
2507 Byte* encrypted_part_ptr,
2508 Ulong* encrypted_part_len_ptr,
2509 ReturnValue* return_value = ThrowException) const ;
2510
2511 /**
2512 * C_DecryptDigestUpdate continues a multiple-part decryption and digesting operation.
2513 * @param session session's handle
2514 * @param encrypted_part_ptr ciphertext
2515 * @param encrypted_part_len ciphertext length
2516 * @param part_ptr gets plaintext
2517 * @param part_len_ptr gets plaintext len
2518 * @param return_value default value (`ThrowException`): throw exception on error.
2519 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2520 * At least the following PKCS#11 return values may be returned:
2521 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2522 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2523 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
2524 * \li FunctionFailed \li GeneralError \li HostMemory
2525 * \li OK \li OperationNotInitialized \li SessionClosed
2526 * \li SessionHandleInvalid
2527 * @return true on success, false otherwise
2528 */
2529 bool C_DecryptDigestUpdate(SessionHandle session,
2530 Byte* encrypted_part_ptr,
2531 Ulong encrypted_part_len,
2532 Byte* part_ptr,
2533 Ulong* part_len_ptr,
2534 ReturnValue* return_value = ThrowException) const;
2535
2536 /**
2537 * C_SignEncryptUpdate continues a multiple-part signing and encryption operation.
2538 * @param session session's handle
2539 * @param part_ptr the plaintext data
2540 * @param part_len plaintext length
2541 * @param encrypted_part_ptr gets ciphertext
2542 * @param encrypted_part_len_ptr gets c-text length
2543 * @param return_value default value (`ThrowException`): throw exception on error.
2544 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2545 * At least the following PKCS#11 return values may be returned:
2546 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2547 * \li DataLenRange \li DeviceError \li DeviceMemory
2548 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2549 * \li GeneralError \li HostMemory \li OK
2550 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2551 * \li UserNotLoggedIn
2552 * @return true on success, false otherwise
2553 */
2554 bool C_SignEncryptUpdate(SessionHandle session,
2555 Byte* part_ptr,
2556 Ulong part_len,
2557 Byte* encrypted_part_ptr,
2558 Ulong* encrypted_part_len_ptr,
2559 ReturnValue* return_value = ThrowException) const;
2560
2561 /**
2562 * C_DecryptVerifyUpdate continues a multiple-part decryption and verify operation.
2563 * @param session session's handle
2564 * @param encrypted_part_ptr ciphertext
2565 * @param encrypted_part_len ciphertext length
2566 * @param part_ptr gets plaintext
2567 * @param part_len_ptr gets p-text length
2568 * @param return_value default value (`ThrowException`): throw exception on error.
2569 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2570 * At least the following PKCS#11 return values may be returned:
2571 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2572 * \li DataLenRange \li DeviceError \li DeviceMemory
2573 * \li DeviceRemoved \li EncryptedDataInvalid \li EncryptedDataLenRange
2574 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2575 * \li HostMemory \li OK \li OperationNotInitialized
2576 * \li SessionClosed \li SessionHandleInvalid
2577 * @return true on success, false otherwise
2578 */
2579 bool C_DecryptVerifyUpdate(SessionHandle session,
2580 Byte* encrypted_part_ptr,
2581 Ulong encrypted_part_len,
2582 Byte* part_ptr,
2583 Ulong* part_len_ptr,
2584 ReturnValue* return_value = ThrowException) const;
2585
2586 /****************************** Key management functions ******************************/
2587
2588 /**
2589 * C_GenerateKey generates a secret key, creating a new key object.
2590 * @param session the session's handle
2591 * @param mechanism_ptr key generation mech.
2592 * @param attribute_template_ptr template for new key
2593 * @param count # of attrs in template
2594 * @param key_ptr gets handle of new key
2595 * @param return_value default value (`ThrowException`): throw exception on error.
2596 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2597 * At least the following PKCS#11 return values may be returned:
2598 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2599 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
2600 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2601 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2602 * \li HostMemory \li MechanismInvalid \li MechanismParamInvalid
2603 * \li OK \li OperationActive \li PinExpired
2604 * \li SessionClosed \li SessionHandleInvalid \li SessionReadOnly
2605 * \li TemplateIncomplete \li TemplateInconsistent \li TokenWriteProtected
2606 * \li UserNotLoggedIn
2607 * @return true on success, false otherwise
2608 */
2609 bool C_GenerateKey(SessionHandle session,
2610 Mechanism* mechanism_ptr,
2611 Attribute* attribute_template_ptr,
2612 Ulong count,
2613 ObjectHandle* key_ptr,
2614 ReturnValue* return_value = ThrowException) const;
2615
2616 /**
2617 * C_GenerateKeyPair generates a public-key/private-key pair, creating new key objects.
2618 * @param session session handle
2619 * @param mechanism_ptr key-gen mech.
2620 * @param public_key_template_ptr template for pub. key
2621 * @param public_key_attribute_count # pub. attrs.
2622 * @param private_key_template_ptr template for priv. key
2623 * @param private_key_attribute_count # priv. attrs.
2624 * @param public_key_ptr gets pub. key handle
2625 * @param private_key_ptr gets priv. key handle
2626 * @param return_value default value (`ThrowException`): throw exception on error.
2627 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2628 * At least the following PKCS#11 return values may be returned:
2629 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2630 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
2631 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2632 * \li DomainParamsInvalid \li FunctionCanceled \li FunctionFailed
2633 * \li GeneralError \li HostMemory \li MechanismInvalid
2634 * \li MechanismParamInvalid \li OK \li OperationActive
2635 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
2636 * \li SessionReadOnly \li TemplateIncomplete \li TemplateInconsistent
2637 * \li TokenWriteProtected \li UserNotLoggedIn
2638 * @return true on success, false otherwise
2639 */
2640 bool C_GenerateKeyPair(SessionHandle session,
2641 Mechanism* mechanism_ptr,
2642 Attribute* public_key_template_ptr,
2643 Ulong public_key_attribute_count,
2644 Attribute* private_key_template_ptr,
2645 Ulong private_key_attribute_count,
2646 ObjectHandle* public_key_ptr,
2647 ObjectHandle* private_key_ptr,
2648 ReturnValue* return_value = ThrowException) const;
2649
2650 /**
2651 * C_WrapKey wraps (i.e., encrypts) a key.
2652 * @param session the session's handle
2653 * @param mechanism_ptr the wrapping mechanism
2654 * @param wrapping_key wrapping key
2655 * @param key key to be wrapped
2656 * @param wrapped_key_ptr gets wrapped key
2657 * @param wrapped_key_len_ptr gets wrapped key size
2658 * @param return_value default value (`ThrowException`): throw exception on error.
2659 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2660 * At least the following PKCS#11 return values may be returned:
2661 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2662 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2663 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2664 * \li HostMemory \li KeyHandleInvalid \li KeyNotWrappable
2665 * \li KeySizeRange \li KeyUnextractable \li MechanismInvalid
2666 * \li MechanismParamInvalid \li OK \li OperationActive
2667 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
2668 * \li UserNotLoggedIn \li WrappingKeyHandleInvalid \li WrappingKeySizeRange
2669 * \li WrappingKeyTypeInconsistent
2670 * @return true on success, false otherwise
2671 */
2672 bool C_WrapKey(SessionHandle session,
2673 Mechanism* mechanism_ptr,
2674 ObjectHandle wrapping_key,
2675 ObjectHandle key,
2676 Byte* wrapped_key_ptr,
2677 Ulong* wrapped_key_len_ptr,
2678 ReturnValue* return_value = ThrowException) const;
2679
2680 /**
2681 * C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new key object.
2682 * @param session session's handle
2683 * @param mechanism_ptr unwrapping mech.
2684 * @param unwrapping_key unwrapping key
2685 * @param wrapped_key_ptr the wrapped key
2686 * @param wrapped_key_len wrapped key len
2687 * @param attribute_template_ptr new key template
2688 * @param attribute_count template length
2689 * @param key_ptr gets new handle
2690 * @param return_value default value (`ThrowException`): throw exception on error.
2691 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2692 * At least the following PKCS#11 return values may be returned:
2693 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2694 * \li AttributeValueInvalid \li BufferTooSmall \li CryptokiNotInitialized
2695 * \li CurveNotSupported \li DeviceError \li DeviceMemory
2696 * \li DeviceRemoved \li DomainParamsInvalid \li FunctionCanceled
2697 * \li FunctionFailed \li GeneralError \li HostMemory
2698 * \li MechanismInvalid \li MechanismParamInvalid \li OK
2699 * \li OperationActive \li PinExpired \li SessionClosed
2700 * \li SessionHandleInvalid \li SessionReadOnly \li TemplateIncomplete
2701 * \li TemplateInconsistent \li TokenWriteProtected \li UnwrappingKeyHandleInvalid
2702 * \li UnwrappingKeySizeRange \li UnwrappingKeyTypeInconsistent \li UserNotLoggedIn
2703 * \li WrappedKeyInvalid \li WrappedKeyLenRange
2704 * @return true on success, false otherwise
2705 */
2706 bool C_UnwrapKey(SessionHandle session,
2707 Mechanism* mechanism_ptr,
2708 ObjectHandle unwrapping_key,
2709 Byte* wrapped_key_ptr,
2710 Ulong wrapped_key_len,
2711 Attribute* attribute_template_ptr,
2712 Ulong attribute_count,
2713 ObjectHandle* key_ptr,
2714 ReturnValue* return_value = ThrowException) const;
2715
2716 /**
2717 * C_DeriveKey derives a key from a base key, creating a new key object.
2718 * @param session session's handle
2719 * @param mechanism_ptr key deriv. mech.
2720 * @param base_key base key
2721 * @param attribute_template_ptr new key template
2722 * @param attribute_count template length
2723 * @param key_ptr gets new handle
2724 * @param return_value default value (`ThrowException`): throw exception on error.
2725 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2726 * At least the following PKCS#11 return values may be returned:
2727 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2728 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
2729 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2730 * \li DomainParamsInvalid \li FunctionCanceled \li FunctionFailed
2731 * \li GeneralError \li HostMemory \li KeyHandleInvalid
2732 * \li KeySizeRange \li KeyTypeInconsistent \li MechanismInvalid
2733 * \li MechanismParamInvalid \li OK \li OperationActive
2734 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
2735 * \li SessionReadOnly \li TemplateIncomplete \li TemplateInconsistent
2736 * \li TokenWriteProtected \li UserNotLoggedIn
2737 * @return true on success, false otherwise
2738 */
2739 bool C_DeriveKey(SessionHandle session,
2740 Mechanism* mechanism_ptr,
2741 ObjectHandle base_key,
2742 Attribute* attribute_template_ptr,
2743 Ulong attribute_count,
2744 ObjectHandle* key_ptr,
2745 ReturnValue* return_value = ThrowException) const;
2746
2747 /****************************** Random number generation functions ******************************/
2748
2749 /**
2750 * C_SeedRandom mixes additional seed material into the token's random number generator.
2751 * @param session the session's handle
2752 * @param seed_ptr the seed material
2753 * @param seed_len length of seed material
2754 * @param return_value default value (`ThrowException`): throw exception on error.
2755 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2756 * At least the following PKCS#11 return values may be returned:
2757 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2758 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2759 * \li FunctionFailed \li GeneralError \li HostMemory
2760 * \li OK \li OperationActive \li RandomSeedNotSupported
2761 * \li RandomNoRng \li SessionClosed \li SessionHandleInvalid
2762 * \li UserNotLoggedIn
2763 * @return true on success, false otherwise
2764 */
2765 bool C_SeedRandom(SessionHandle session,
2766 Byte* seed_ptr,
2767 Ulong seed_len,
2768 ReturnValue* return_value = ThrowException) const;
2769
2770 /**
2771 * C_GenerateRandom generates random data.
2772 * @param session the session's handle
2773 * @param random_data_ptr receives the random data
2774 * @param random_len # of bytes to generate
2775 * @param return_value default value (`ThrowException`): throw exception on error.
2776 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2777 * At least the following PKCS#11 return values may be returned:
2778 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2779 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2780 * \li FunctionFailed \li GeneralError \li HostMemory
2781 * \li OK \li OperationActive \li RandomNoRng
2782 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2783 * @return true on success, false otherwise
2784 */
2785 bool C_GenerateRandom(SessionHandle session,
2786 Byte* random_data_ptr,
2787 Ulong random_len,
2788 ReturnValue* return_value = ThrowException) const;
2789
2790 /****************************** Parallel function management functions ******************************/
2791
2792 /**
2793 * C_GetFunctionStatus is a legacy function; it obtains an updated status of a function running in parallel with an application.
2794 * @param session the session's handle
2795 * @param return_value default value (`ThrowException`): throw exception on error.
2796 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2797 * At least the following PKCS#11 return values may be returned:
2798 * \li CryptokiNotInitialized \li FunctionFailed \li FunctionNotParallel
2799 * \li GeneralError \li HostMemory \li SessionHandleInvalid
2800 * \li SessionClosed
2801 * @return true on success, false otherwise
2802 */
2803 bool C_GetFunctionStatus(SessionHandle session,
2804 ReturnValue* return_value = ThrowException) const;
2805
2806 /**
2807 * C_CancelFunction is a legacy function; it cancels a function running in parallel.
2808 * @param session the session's handle
2809 * @param return_value default value (`ThrowException`): throw exception on error.
2810 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2811 * At least the following PKCS#11 return values may be returned:
2812 * \li CryptokiNotInitialized \li FunctionFailed \li FunctionNotParallel
2813 * \li GeneralError \li HostMemory \li SessionHandleInvalid
2814 * \li SessionClosed
2815 * @return true on success, false otherwise
2816 */
2817 bool C_CancelFunction(SessionHandle session,
2818 ReturnValue* return_value = ThrowException) const;
2819
2820 private:
2821 const FunctionListPtr m_func_list_ptr;
2822 };
2823
2824 class PKCS11_Error : public Exception
2825 {
2826 public:
2827 explicit PKCS11_Error(const std::string& what) :
2828 Exception("PKCS11 error", what)
2829 {
2830 }
2831 };
2832
2833 class PKCS11_ReturnError : public PKCS11_Error
2834 {
2835 public:
2836 explicit PKCS11_ReturnError(ReturnValue return_val) :
2837 PKCS11_Error(std::to_string(static_cast< uint32_t >(return_val))),
2838 m_return_val(return_val)
2839 {}
2840
2841 inline ReturnValue get_return_value() const
2842 {
2843 return m_return_val;
2844 }
2845
2846 private:
2847 const ReturnValue m_return_val;
2848 };
2849
2850 }
2851
2852 }
2853
2854 #endif
Botan::PKCS11::CertificateType::Wtls
CKF_EXCLUDE_COUNTER
#define CKF_EXCLUDE_COUNTER
Definition: pkcs11t.h:1811
Botan::PKCS11::ReturnValue::NewPinMode
CKA_CHAR_ROWS
#define CKA_CHAR_ROWS
Definition: pkcs11t.h:546
Botan::PKCS11::MechanismType::DhPkcsDerive
CKM_DES3_CBC_ENCRYPT_DATA
#define CKM_DES3_CBC_ENCRYPT_DATA
Definition: pkcs11t.h:940
Botan::PKCS11::ReturnValue::RandomNoRng
CKK_RC2
#define CKK_RC2
Definition: pkcs11t.h:347
CK_RSA_PKCS_OAEP_PARAMS
struct CK_RSA_PKCS_OAEP_PARAMS CK_RSA_PKCS_OAEP_PARAMS
Botan::PKCS11::ReturnValue::SignatureLenRange
CKP_PKCS5_PBKD2_HMAC_SHA512
#define CKP_PKCS5_PBKD2_HMAC_SHA512
Definition: pkcs11t.h:1724
CKF_EC_NAMEDCURVE
#define CKF_EC_NAMEDCURVE
Definition: pkcs11t.h:1025
Botan::PKCS11::Flag::EcCompress
Botan::PKCS11::Utf8Char
CK_UTF8CHAR Utf8Char
Definition: p11.h:841
Botan::PKCS11::MechanismType::Gost28147Ecb
Botan::PKCS11::ReturnValue::WrappingKeyHandleInvalid
CKM_HOTP_KEY_GEN
#define CKM_HOTP_KEY_GEN
Definition: pkcs11t.h:721
CKM_AES_CFB64
#define CKM_AES_CFB64
Definition: pkcs11t.h:964
Botan::PKCS11::MechanismType::Des3Mac
CKM_CAST128_CBC
#define CKM_CAST128_CBC
Definition: pkcs11t.h:744
CKM_SHA512_RSA_PKCS_PSS
#define CKM_SHA512_RSA_PKCS_PSS
Definition: pkcs11t.h:626
CKR_RANDOM_SEED_NOT_SUPPORTED
#define CKR_RANDOM_SEED_NOT_SUPPORTED
Definition: pkcs11t.h:1129
Botan::PKCS11::AttributeType::OtpTimeInterval
Botan::PKCS11::Notify
CK_NOTIFY Notify
Definition: p11.h:842
Botan::PKCS11::MechanismType::ActiKeyGen
Botan::PKCS11::AttributeType::SerialNumber
Botan::PKCS11::AttributeType::OtpCounterRequirement
CKR_DEVICE_REMOVED
#define CKR_DEVICE_REMOVED
Definition: pkcs11t.h:1062
CKM_DSA_PARAMETER_GEN
#define CKM_DSA_PARAMETER_GEN
Definition: pkcs11t.h:957
Botan::PKCS11::AttributeType::Resolution
Botan::PKCS11::AttributeType::EcdsaParams
Botan::PKCS11::MechanismType::Md2Hmac
Botan::PKCS11::AttributeType::Gostr3411Params
CKM_AES_CMAC_GENERAL
#define CKM_AES_CMAC_GENERAL
Definition: pkcs11t.h:924
Botan::PKCS11::MechanismType::Sha1KeyDerivation
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha512256
CKM_SHA_1_HMAC_GENERAL
#define CKM_SHA_1_HMAC_GENERAL
Definition: pkcs11t.h:698
CKR_FIPS_SELF_TEST_FAILED
#define CKR_FIPS_SELF_TEST_FAILED
Definition: pkcs11t.h:1151
CKM_XOR_BASE_AND_DATA
#define CKM_XOR_BASE_AND_DATA
Definition: pkcs11t.h:767
CKF_USER_PIN_INITIALIZED
#define CKF_USER_PIN_INITIALIZED
Definition: pkcs11t.h:158
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha512224
CKA_HW_FEATURE_TYPE
#define CKA_HW_FEATURE_TYPE
Definition: pkcs11t.h:539
CKM_SHA384_KEY_DERIVATION
#define CKM_SHA384_KEY_DERIVATION
Definition: pkcs11t.h:788
CKF_SIGN
#define CKF_SIGN
Definition: pkcs11t.h:1009
Botan::PKCS11::ObjectClass::DomainParameters
Botan::PKCS11::MechanismType::AriaCbc
Botan::PKCS11::MechanismType::DsaProbablisticParameterGen
Botan::PKCS11::AttributeType::Sign
CKM_KEA_DERIVE
#define CKM_KEA_DERIVE
Definition: pkcs11t.h:878
Botan::PKCS11::KeyType::Gostr3411
CK_SLOT_ID
CK_ULONG CK_SLOT_ID
Definition: pkcs11t.h:104
CKM_TLS_PRE_MASTER_KEY_GEN
#define CKM_TLS_PRE_MASTER_KEY_GEN
Definition: pkcs11t.h:774
Botan::PKCS11::AttributeType::Coefficient
Botan::PKCS11::operator|
Flag operator|(Flag a, Flag b)
Definition: p11.h:265
Botan::PKCS11::ReturnValue::ExceededMaxIterations
Botan::PKCS11::MechanismType::EcdsaSha224
Botan::PKCS11::MechanismType::TlsMasterKeyDeriveDh
CKA_TRUSTED
#define CKA_TRUSTED
Definition: pkcs11t.h:450
Botan::PKCS11::MechanismType::Sha224KeyDerivation
CKM_RIPEMD128_HMAC_GENERAL
#define CKM_RIPEMD128_HMAC_GENERAL
Definition: pkcs11t.h:702
Botan::PKCS11::KeyType::Rc5
Botan::PKCS11::MechanismType::JuniperShuffle
CKR_ENCRYPTED_DATA_INVALID
#define CKR_ENCRYPTED_DATA_INVALID
Definition: pkcs11t.h:1063
Botan::PKCS11::MechanismType::PbeSha1Des3EdeCbc
CKM_PBE_MD5_CAST_CBC
#define CKM_PBE_MD5_CAST_CBC
Definition: pkcs11t.h:794
CKR_PIN_EXPIRED
#define CKR_PIN_EXPIRED
Definition: pkcs11t.h:1093
CKH_MONOTONIC_COUNTER
#define CKH_MONOTONIC_COUNTER
Definition: pkcs11t.h:330
Botan::PKCS11::MechanismType::AesCfb1
CKM_RSA_X_509
#define CKM_RSA_X_509
Definition: pkcs11t.h:589
Botan::PKCS11::ReturnValue::CryptokiAlreadyInitialized
Botan::PKCS11::AttributeType::ModulusBits
CKA_ENCODING_METHODS
#define CKA_ENCODING_METHODS
Definition: pkcs11t.h:551
CKM_DES_CFB8
#define CKM_DES_CFB8
Definition: pkcs11t.h:683
CKH_USER_INTERFACE
#define CKH_USER_INTERFACE
Definition: pkcs11t.h:332
Botan::PKCS11::MechanismType::CastCbcPad
CKA_PRIME_1
#define CKA_PRIME_1
Definition: pkcs11t.h:478
CKG_MGF1_SHA256
#define CKG_MGF1_SHA256
Definition: pkcs11t.h:1247
Botan::PKCS11::MechanismType::CamelliaCbcPad
Botan::PKCS11::ReturnValue::Cancel
CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC
#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC
Definition: pkcs11t.h:813
CKR_KEY_NEEDED
#define CKR_KEY_NEEDED
Definition: pkcs11t.h:1077
CKA_WRAP_WITH_TRUSTED
#define CKA_WRAP_WITH_TRUSTED
Definition: pkcs11t.h:515
CKR_SAVED_STATE_INVALID
#define CKR_SAVED_STATE_INVALID
Definition: pkcs11t.h:1138
CKM_KEY_WRAP_LYNKS
#define CKM_KEY_WRAP_LYNKS
Definition: pkcs11t.h:829
CKA_PRIVATE_EXPONENT
#define CKA_PRIVATE_EXPONENT
Definition: pkcs11t.h:477
CKM_CAST_KEY_GEN
#define CKM_CAST_KEY_GEN
Definition: pkcs11t.h:726
CKK_CAST128
#define CKK_CAST128
Definition: pkcs11t.h:355
CKM_SHA512_RSA_PKCS
#define CKM_SHA512_RSA_PKCS
Definition: pkcs11t.h:623
CKM_IDEA_KEY_GEN
#define CKM_IDEA_KEY_GEN
Definition: pkcs11t.h:757
CKM_SHA224_RSA_PKCS
#define CKM_SHA224_RSA_PKCS
Definition: pkcs11t.h:628
CK_TOKEN_INFO
Definition: pkcs11t.h:130
CKM_SEED_CBC_ENCRYPT_DATA
#define CKM_SEED_CBC_ENCRYPT_DATA
Definition: pkcs11t.h:863
Botan::PKCS11::ReturnValue
ReturnValue
Definition: p11.h:713
CKF_TOKEN_PRESENT
#define CKF_TOKEN_PRESENT
Definition: pkcs11t.h:122
CKM_GOSTR3410_WITH_GOSTR3411
#define CKM_GOSTR3410_WITH_GOSTR3411
Definition: pkcs11t.h:946
Botan::PKCS11::AttributeType::ValueBits
CKM_SHA256_HMAC
#define CKM_SHA256_HMAC
Definition: pkcs11t.h:708
Botan::PKCS11::UnlockMutex
CK_UNLOCKMUTEX UnlockMutex
Definition: p11.h:831
Botan::PKCS11::MechanismType::Ripemd160
Botan::PKCS11::ReturnValue::KeyHandleInvalid
CKM_CAMELLIA_MAC_GENERAL
#define CKM_CAMELLIA_MAC_GENERAL
Definition: pkcs11t.h:841
Botan::PKCS11::AttributeType::PublicExponent
Botan::PKCS11::ThrowException
ReturnValue * ThrowException
Definition: p11.cpp:19
Botan::PKCS11::MechanismType::Ssl3MasterKeyDeriveDh
CKR_CANCEL
#define CKR_CANCEL
Definition: pkcs11t.h:1039
Botan::PKCS11::MechanismType::EcdsaSha1
CKM_PBE_SHA1_RC2_128_CBC
#define CKM_PBE_SHA1_RC2_128_CBC
Definition: pkcs11t.h:804
Botan::PKCS11::MechanismType::Des2KeyGen
Botan::PKCS11::AttributeType::AcIssuer
Botan::PKCS11::ObjectClass::PublicKey
CKA_UNWRAP_TEMPLATE
#define CKA_UNWRAP_TEMPLATE
Definition: pkcs11t.h:517
CKA_SUBJECT
#define CKA_SUBJECT
Definition: pkcs11t.h:460
CKA_EC_PARAMS
#define CKA_EC_PARAMS
Definition: pkcs11t.h:506
CK_SLOT_INFO
Definition: pkcs11t.h:110
CKA_OTP_SERVICE_LOGO_TYPE
#define CKA_OTP_SERVICE_LOGO_TYPE
Definition: pkcs11t.h:533
Botan::PKCS11::MechanismType::Cast3Mac
Botan::PKCS11::ReturnValue::KeyFunctionNotPermitted
CKF_EC_ECPARAMETERS
#define CKF_EC_ECPARAMETERS
Definition: pkcs11t.h:1024
Botan::PKCS11::KeyDerivation::Sha1KdfAsn1
CKM_DES3_CMAC_GENERAL
#define CKM_DES3_CMAC_GENERAL
Definition: pkcs11t.h:671
Botan::PKCS11::MechanismType::KeaKeyDerive
CKM_CDMF_CBC
#define CKM_CDMF_CBC
Definition: pkcs11t.h:675
Botan::PKCS11::ReturnValue::UnwrappingKeyHandleInvalid
Botan::PKCS11::MechanismType::Cast128Mac
Botan::PKCS11::MechanismType::AesCfb8
CKM_CAST5_CBC
#define CKM_CAST5_CBC
Definition: pkcs11t.h:743
CKD_SHA1_KDF_CONCATENATE
#define CKD_SHA1_KDF_CONCATENATE
Definition: pkcs11t.h:1295
Botan::PKCS11::Flag::RestoreKeyNotNeeded
Botan::PKCS11::MechanismType::Md5
CKF_PROTECTED_AUTHENTICATION_PATH
#define CKF_PROTECTED_AUTHENTICATION_PATH
Definition: pkcs11t.h:177
CKM_RC2_ECB
#define CKM_RC2_ECB
Definition: pkcs11t.h:646
Botan::PKCS11::AttributeType::Application
CKK_VENDOR_DEFINED
#define CKK_VENDOR_DEFINED
Definition: pkcs11t.h:387
Botan::PKCS11::MechanismType::Sha512
CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT
#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT
Definition: pkcs11t.h:1115
Botan::PKCS11::MechanismType::DsaShaweTaylorParameterGen
Botan::PKCS11::Flag::UserPinInitialized
CKM_SHA512_HMAC
#define CKM_SHA512_HMAC
Definition: pkcs11t.h:717
Botan::PKCS11::ReturnValue::MechanismParamInvalid
Botan::PKCS11::ReturnValue::UserPinNotInitialized
CKM_TLS_KDF
#define CKM_TLS_KDF
Definition: pkcs11t.h:827
CKF_GENERATE_KEY_PAIR
#define CKF_GENERATE_KEY_PAIR
Definition: pkcs11t.h:1014
Botan::Exception
Definition: exceptn.h:21
CKK_SHA224_HMAC
#define CKK_SHA224_HMAC
Definition: pkcs11t.h:378
CK_MECHANISM_TYPE
CK_ULONG CK_MECHANISM_TYPE
Definition: pkcs11t.h:583
Botan::PKCS11::ReturnValue::PublicKeyInvalid
Botan::PKCS11::MechanismType::Cast128Ecb
CKM_ARIA_ECB_ENCRYPT_DATA
#define CKM_ARIA_ECB_ENCRYPT_DATA
Definition: pkcs11t.h:853
Botan::PKCS11::AttributeType::AuthPinFlags
CKM_PBE_MD5_CAST5_CBC
#define CKM_PBE_MD5_CAST5_CBC
Definition: pkcs11t.h:796
Botan::PKCS11::AttributeType::Subject
CKA_CHAR_COLUMNS
#define CKA_CHAR_COLUMNS
Definition: pkcs11t.h:547
CK_SESSION_INFO
Definition: pkcs11t.h:279
CKU_CONTEXT_SPECIFIC
#define CKU_CONTEXT_SPECIFIC
Definition: pkcs11t.h:268
CKA_LABEL
#define CKA_LABEL
Definition: pkcs11t.h:440
Botan::PKCS11::MechanismType::TlsPrf
CKA_ISSUER
#define CKA_ISSUER
Definition: pkcs11t.h:445
CK_NOTIFICATION
CK_ULONG CK_NOTIFICATION
Definition: pkcs11t.h:100
CKM_BATON_WRAP
#define CKM_BATON_WRAP
Definition: pkcs11t.h:886
CKS_RW_USER_FUNCTIONS
#define CKS_RW_USER_FUNCTIONS
Definition: pkcs11t.h:275
Botan::PKCS11::MechanismType::SkipjackKeyGen
CKM_SEED_ECB_ENCRYPT_DATA
#define CKM_SEED_ECB_ENCRYPT_DATA
Definition: pkcs11t.h:862
CKM_SKIPJACK_CFB8
#define CKM_SKIPJACK_CFB8
Definition: pkcs11t.h:872
CKM_ECDSA_SHA256
#define CKM_ECDSA_SHA256
Definition: pkcs11t.h:894
Botan::PKCS11::MechanismType::CdmfCbcPad
CKM_ECDSA_SHA224
#define CKM_ECDSA_SHA224
Definition: pkcs11t.h:893
CKA_ATTR_TYPES
#define CKA_ATTR_TYPES
Definition: pkcs11t.h:449
CKA_MIME_TYPES
#define CKA_MIME_TYPES
Definition: pkcs11t.h:552
CK_BBOOL
CK_BYTE CK_BBOOL
Definition: pkcs11t.h:45
Botan::PKCS11::AttributeType::CharRows
Botan::PKCS11::CertificateType
CertificateType
Definition: p11.h:175
Botan::PKCS11::ReturnValue::KeyChanged
CKA_OTP_COUNTER_REQUIREMENT
#define CKA_OTP_COUNTER_REQUIREMENT
Definition: pkcs11t.h:526
CKA_REQUIRED_CMS_ATTRIBUTES
#define CKA_REQUIRED_CMS_ATTRIBUTES
Definition: pkcs11t.h:554
CKA_EXTRACTABLE
#define CKA_EXTRACTABLE
Definition: pkcs11t.h:494
CKR_DEVICE_ERROR
#define CKR_DEVICE_ERROR
Definition: pkcs11t.h:1060
CKR_SIGNATURE_INVALID
#define CKR_SIGNATURE_INVALID
Definition: pkcs11t.h:1106
Botan::PKCS11::ReturnValue::SessionParallelNotSupported
Botan::PKCS11::MechanismType::Sha512THmac
Botan::PKCS11::MechanismType::SkipjackCfb32
Botan::PKCS11::AttributeType::EcPoint
Botan::PKCS11::MechanismType::Pkcs5Pbkd2
CKK_ARIA
#define CKK_ARIA
Definition: pkcs11t.h:369
CKR_FUNCTION_CANCELED
#define CKR_FUNCTION_CANCELED
Definition: pkcs11t.h:1065
CKM_PBA_SHA1_WITH_SHA1_HMAC
#define CKM_PBA_SHA1_WITH_SHA1_HMAC
Definition: pkcs11t.h:809
Botan::PKCS11::KeyDerivation::Null
Botan::PKCS11::ReturnValue::PinTooWeak
Botan::PKCS11::KeyDerivation::Sha1Kdf
CK_CERTIFICATE_CATEGORY_OTHER_ENTITY
#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY
Definition: pkcs11t.h:398
Botan::PKCS11::MechanismType::RsaPkcsKeyPairGen
Botan::PKCS11::ReturnValue::MutexNotLocked
Botan::PKCS11::MechanismType::AesCbc
CKM_JUNIPER_COUNTER
#define CKM_JUNIPER_COUNTER
Definition: pkcs11t.h:908
CKM_DSA_SHA512
#define CKM_DSA_SHA512
Definition: pkcs11t.h:611
Botan::PKCS11::MechanismType::Cast5KeyGen
Botan::PKCS11::MechanismType::Rsa9796
Botan::PKCS11::SessionState::RwUserFunctions
CKF_LIBRARY_CANT_CREATE_OS_THREADS
#define CKF_LIBRARY_CANT_CREATE_OS_THREADS
Definition: pkcs11t.h:1225
Botan::PKCS11::AttributeType::HwFeatureType
CKA_EC_POINT
#define CKA_EC_POINT
Definition: pkcs11t.h:508
CKM_CAMELLIA_CBC_ENCRYPT_DATA
#define CKM_CAMELLIA_CBC_ENCRYPT_DATA
Definition: pkcs11t.h:844
Botan::PKCS11::LowLevel::C_Sign
bool C_Sign(SessionHandle session, const std::vector< uint8_t, TAllocA > &data, std::vector< uint8_t, TAllocB > &signature, ReturnValue *return_value=ThrowException) const
Definition: p11.h:2146
Botan::PKCS11::MechanismType::Cast128KeyGen
Botan::PKCS11::MechanismType::ConcatenateBaseAndKey
CKM_CAST5_ECB
#define CKM_CAST5_ECB
Definition: pkcs11t.h:741
CKD_SHA384_KDF
#define CKD_SHA384_KDF
Definition: pkcs11t.h:1298
CKM_CAST3_KEY_GEN
#define CKM_CAST3_KEY_GEN
Definition: pkcs11t.h:732
CKK_HOTP
#define CKK_HOTP
Definition: pkcs11t.h:366
CK_TOKEN_INFO
struct CK_TOKEN_INFO CK_TOKEN_INFO
Botan::PKCS11::MechanismType::BatonShuffle
CKK_SHA256_HMAC
#define CKK_SHA256_HMAC
Definition: pkcs11t.h:375
Botan::PKCS11::Flag::Rng
CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE
#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE
Definition: pkcs11t.h:815
CKM_CDMF_CBC_PAD
#define CKM_CDMF_CBC_PAD
Definition: pkcs11t.h:678
CKM_DES3_CMAC
#define CKM_DES3_CMAC
Definition: pkcs11t.h:672
Botan::PKCS11::AttributeType::Owner
CKM_SKIPJACK_WRAP
#define CKM_SKIPJACK_WRAP
Definition: pkcs11t.h:873
Botan::PKCS11::AttributeType::OtpLength
Botan::PKCS11::ReturnValue::HostMemory
Botan::PKCS11::MechanismType::PbeSha1Cast5Cbc
CKA_COEFFICIENT
#define CKA_COEFFICIENT
Definition: pkcs11t.h:482
Botan::PKCS11::MechanismType::DesEcb
CKM_RC2_KEY_GEN
#define CKM_RC2_KEY_GEN
Definition: pkcs11t.h:645
CKM_RSA_PKCS_TPM_1_1
#define CKM_RSA_PKCS_TPM_1_1
Definition: pkcs11t.h:972
CKC_WTLS
#define CKC_WTLS
Definition: pkcs11t.h:409
Botan::PKCS11::ReturnValue::CantLock
CKM_RSA_PKCS
#define CKM_RSA_PKCS
Definition: pkcs11t.h:587
Botan::PKCS11::MechanismType::FortezzaTimestamp
CKK_CAST
#define CKK_CAST
Definition: pkcs11t.h:352
Botan::PKCS11::AttributeType
AttributeType
Definition: p11.h:63
CK_CERTIFICATE_CATEGORY_AUTHORITY
#define CK_CERTIFICATE_CATEGORY_AUTHORITY
Definition: pkcs11t.h:397
CKM_CDMF_MAC
#define CKM_CDMF_MAC
Definition: pkcs11t.h:676
CKR_ATTRIBUTE_SENSITIVE
#define CKR_ATTRIBUTE_SENSITIVE
Definition: pkcs11t.h:1052
Botan::PKCS11::Flag::DualCryptoOperations
CKM_RSA_PKCS_KEY_PAIR_GEN
#define CKM_RSA_PKCS_KEY_PAIR_GEN
Definition: pkcs11t.h:586
CKM_SKIPJACK_KEY_GEN
#define CKM_SKIPJACK_KEY_GEN
Definition: pkcs11t.h:865
Botan::PKCS11::MechanismType::SecuridKeyGen
CKR_NO_EVENT
#define CKR_NO_EVENT
Definition: pkcs11t.h:1047
Botan::PKCS11::UserType::User
Botan::PKCS11::MechanismType::Sha512256HmacGeneral
Botan::PKCS11::LowLevel::C_SignUpdate
bool C_SignUpdate(SessionHandle session, const std::vector< uint8_t, TAlloc > &part, ReturnValue *return_value=ThrowException) const
Definition: p11.h:2196
CKM_CAMELLIA_ECB_ENCRYPT_DATA
#define CKM_CAMELLIA_ECB_ENCRYPT_DATA
Definition: pkcs11t.h:843
CKM_AES_KEY_WRAP
#define CKM_AES_KEY_WRAP
Definition: pkcs11t.h:969
Botan::PKCS11::Flag::SoPinFinalTry
CRYPTOKI_VERSION_MINOR
#define CRYPTOKI_VERSION_MINOR
Definition: pkcs11t.h:20
Botan::PKCS11::Flag::Hw
Botan::PKCS11::MechanismType::Cast3CbcPad
CKM_CAST_MAC_GENERAL
#define CKM_CAST_MAC_GENERAL
Definition: pkcs11t.h:730
Botan::PKCS11::MechanismType::Md2RsaPkcs
Botan::PKCS11::change_so_pin
void change_so_pin(Slot &slot, const secure_string &old_so_pin, const secure_string &new_so_pin)
Definition: p11.cpp:59
CKA_SERIAL_NUMBER
#define CKA_SERIAL_NUMBER
Definition: pkcs11t.h:446
Botan::PKCS11::AttributeType::AttrTypes
Botan::PKCS11::CertificateCategory::Authority
Botan::PKCS11::MechanismType::Cast3Ecb
CKM_RC5_CBC_PAD
#define CKM_RC5_CBC_PAD
Definition: pkcs11t.h:756
Botan::PKCS11::SessionState::RwPublicSession
Botan::PKCS11::MechanismType::RsaX931KeyPairGen
Botan::PKCS11::ReturnValue::WrappingKeySizeRange
Botan::PKCS11::ReturnValue::KeyNeeded
CKM_IDEA_CBC
#define CKM_IDEA_CBC
Definition: pkcs11t.h:759
CKF_ERROR_STATE
#define CKF_ERROR_STATE
Definition: pkcs11t.h:248
Botan::PKCS11::AttributeType::ResetOnInit
CKM_MD5_RSA_PKCS
#define CKM_MD5_RSA_PKCS
Definition: pkcs11t.h:592
Botan::PKCS11::MechanismType::EcmqvDerive
Botan::PKCS11::MechanismType::Sha512KeyDerivation
CKM_SHA512_224_KEY_DERIVATION
#define CKM_SHA512_224_KEY_DERIVATION
Definition: pkcs11t.h:634
CKM_SKIPJACK_CFB32
#define CKM_SKIPJACK_CFB32
Definition: pkcs11t.h:870
Botan::PKCS11::MechanismType::Des3CbcPad
Botan::PKCS11::MechanismType::DesCfb8
CKG_MGF1_SHA384
#define CKG_MGF1_SHA384
Definition: pkcs11t.h:1248
Botan::PKCS11::MechanismType::AriaMacGeneral
Botan::PKCS11::MechanismType::PbeSha1Rc240Cbc
Botan::PKCS11::ReturnValue::EncryptedDataLenRange
Botan::PKCS11::AttributeType::Gost28147Params
Botan::PKCS11::MechanismType::CastKeyGen
CKM_SHA512_HMAC_GENERAL
#define CKM_SHA512_HMAC_GENERAL
Definition: pkcs11t.h:718
Botan::PKCS11::MechanismType::PbeSha1Rc2128Cbc
CKM_AES_CFB128
#define CKM_AES_CFB128
Definition: pkcs11t.h:966
Botan::PKCS11::ReturnValue::UnwrappingKeyTypeInconsistent
CKR_GENERAL_ERROR
#define CKR_GENERAL_ERROR
Definition: pkcs11t.h:1043
Botan::PKCS11::SessionState::RwSoFunctions
Botan::PKCS11::AttributeType::OtpUserFriendlyMode
Botan::PKCS11::AttributeType::PixelX
CKM_CAMELLIA_CBC_PAD
#define CKM_CAMELLIA_CBC_PAD
Definition: pkcs11t.h:842
Botan::PKCS11::ReturnValue::KeyTypeInconsistent
CKD_NULL
#define CKD_NULL
Definition: pkcs11t.h:1290
Botan::PKCS11::AttributeType::Wrap
Botan::PKCS11::MechanismType::Ssl3Sha1Mac
Botan::PKCS11::MechanismType::EcdsaSha256
CKM_DES3_CBC
#define CKM_DES3_CBC
Definition: pkcs11t.h:666
Botan::PKCS11::ReturnValue::WrappedKeyInvalid
Botan::PKCS11::ReturnValue::NoEvent
CKA_PUBLIC_KEY_INFO
#define CKA_PUBLIC_KEY_INFO
Definition: pkcs11t.h:483
CKR_OK
#define CKR_OK
Definition: pkcs11t.h:1038
CKK_EC
#define CKK_EC
Definition: pkcs11t.h:343
Botan::PKCS11::UserType::ContextSpecific
Botan::PKCS11::Flag::None
CKR_WRAPPING_KEY_SIZE_RANGE
#define CKR_WRAPPING_KEY_SIZE_RANGE
Definition: pkcs11t.h:1127
CKM_DES_CFB64
#define CKM_DES_CFB64
Definition: pkcs11t.h:682
CKA_VALUE
#define CKA_VALUE
Definition: pkcs11t.h:442
CKA_KEY_TYPE
#define CKA_KEY_TYPE
Definition: pkcs11t.h:459
Botan::PKCS11::Flag::UserPinFinalTry
CKA_ID
#define CKA_ID
Definition: pkcs11t.h:461
CKA_OTP_COUNTER
#define CKA_OTP_COUNTER
Definition: pkcs11t.h:528
Botan::PKCS11::MechanismType::RsaX509
CKM_TLS12_MAC
#define CKM_TLS12_MAC
Definition: pkcs11t.h:820
CKM_SSL3_MASTER_KEY_DERIVE
#define CKM_SSL3_MASTER_KEY_DERIVE
Definition: pkcs11t.h:770
Botan::PKCS11::MechanismType::X942DhHybridDerive
CKM_AES_KEY_GEN
#define CKM_AES_KEY_GEN
Definition: pkcs11t.h:913
Botan::PKCS11::MechanismType::AesCts
CK_OBJECT_HANDLE
CK_ULONG CK_OBJECT_HANDLE
Definition: pkcs11t.h:298
CKF_SO_PIN_COUNT_LOW
#define CKF_SO_PIN_COUNT_LOW
Definition: pkcs11t.h:229
Botan::PKCS11::MechanismType::Rc5MacGeneral
CKM_CONCATENATE_BASE_AND_DATA
#define CKM_CONCATENATE_BASE_AND_DATA
Definition: pkcs11t.h:765
CKF_GENERATE
#define CKF_GENERATE
Definition: pkcs11t.h:1013
Botan::PKCS11::AttributeType::Decrypt
Botan::PKCS11::AttributeType::OtpServiceIdentifier
CK_INFO
struct CK_INFO CK_INFO
CKM_CAST128_MAC_GENERAL
#define CKM_CAST128_MAC_GENERAL
Definition: pkcs11t.h:748
Botan::PKCS11::MechanismType::EcKeyPairGen
CKM_KEA_KEY_DERIVE
#define CKM_KEA_KEY_DERIVE
Definition: pkcs11t.h:877
Botan::PKCS11::MechanismType::ConcatenateDataAndBase
Botan::PKCS11::KeyType::Sha512Hmac
CKA_OBJECT_ID
#define CKA_OBJECT_ID
Definition: pkcs11t.h:443
Botan::PKCS11::MechanismType::ConcatenateBaseAndData
Botan::PKCS11::MechanismType::AriaCbcEncryptData
Botan::PKCS11::set_pin
void set_pin(Slot &slot, const secure_string &so_pin, const secure_string &pin)
Definition: p11.cpp:66
CKM_TLS10_MAC_CLIENT
#define CKM_TLS10_MAC_CLIENT
Definition: pkcs11t.h:819
CKM_PBE_SHA1_RC4_40
#define CKM_PBE_SHA1_RC4_40
Definition: pkcs11t.h:801
Botan::PKCS11::AttributeType::Color
Botan::PKCS11::CertificateCategory::Unspecified
CKA_WRAP
#define CKA_WRAP
Definition: pkcs11t.h:465
CKF_WRITE_PROTECTED
#define CKF_WRITE_PROTECTED
Definition: pkcs11t.h:156
CKM_CAST3_CBC_PAD
#define CKM_CAST3_CBC_PAD
Definition: pkcs11t.h:737
CKM_RIPEMD128_RSA_PKCS
#define CKM_RIPEMD128_RSA_PKCS
Definition: pkcs11t.h:595
CKM_RC2_CBC
#define CKM_RC2_CBC
Definition: pkcs11t.h:647
Botan::PKCS11::MechanismType::KeaKeyPairGen
CKR_OBJECT_HANDLE_INVALID
#define CKR_OBJECT_HANDLE_INVALID
Definition: pkcs11t.h:1086
Botan::PKCS11::ReturnValue::PinIncorrect
CKK_CAMELLIA
#define CKK_CAMELLIA
Definition: pkcs11t.h:368
CKF_USER_FRIENDLY_OTP
#define CKF_USER_FRIENDLY_OTP
Definition: pkcs11t.h:1814
CKO_CERTIFICATE
#define CKO_CERTIFICATE
Definition: pkcs11t.h:311
CKK_SEED
#define CKK_SEED
Definition: pkcs11t.h:380
Botan::PKCS11::AttributeType::Subprime
Botan::PKCS11::MechanismType::CamelliaCbc
CKM_TLS_MASTER_KEY_DERIVE_DH
#define CKM_TLS_MASTER_KEY_DERIVE_DH
Definition: pkcs11t.h:777
Botan::PKCS11::MechanismType::Gostr3410KeyPairGen
CKM_TWOFISH_CBC_PAD
#define CKM_TWOFISH_CBC_PAD
Definition: pkcs11t.h:935
Botan::PKCS11::AttributeType::Token
CKA_GOST28147_PARAMS
#define CKA_GOST28147_PARAMS
Definition: pkcs11t.h:537
CKM_KIP_WRAP
#define CKM_KIP_WRAP
Definition: pkcs11t.h:834
CKM_SSL3_MD5_MAC
#define CKM_SSL3_MD5_MAC
Definition: pkcs11t.h:781
Botan::PKCS11::MechanismType::PbeMd2DesCbc
Botan::PKCS11::ReturnValue::KeyIndigestible
CKM_BATON_COUNTER
#define CKM_BATON_COUNTER
Definition: pkcs11t.h:884
CKM_BATON_ECB96
#define CKM_BATON_ECB96
Definition: pkcs11t.h:882
Botan::PKCS11::flags
Flags flags(Flag flags)
Definition: p11.h:858
Botan::PKCS11::AttributeType::OtpPinRequirement
CK_TRUE
#define CK_TRUE
Definition: pkcs11t.h:23
Botan::PKCS11::ReturnValue::UserTypeInvalid
CKM_GOSTR3410
#define CKM_GOSTR3410
Definition: pkcs11t.h:945
std
Definition: bigint.h:619
Botan::PKCS11::MechanismType::DesMac
Botan::PKCS11::AttributeType::PublicKeyInfo
CKM_PBE_SHA1_DES3_EDE_CBC
#define CKM_PBE_SHA1_DES3_EDE_CBC
Definition: pkcs11t.h:802
CKH_CLOCK
#define CKH_CLOCK
Definition: pkcs11t.h:331
CKR_MUTEX_BAD
#define CKR_MUTEX_BAD
Definition: pkcs11t.h:1144
CKR_RANDOM_NO_RNG
#define CKR_RANDOM_NO_RNG
Definition: pkcs11t.h:1131
Botan::PKCS11::AttributeType::CharColumns
Botan::PKCS11::PseudoRandom
PseudoRandom
Definition: p11.h:692
CKP_PKCS5_PBKD2_HMAC_SHA512_224
#define CKP_PKCS5_PBKD2_HMAC_SHA512_224
Definition: pkcs11t.h:1725
CKM_SHA512_224
#define CKM_SHA512_224
Definition: pkcs11t.h:631
Botan::PKCS11::MechanismType::DesCbcEncryptData
Botan::PKCS11::PKCS11_Error::PKCS11_Error
PKCS11_Error(const std::string &what)
Definition: p11.h:2827
CKM_TWOFISH_KEY_GEN
#define CKM_TWOFISH_KEY_GEN
Definition: pkcs11t.h:932
Botan::PKCS11::MechanismType::Tls12MasterKeyDerive
CKA_PIXEL_X
#define CKA_PIXEL_X
Definition: pkcs11t.h:543
CKG_MGF1_SHA1
#define CKG_MGF1_SHA1
Definition: pkcs11t.h:1246
Botan::PKCS11::PKCS11_Error
Definition: p11.h:2824
CKR_WRAPPING_KEY_TYPE_INCONSISTENT
#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT
Definition: pkcs11t.h:1128
Botan::PKCS11::Ulong
CK_ULONG Ulong
Definition: p11.h:836
CKM_SHA224
#define CKM_SHA224
Definition: pkcs11t.h:710
Botan::PKCS11::MechanismType::Des3Cmac
CKS_RO_PUBLIC_SESSION
#define CKS_RO_PUBLIC_SESSION
Definition: pkcs11t.h:272
Botan::PKCS11::MechanismType::Md2
Botan::PKCS11::HardwareType::UserInterface
CKO_SECRET_KEY
#define CKO_SECRET_KEY
Definition: pkcs11t.h:314
CKR_ATTRIBUTE_READ_ONLY
#define CKR_ATTRIBUTE_READ_ONLY
Definition: pkcs11t.h:1051
Botan::PKCS11::MGF::Mgf1Sha224
CKM_RC5_MAC_GENERAL
#define CKM_RC5_MAC_GENERAL
Definition: pkcs11t.h:755
Botan::PKCS11::MechanismType::JuniperCbc128
Botan::PKCS11::MechanismType::Rc2Cbc
CKR_SESSION_EXISTS
#define CKR_SESSION_EXISTS
Definition: pkcs11t.h:1101
Botan::PKCS11::MechanismType::Sha256RsaPkcsPss
Botan::PKCS11::VoidPtr
CK_VOID_PTR VoidPtr
Definition: p11.h:826
CKM_BLOWFISH_KEY_GEN
#define CKM_BLOWFISH_KEY_GEN
Definition: pkcs11t.h:930
Botan::PKCS11::MechanismType::PbaSha1WithSha1Hmac
CKF_HW_SLOT
#define CKF_HW_SLOT
Definition: pkcs11t.h:124
CKR_MUTEX_NOT_LOCKED
#define CKR_MUTEX_NOT_LOCKED
Definition: pkcs11t.h:1145
CK_BYTE
unsigned char CK_BYTE
Definition: pkcs11t.h:36
Botan::PKCS11::ObjectClass
ObjectClass
Definition: p11.h:678
Botan::PKCS11::Flag::TokenPresent
Botan::PKCS11::ReturnValue::UnwrappingKeySizeRange
CKM_SEED_MAC
#define CKM_SEED_MAC
Definition: pkcs11t.h:859
CKR_NEXT_OTP
#define CKR_NEXT_OTP
Definition: pkcs11t.h:1148
Botan::PKCS11::KeyType::Ripemd160Hmac
CKM_RSA_9796
#define CKM_RSA_9796
Definition: pkcs11t.h:588
Botan::PKCS11::MechanismType::SkipjackWrap
Botan::PKCS11::MechanismType::AesGcm
CK_ULONG
unsigned long int CK_ULONG
Definition: pkcs11t.h:48
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha384
CKM_PBE_SHA1_RC2_40_CBC
#define CKM_PBE_SHA1_RC2_40_CBC
Definition: pkcs11t.h:805
CKA_ALWAYS_AUTHENTICATE
#define CKA_ALWAYS_AUTHENTICATE
Definition: pkcs11t.h:513
CKA_DERIVE
#define CKA_DERIVE
Definition: pkcs11t.h:471
CKK_X9_42_DH
#define CKK_X9_42_DH
Definition: pkcs11t.h:344
CKA_OTP_FORMAT
#define CKA_OTP_FORMAT
Definition: pkcs11t.h:520
Botan::PKCS11::MechanismType::Rc5CbcPad
CKF_REMOVABLE_DEVICE
#define CKF_REMOVABLE_DEVICE
Definition: pkcs11t.h:123
CKA_OTP_TIME_REQUIREMENT
#define CKA_OTP_TIME_REQUIREMENT
Definition: pkcs11t.h:525
Botan::PKCS11::ReturnValue::PinInvalid
CKR_TOKEN_WRITE_PROTECTED
#define CKR_TOKEN_WRITE_PROTECTED
Definition: pkcs11t.h:1112
CKM_DES3_CBC_PAD
#define CKM_DES3_CBC_PAD
Definition: pkcs11t.h:670
Botan::PKCS11::ReturnValue::FunctionFailed
Botan::PKCS11::ReturnValue::NeedToCreateThreads
CKR_DEVICE_MEMORY
#define CKR_DEVICE_MEMORY
Definition: pkcs11t.h:1061
CK_MECHANISM
struct CK_MECHANISM CK_MECHANISM
Botan::PKCS11::MechanismType::DesKeyGen
CKM_RC4
#define CKM_RC4
Definition: pkcs11t.h:654
CKR_INFORMATION_SENSITIVE
#define CKR_INFORMATION_SENSITIVE
Definition: pkcs11t.h:1139
CKC_X_509
#define CKC_X_509
Definition: pkcs11t.h:407
CK_RSA_PKCS_OAEP_PARAMS
Definition: pkcs11t.h:1266
Botan::PKCS11::AttributeType::ValueLen
CKM_DES_OFB64
#define CKM_DES_OFB64
Definition: pkcs11t.h:680
Botan::PKCS11::MechanismType::CmsSig
CKR_EXCEEDED_MAX_ITERATIONS
#define CKR_EXCEEDED_MAX_ITERATIONS
Definition: pkcs11t.h:1150
Botan::PKCS11::MechanismType::X942DhKeyPairGen
CK_ATTRIBUTE_TYPE
CK_ULONG CK_ATTRIBUTE_TYPE
Definition: pkcs11t.h:416
type
MechanismType type
Definition: p11_mechanism.cpp:43
CKP_PKCS5_PBKD2_HMAC_GOSTR3411
#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411
Definition: pkcs11t.h:1720
CKM_AES_CTR
#define CKM_AES_CTR
Definition: pkcs11t.h:919
Botan::PKCS11::MechanismType::Sha384RsaPkcs
CKA_PRIVATE
#define CKA_PRIVATE
Definition: pkcs11t.h:439
Botan::PKCS11::MechanismType::Sha384HmacGeneral
Botan::PKCS11::PublicPointEncoding::Der
Botan::PKCS11::AttributeType::WrapWithTrusted
CKK_MD5_HMAC
#define CKK_MD5_HMAC
Definition: pkcs11t.h:371
Botan::PKCS11::Flag::LoginRequired
Botan::PKCS11::MechanismType::BatonCbc128
Botan::PKCS11::AttributeType::OtpServiceLogo
CKA_OTP_PIN_REQUIREMENT
#define CKA_OTP_PIN_REQUIREMENT
Definition: pkcs11t.h:527
CKA_ALWAYS_SENSITIVE
#define CKA_ALWAYS_SENSITIVE
Definition: pkcs11t.h:497
CKR_PIN_INVALID
#define CKR_PIN_INVALID
Definition: pkcs11t.h:1090
Botan::PKCS11::MechanismType::SeedCbcEncryptData
CKA_END_DATE
#define CKA_END_DATE
Definition: pkcs11t.h:473
CKM_ECDSA_SHA1
#define CKM_ECDSA_SHA1
Definition: pkcs11t.h:892
Botan::PKCS11::MechanismType::Rc5Ecb
CKU_SO
#define CKU_SO
Definition: pkcs11t.h:264
CKA_OTP_LENGTH
#define CKA_OTP_LENGTH
Definition: pkcs11t.h:521
Botan::PKCS11::MechanismType::Sha512T
CKM_CAST128_ECB
#define CKM_CAST128_ECB
Definition: pkcs11t.h:742
CK_HW_FEATURE_TYPE
CK_ULONG CK_HW_FEATURE_TYPE
Definition: pkcs11t.h:327
Botan::PKCS11::MechanismType::DsaKeyPairGen
CKR_LIBRARY_LOAD_FAILED
#define CKR_LIBRARY_LOAD_FAILED
Definition: pkcs11t.h:1152
CKR_PIN_TOO_WEAK
#define CKR_PIN_TOO_WEAK
Definition: pkcs11t.h:1153
CKM_SSL3_PRE_MASTER_KEY_GEN
#define CKM_SSL3_PRE_MASTER_KEY_GEN
Definition: pkcs11t.h:769
Botan::PKCS11::MechanismType::AesCfb128
Botan::PKCS11::Byte
CK_BYTE Byte
Definition: p11.h:847
CKM_SHA512_T_HMAC_GENERAL
#define CKM_SHA512_T_HMAC_GENERAL
Definition: pkcs11t.h:642
CKA_SIGN
#define CKA_SIGN
Definition: pkcs11t.h:467
CKR_DATA_INVALID
#define CKR_DATA_INVALID
Definition: pkcs11t.h:1058
CKM_MD2_HMAC
#define CKM_MD2_HMAC
Definition: pkcs11t.h:687
Botan::PKCS11::AttributeType::Verify
Botan::PKCS11::MechanismType::RsaAesKeyWrap
Botan::PKCS11::KeyType::Aes
Botan::PKCS11::ReturnValue::KeyNotWrappable
CKM_AES_ECB_ENCRYPT_DATA
#define CKM_AES_ECB_ENCRYPT_DATA
Definition: pkcs11t.h:941
Botan::PKCS11::KeyType::Ripemd128Hmac
CKR_ATTRIBUTE_TYPE_INVALID
#define CKR_ATTRIBUTE_TYPE_INVALID
Definition: pkcs11t.h:1053
CKA_VENDOR_DEFINED
#define CKA_VENDOR_DEFINED
Definition: pkcs11t.h:559
CKM_AES_XCBC_MAC_96
#define CKM_AES_XCBC_MAC_96
Definition: pkcs11t.h:927
Botan::PKCS11::MechanismType::Cast5CbcPad
CKM_ACTI_KEY_GEN
#define CKM_ACTI_KEY_GEN
Definition: pkcs11t.h:724
Botan::PKCS11::MechanismType::Sha512RsaPkcsPss
CKM_SHA1_RSA_X9_31
#define CKM_SHA1_RSA_X9_31
Definition: pkcs11t.h:601
CKK_DES2
#define CKK_DES2
Definition: pkcs11t.h:350
Botan::PKCS11::AttributeType::OtpChallengeRequirement
CKM_AES_CCM
#define CKM_AES_CCM
Definition: pkcs11t.h:921
CKK_RC5
#define CKK_RC5
Definition: pkcs11t.h:356
CKA_ECDSA_PARAMS
#define CKA_ECDSA_PARAMS
Definition: pkcs11t.h:505
Botan::PKCS11::MechanismType::Cast3KeyGen
CKF_WRAP
#define CKF_WRAP
Definition: pkcs11t.h:1015
Botan::PKCS11::ReturnValue::UserNotLoggedIn
Botan::PKCS11::KeyDerivation::CpdiversifyKdf
CKM_TLS12_KDF
#define CKM_TLS12_KDF
Definition: pkcs11t.h:821
Botan::PKCS11::MechanismType::DesEcbEncryptData
CKR_PIN_INCORRECT
#define CKR_PIN_INCORRECT
Definition: pkcs11t.h:1089
CKM_DH_PKCS_PARAMETER_GEN
#define CKM_DH_PKCS_PARAMETER_GEN
Definition: pkcs11t.h:958
Botan::PKCS11::Flag::EcNamedcurve
Botan::PKCS11::MechanismType::CastEcb
CKA_CERTIFICATE_CATEGORY
#define CKA_CERTIFICATE_CATEGORY
Definition: pkcs11t.h:451
Botan::PKCS11::MechanismType::Sha224RsaPkcsPss
CKA_LOCAL
#define CKA_LOCAL
Definition: pkcs11t.h:495
CKM_SHA1_RSA_PKCS_PSS
#define CKM_SHA1_RSA_PKCS_PSS
Definition: pkcs11t.h:603
CKA_EXPONENT_1
#define CKA_EXPONENT_1
Definition: pkcs11t.h:480
CKM_TLS10_MAC_SERVER
#define CKM_TLS10_MAC_SERVER
Definition: pkcs11t.h:818
Botan::PKCS11::MechanismType::CdmfKeyGen
CKR_PUBLIC_KEY_INVALID
#define CKR_PUBLIC_KEY_INVALID
Definition: pkcs11t.h:1154
CK_MECHANISM_INFO
Definition: pkcs11t.h:995
Botan::PKCS11::MechanismType::GenericSecretKeyGen
Botan::PKCS11::KeyType::Seed
CKK_ACTI
#define CKK_ACTI
Definition: pkcs11t.h:367
Botan::PKCS11::MechanismType::SeedKeyGen
Botan::PKCS11::ReturnValue::AttributeValueInvalid
CKF_LOGIN_REQUIRED
#define CKF_LOGIN_REQUIRED
Definition: pkcs11t.h:157
Botan::PKCS11::ReturnValue::MutexBad
CKM_VENDOR_DEFINED
#define CKM_VENDOR_DEFINED
Definition: pkcs11t.h:975
Botan::PKCS11::KeyType::Sha1Hmac
Botan::PKCS11::Flag::OsLockingOk
Botan::PKCS11::CertificateType::X509AttrCert
CK_OBJECT_CLASS
CK_ULONG CK_OBJECT_CLASS
Definition: pkcs11t.h:307
CKA_HAS_RESET
#define CKA_HAS_RESET
Definition: pkcs11t.h:541
CKR_STATE_UNSAVEABLE
#define CKR_STATE_UNSAVEABLE
Definition: pkcs11t.h:1140
CKM_PBE_SHA1_DES2_EDE_CBC
#define CKM_PBE_SHA1_DES2_EDE_CBC
Definition: pkcs11t.h:803
CKR_KEY_INDIGESTIBLE
#define CKR_KEY_INDIGESTIBLE
Definition: pkcs11t.h:1078
Botan::PKCS11::Flag::UserPinToBeChanged
Botan::PKCS11::ReturnValue::UserTooManyTypes
CKM_PBE_MD5_DES_CBC
#define CKM_PBE_MD5_DES_CBC
Definition: pkcs11t.h:793
Botan::PKCS11::ReturnValue::AttributeTypeInvalid
CKF_NEXT_OTP
#define CKF_NEXT_OTP
Definition: pkcs11t.h:1809
CKA_OTP_SERVICE_LOGO
#define CKA_OTP_SERVICE_LOGO
Definition: pkcs11t.h:532
CKD_SHA512_KDF
#define CKD_SHA512_KDF
Definition: pkcs11t.h:1299
Botan::PKCS11::AttributeType::AlwaysAuthenticate
CKF_VERIFY_RECOVER
#define CKF_VERIFY_RECOVER
Definition: pkcs11t.h:1012
Botan::PKCS11::MechanismType::TlsMac
CK_C_INITIALIZE_ARGS
struct CK_C_INITIALIZE_ARGS CK_C_INITIALIZE_ARGS
Botan::PKCS11::MechanismType::Sha384RsaPkcsPss
Botan::PKCS11::MechanismType::CastMac
Botan::PKCS11::Notification::OtpChanged
Botan::PKCS11::KeyType::Cast
Botan::PKCS11::MechanismType::Sha256KeyDerivation
Botan::PKCS11::MechanismType::IdeaMacGeneral
Botan::PKCS11::AttributeType::HashOfIssuerPublicKey
CKF_EXTENSION
#define CKF_EXTENSION
Definition: pkcs11t.h:1029
Botan::PKCS11::MechanismType::Cast5MacGeneral
Botan::PKCS11::MechanismType::Rc5Cbc
CKK_GOSTR3410
#define CKK_GOSTR3410
Definition: pkcs11t.h:381
Botan::PKCS11::KeyType::Cast5
Botan::PKCS11::FunctionListPtr
CK_FUNCTION_LIST_PTR FunctionListPtr
Definition: p11.h:825
CKR_ACTION_PROHIBITED
#define CKR_ACTION_PROHIBITED
Definition: pkcs11t.h:1056
CKM_SHA256
#define CKM_SHA256
Definition: pkcs11t.h:707
CKF_HW
#define CKF_HW
Definition: pkcs11t.h:1003
CKF_EC_UNCOMPRESS
#define CKF_EC_UNCOMPRESS
Definition: pkcs11t.h:1026
CKF_OS_LOCKING_OK
#define CKF_OS_LOCKING_OK
Definition: pkcs11t.h:1226
CKF_DERIVE
#define CKF_DERIVE
Definition: pkcs11t.h:1017
Botan::PKCS11::Flag::ExcludeChallenge
Botan::PKCS11::AttributeType::SecondaryAuth
Botan::PKCS11::ReturnValue::AttributeSensitive
CKR_USER_TOO_MANY_TYPES
#define CKR_USER_TOO_MANY_TYPES
Definition: pkcs11t.h:1122
Botan::PKCS11::KeyDerivation::Sha224Kdf
Botan::PKCS11::Flag::SecondaryAuthentication
Botan::PKCS11::KeyType::Gost28147
CKM_RC2_MAC
#define CKM_RC2_MAC
Definition: pkcs11t.h:648
Botan::PKCS11::MechanismType::Ripemd160HmacGeneral
CKM_TLS_PRF
#define CKM_TLS_PRF
Definition: pkcs11t.h:779
CKM_X9_42_MQV_DERIVE
#define CKM_X9_42_MQV_DERIVE
Definition: pkcs11t.h:619
CKA_SECONDARY_AUTH
#define CKA_SECONDARY_AUTH
Definition: pkcs11t.h:510
Botan::PKCS11::ReturnValue::ObjectHandleInvalid
CK_RSA_PKCS_PSS_PARAMS
Definition: pkcs11t.h:1279
Botan::PKCS11::AttributeType::Derive
Botan::PKCS11::KeyDerivation::Sha384Kdf
CKF_EC_F_P
#define CKF_EC_F_P
Definition: pkcs11t.h:1022
CKM_RIPEMD128
#define CKM_RIPEMD128
Definition: pkcs11t.h:700
CKM_MD5_KEY_DERIVATION
#define CKM_MD5_KEY_DERIVATION
Definition: pkcs11t.h:783
Botan::PKCS11::MechanismType::Cast3Cbc
Botan::PKCS11::AttributeType::Exponent2
Botan::PKCS11::MechanismType::RsaPkcsPss
Botan::PKCS11::Flag::UserPinCountLow
Botan::PKCS11::MechanismType::Sha224RsaPkcs
Botan::PKCS11::AttributeType::Private
Botan::PKCS11::AttributeType::OtpServiceLogoType
Botan::PKCS11::MechanismType::Tls10MacServer
CKM_ECDSA_SHA384
#define CKM_ECDSA_SHA384
Definition: pkcs11t.h:895
CKM_SHA1_KEY_DERIVATION
#define CKM_SHA1_KEY_DERIVATION
Definition: pkcs11t.h:785
Botan::PKCS11::CreateMutex
CK_CREATEMUTEX CreateMutex
Definition: p11.h:828
Botan::PKCS11::AttributeType::SupportedCmsAttributes
Botan::PKCS11::KeyType::Des
Botan::PKCS11::MechanismType::AesCbcPad
Botan::PKCS11::MechanismType::Sha1
CKM_DSA_SHA224
#define CKM_DSA_SHA224
Definition: pkcs11t.h:608
CKM_SHA1_RSA_PKCS
#define CKM_SHA1_RSA_PKCS
Definition: pkcs11t.h:593
CKM_AES_CFB1
#define CKM_AES_CFB1
Definition: pkcs11t.h:968
Botan::PKCS11::KeyType::Rc4
Botan::PKCS11::KeyType::Des3
Botan::PKCS11::MechanismType::DesCbcPad
Botan::PKCS11::SessionHandle
CK_SESSION_HANDLE SessionHandle
Definition: p11.h:843
Botan::PKCS11::MechanismType::Ripemd128
CKA_CHAR_SETS
#define CKA_CHAR_SETS
Definition: pkcs11t.h:550
CKM_MD2_KEY_DERIVATION
#define CKM_MD2_KEY_DERIVATION
Definition: pkcs11t.h:784
CKA_ALLOWED_MECHANISMS
#define CKA_ALLOWED_MECHANISMS
Definition: pkcs11t.h:557
CKM_DES_CBC
#define CKM_DES_CBC
Definition: pkcs11t.h:657
CKF_UNWRAP
#define CKF_UNWRAP
Definition: pkcs11t.h:1016
Botan::PKCS11::LowLevel::C_Login
bool C_Login(SessionHandle session, UserType user_type, const std::vector< uint8_t, TAlloc > &pin, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1421
CKK_GENERIC_SECRET
#define CKK_GENERIC_SECRET
Definition: pkcs11t.h:346
CKM_SHA384_HMAC
#define CKM_SHA384_HMAC
Definition: pkcs11t.h:714
CKF_RESTORE_KEY_NOT_NEEDED
#define CKF_RESTORE_KEY_NOT_NEEDED
Definition: pkcs11t.h:165
CKR_OPERATION_ACTIVE
#define CKR_OPERATION_ACTIVE
Definition: pkcs11t.h:1087
Botan::PKCS11::MechanismType::PbeSha1Rc4128
Botan::PKCS11::MechanismType::XorBaseAndData
CKM_SHA512_224_HMAC_GENERAL
#define CKM_SHA512_224_HMAC_GENERAL
Definition: pkcs11t.h:633
Botan::PKCS11::ReturnValue::TokenNotPresent
CKM_DES_CBC_PAD
#define CKM_DES_CBC_PAD
Definition: pkcs11t.h:661
Botan::PKCS11::ReturnValue::SessionReadWriteSoExists
Botan::PKCS11::MechanismType::Sha512RsaPkcs
Botan::PKCS11::KeyType::Juniper
CKM_RSA_AES_KEY_WRAP
#define CKM_RSA_AES_KEY_WRAP
Definition: pkcs11t.h:903
Botan::PKCS11::AttributeType::VendorDefined
CKA_ENCRYPT
#define CKA_ENCRYPT
Definition: pkcs11t.h:463
CKM_FASTHASH
#define CKM_FASTHASH
Definition: pkcs11t.h:911
CKM_CONCATENATE_BASE_AND_KEY
#define CKM_CONCATENATE_BASE_AND_KEY
Definition: pkcs11t.h:764
Botan::PKCS11::ReturnValue::SignatureInvalid
Botan::PKCS11::MechanismType::Des3Ecb
Botan::PKCS11::KeyType::Idea
CKM_ECDSA
#define CKM_ECDSA
Definition: pkcs11t.h:891
CKM_BATON_ECB128
#define CKM_BATON_ECB128
Definition: pkcs11t.h:881
CK_SESSION_HANDLE
CK_ULONG CK_SESSION_HANDLE
Definition: pkcs11t.h:256
CKR_KEY_NOT_WRAPPABLE
#define CKR_KEY_NOT_WRAPPABLE
Definition: pkcs11t.h:1080
CKA_MODULUS
#define CKA_MODULUS
Definition: pkcs11t.h:474
Botan::PKCS11::MechanismType::IdeaCbc
CKM_SHA512_T_KEY_DERIVATION
#define CKM_SHA512_T_KEY_DERIVATION
Definition: pkcs11t.h:643
CKS_RO_USER_FUNCTIONS
#define CKS_RO_USER_FUNCTIONS
Definition: pkcs11t.h:273
Botan::Twofish
Definition: twofish.h:18
Botan::PKCS11::KeyType::Sha384Hmac
Botan::PKCS11::MechanismType::Sha512THmacGeneral
Botan::PKCS11::KeyType::Cast3
CKM_AES_CBC_PAD
#define CKM_AES_CBC_PAD
Definition: pkcs11t.h:918
CKF_CLOCK_ON_TOKEN
#define CKF_CLOCK_ON_TOKEN
Definition: pkcs11t.h:171
Botan::PKCS11::KeyType::Ec
CKA_OTP_USER_IDENTIFIER
#define CKA_OTP_USER_IDENTIFIER
Definition: pkcs11t.h:530
CKM_ARIA_ECB
#define CKM_ARIA_ECB
Definition: pkcs11t.h:848
Botan::PKCS11::MechanismType::HotpKeyGen
Botan::PKCS11::KeyType::Gostr3410
CKK_KEA
#define CKK_KEA
Definition: pkcs11t.h:345
CKR_FUNCTION_NOT_SUPPORTED
#define CKR_FUNCTION_NOT_SUPPORTED
Definition: pkcs11t.h:1068
CKM_AES_GCM
#define CKM_AES_GCM
Definition: pkcs11t.h:920
CKM_KEY_WRAP_SET_OAEP
#define CKM_KEY_WRAP_SET_OAEP
Definition: pkcs11t.h:830
Botan::PKCS11::Flag::ProtectedAuthenticationPath
Botan::PKCS11::MechanismType::JuniperWrap
CKM_SEED_MAC_GENERAL
#define CKM_SEED_MAC_GENERAL
Definition: pkcs11t.h:860
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::PKCS11::CertificateCategory::OtherEntity
CKR_PIN_LOCKED
#define CKR_PIN_LOCKED
Definition: pkcs11t.h:1094
CK_CERTIFICATE_CATEGORY_UNSPECIFIED
#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED
Definition: pkcs11t.h:395
Botan::PKCS11::MechanismType::CdmfMac
Botan::PKCS11::MechanismType::RsaPkcs
Botan::PKCS11::MechanismType::CamelliaCtr
CKM_AES_CMAC
#define CKM_AES_CMAC
Definition: pkcs11t.h:923
Botan::PKCS11::AttributeType::WrapTemplate
Botan::PKCS11::MechanismType::TwofishKeyGen
CKM_FORTEZZA_TIMESTAMP
#define CKM_FORTEZZA_TIMESTAMP
Definition: pkcs11t.h:879
CKM_JUNIPER_KEY_GEN
#define CKM_JUNIPER_KEY_GEN
Definition: pkcs11t.h:905
Botan::PKCS11::MechanismType::CamelliaCbcEncryptData
Botan::PKCS11::AttributeType::Class
CKR_FUNCTION_FAILED
#define CKR_FUNCTION_FAILED
Definition: pkcs11t.h:1044
Botan::PKCS11::AttributeType::EndDate
Botan::PKCS11::ReturnValue::CryptokiNotInitialized
CKR_TEMPLATE_INCONSISTENT
#define CKR_TEMPLATE_INCONSISTENT
Definition: pkcs11t.h:1109
Botan::PKCS11::MechanismType::EcdhAesKeyWrap
CKA_SENSITIVE
#define CKA_SENSITIVE
Definition: pkcs11t.h:462
CKA_PUBLIC_EXPONENT
#define CKA_PUBLIC_EXPONENT
Definition: pkcs11t.h:476
CK_RSA_PKCS_PSS_PARAMS
struct CK_RSA_PKCS_PSS_PARAMS CK_RSA_PKCS_PSS_PARAMS
Botan::PKCS11::MechanismType::DesMacGeneral
Botan::PKCS11::MechanismType::SeedCbcPad
Botan::PKCS11::Flag::LibraryCantCreateOsThreads
CKK_CDMF
#define CKK_CDMF
Definition: pkcs11t.h:361
CKM_SHA384_RSA_PKCS
#define CKM_SHA384_RSA_PKCS
Definition: pkcs11t.h:622
CKM_SEED_CBC
#define CKM_SEED_CBC
Definition: pkcs11t.h:858
Botan::PKCS11::AttributeType::CheckValue
Botan::PKCS11::Flag::UserPinLocked
CKM_AES_OFB
#define CKM_AES_OFB
Definition: pkcs11t.h:963
Botan::PKCS11::MechanismType::BlowfishCbc
Botan::PKCS11::MechanismType::AriaEcbEncryptData
Botan::PKCS11::ReturnValue::DeviceError
Botan::PKCS11::MechanismType::RsaX931
CKF_EC_COMPRESS
#define CKF_EC_COMPRESS
Definition: pkcs11t.h:1027
Botan::PKCS11::MechanismType::TwofishCbc
CKM_GOST28147_KEY_GEN
#define CKM_GOST28147_KEY_GEN
Definition: pkcs11t.h:951
Botan::PKCS11::ReturnValue::CurveNotSupported
Botan::PKCS11::MechanismType::Cast5Cbc
CKP_PKCS5_PBKD2_HMAC_SHA1
#define CKP_PKCS5_PBKD2_HMAC_SHA1
Definition: pkcs11t.h:1719
CKM_ECDSA_SHA512
#define CKM_ECDSA_SHA512
Definition: pkcs11t.h:896
Botan::PKCS11::ReturnValue::KeyNotNeeded
CKM_AES_MAC
#define CKM_AES_MAC
Definition: pkcs11t.h:916
CK_KEY_TYPE
CK_ULONG CK_KEY_TYPE
Definition: pkcs11t.h:336
CKM_AES_MAC_GENERAL
#define CKM_AES_MAC_GENERAL
Definition: pkcs11t.h:917
Botan::PKCS11::MechanismType::Cast128Cbc
Botan::PKCS11::MechanismType::Fasthash
Botan::PKCS11::ReturnValue::DataInvalid
Botan::PKCS11::MechanismType::Sha512224KeyDerivation
Botan::PKCS11::MechanismType::Sha1RsaX931
CKD_SHA224_KDF
#define CKD_SHA224_KDF
Definition: pkcs11t.h:1296
CKR_ARGUMENTS_BAD
#define CKR_ARGUMENTS_BAD
Definition: pkcs11t.h:1046
CKA_OWNER
#define CKA_OWNER
Definition: pkcs11t.h:448
CRYPTOKI_VERSION_MAJOR
#define CRYPTOKI_VERSION_MAJOR
Definition: pkcs11t.h:19
CKF_SECONDARY_AUTHENTICATION
#define CKF_SECONDARY_AUTHENTICATION
Definition: pkcs11t.h:199
CKA_COPYABLE
#define CKA_COPYABLE
Definition: pkcs11t.h:501
Botan::PKCS11::AttributeType::VerifyRecover
Botan::PKCS11::KeyType::Aria
CKP_PKCS5_PBKD2_HMAC_SHA256
#define CKP_PKCS5_PBKD2_HMAC_SHA256
Definition: pkcs11t.h:1722
CKM_GENERIC_SECRET_KEY_GEN
#define CKM_GENERIC_SECRET_KEY_GEN
Definition: pkcs11t.h:763
Botan::PKCS11::MechanismType::DesOfb64
CKM_SHA256_HMAC_GENERAL
#define CKM_SHA256_HMAC_GENERAL
Definition: pkcs11t.h:709
Botan::PKCS11::MechanismType::DhPkcsParameterGen
CKM_BATON_SHUFFLE
#define CKM_BATON_SHUFFLE
Definition: pkcs11t.h:885
CKR_BUFFER_TOO_SMALL
#define CKR_BUFFER_TOO_SMALL
Definition: pkcs11t.h:1137
Botan::PKCS11::MechanismType::AesCmacGeneral
CKR_USER_NOT_LOGGED_IN
#define CKR_USER_NOT_LOGGED_IN
Definition: pkcs11t.h:1117
CKA_PRIME
#define CKA_PRIME
Definition: pkcs11t.h:484
CKR_USER_ANOTHER_ALREADY_LOGGED_IN
#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN
Definition: pkcs11t.h:1121
CKM_DSA_PROBABLISTIC_PARAMETER_GEN
#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN
Definition: pkcs11t.h:960
CKR_FUNCTION_NOT_PARALLEL
#define CKR_FUNCTION_NOT_PARALLEL
Definition: pkcs11t.h:1066
CKK_SECURID
#define CKK_SECURID
Definition: pkcs11t.h:365
Botan::PKCS11::Flag::ExcludeCounter
CK_RV
CK_ULONG CK_RV
Definition: pkcs11t.h:1036
CKM_DES_ECB_ENCRYPT_DATA
#define CKM_DES_ECB_ENCRYPT_DATA
Definition: pkcs11t.h:937
Botan::PKCS11::AttributeType::Sensitive
Botan::PKCS11::AttributeType::Extractable
CKM_BATON_KEY_GEN
#define CKM_BATON_KEY_GEN
Definition: pkcs11t.h:880
CKM_TLS12_KEY_AND_MAC_DERIVE
#define CKM_TLS12_KEY_AND_MAC_DERIVE
Definition: pkcs11t.h:823
Botan::PKCS11::MechanismType::SkipjackOfb64
CKM_GOSTR3410_KEY_PAIR_GEN
#define CKM_GOSTR3410_KEY_PAIR_GEN
Definition: pkcs11t.h:944
CKM_RIPEMD128_HMAC
#define CKM_RIPEMD128_HMAC
Definition: pkcs11t.h:701
CKM_X9_42_DH_HYBRID_DERIVE
#define CKM_X9_42_DH_HYBRID_DERIVE
Definition: pkcs11t.h:618
Botan::PKCS11::MechanismType::Rc5KeyGen
CKM_JUNIPER_ECB128
#define CKM_JUNIPER_ECB128
Definition: pkcs11t.h:906
CKK_AES
#define CKK_AES
Definition: pkcs11t.h:362
CKF_DUAL_CRYPTO_OPERATIONS
#define CKF_DUAL_CRYPTO_OPERATIONS
Definition: pkcs11t.h:185
CKM_PBE_SHA1_CAST128_CBC
#define CKM_PBE_SHA1_CAST128_CBC
Definition: pkcs11t.h:799
Botan::PKCS11::MechanismType::Rc2MacGeneral
CKA_GOSTR3410_PARAMS
#define CKA_GOSTR3410_PARAMS
Definition: pkcs11t.h:535
CK_DATE
struct CK_DATE CK_DATE
Botan::PKCS11::KeyType::Rc2
CKM_DES3_ECB
#define CKM_DES3_ECB
Definition: pkcs11t.h:665
Botan::PKCS11::ReturnValue::FipsSelfTestFailed
CKM_GOSTR3411
#define CKM_GOSTR3411
Definition: pkcs11t.h:949
CKM_SECURID_KEY_GEN
#define CKM_SECURID_KEY_GEN
Definition: pkcs11t.h:719
CKM_ARIA_MAC
#define CKM_ARIA_MAC
Definition: pkcs11t.h:850
Botan::PKCS11::MechanismType::IdeaKeyGen
Botan::PKCS11::AttributeType::Issuer
Botan::PKCS11::KeyType::Dh
Botan::PKCS11::ReturnValue::SlotIdInvalid
Botan::PKCS11::AttributeType::DefaultCmsAttributes
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha512
CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE
#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE
Definition: pkcs11t.h:816
Botan::PKCS11::MechanismType::TwofishCbcPad
CKM_MD5_HMAC
#define CKM_MD5_HMAC
Definition: pkcs11t.h:692
CKM_CAST_CBC
#define CKM_CAST_CBC
Definition: pkcs11t.h:728
CKO_OTP_KEY
#define CKO_OTP_KEY
Definition: pkcs11t.h:318
Botan::PKCS11::MechanismType::BatonEcb96
CKN_OTP_CHANGED
#define CKN_OTP_CHANGED
Definition: pkcs11t.h:102
CKM_PBE_SHA1_CAST5_CBC
#define CKM_PBE_SHA1_CAST5_CBC
Definition: pkcs11t.h:798
Botan::PKCS11::MechanismType::Ripemd128RsaPkcs
CK_FALSE
#define CK_FALSE
Definition: pkcs11t.h:24
Botan::PKCS11::MechanismType::Ecdh1CofactorDerive
CKR_KEY_TYPE_INCONSISTENT
#define CKR_KEY_TYPE_INCONSISTENT
Definition: pkcs11t.h:1073
CKM_KIP_MAC
#define CKM_KIP_MAC
Definition: pkcs11t.h:835
Botan::PKCS11::Flag::ClockOnToken
CKO_PUBLIC_KEY
#define CKO_PUBLIC_KEY
Definition: pkcs11t.h:312
CKR_SLOT_ID_INVALID
#define CKR_SLOT_ID_INVALID
Definition: pkcs11t.h:1041
Botan::PKCS11::MechanismType::Cast5Ecb
CKR_CANT_LOCK
#define CKR_CANT_LOCK
Definition: pkcs11t.h:1049
Botan::PKCS11::Flag::Generate
CKM_SHA384_HMAC_GENERAL
#define CKM_SHA384_HMAC_GENERAL
Definition: pkcs11t.h:715
CKF_SO_PIN_LOCKED
#define CKF_SO_PIN_LOCKED
Definition: pkcs11t.h:239
Botan::PKCS11::Flag::SoPinToBeChanged
Botan::PKCS11::MechanismType::Cast128CbcPad
Botan::PKCS11::MechanismType::X942MqvDerive
Botan::PKCS11::Flag::SoPinLocked
Botan::PKCS11::LowLevel::C_InitToken
bool C_InitToken(SlotId slot_id, const std::vector< uint8_t, TAlloc > &so_pin, const std::string &label, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1148
CKK_JUNIPER
#define CKK_JUNIPER
Definition: pkcs11t.h:360
Botan::PKCS11::MechanismType::Des3CbcEncryptData
CKM_SHA512_KEY_DERIVATION
#define CKM_SHA512_KEY_DERIVATION
Definition: pkcs11t.h:789
Botan::PKCS11::ReturnValue::SavedStateInvalid
CKK_SKIPJACK
#define CKK_SKIPJACK
Definition: pkcs11t.h:358
Botan::PKCS11::AttributeType::RequiredCmsAttributes
Botan::PKCS11::MechanismType::DsaParameterGen
Botan::PKCS11::LowLevel::C_SetPIN
bool C_SetPIN(SessionHandle session, const std::vector< uint8_t, TAlloc > &old_pin, const std::vector< uint8_t, TAlloc > &new_pin, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1249
CK_USER_TYPE
CK_ULONG CK_USER_TYPE
Definition: pkcs11t.h:262
Botan::PKCS11::MGF::Mgf1Sha512
Botan::PKCS11::Flag::Sign
CKR_KEY_NOT_NEEDED
#define CKR_KEY_NOT_NEEDED
Definition: pkcs11t.h:1075
CK_MECHANISM
Definition: pkcs11t.h:983
Botan::PKCS11::AttributeType::MimeTypes
Botan::PKCS11::MechanismType::AesEcbEncryptData
CKM_IDEA_ECB
#define CKM_IDEA_ECB
Definition: pkcs11t.h:758
CKR_ATTRIBUTE_VALUE_INVALID
#define CKR_ATTRIBUTE_VALUE_INVALID
Definition: pkcs11t.h:1054
Botan::PKCS11::MechanismType::AesKeyGen
CKM_ECDSA_KEY_PAIR_GEN
#define CKM_ECDSA_KEY_PAIR_GEN
Definition: pkcs11t.h:888
CKM_TLS12_KEY_SAFE_DERIVE
#define CKM_TLS12_KEY_SAFE_DERIVE
Definition: pkcs11t.h:825
Botan::PKCS11::MechanismType::Des3KeyGen
CKC_VENDOR_DEFINED
#define CKC_VENDOR_DEFINED
Definition: pkcs11t.h:410
CKM_RC5_CBC
#define CKM_RC5_CBC
Definition: pkcs11t.h:753
CKR_SIGNATURE_LEN_RANGE
#define CKR_SIGNATURE_LEN_RANGE
Definition: pkcs11t.h:1107
Botan::PKCS11::MechanismType::Sha1HmacGeneral
CKM_ECDH1_DERIVE
#define CKM_ECDH1_DERIVE
Definition: pkcs11t.h:898
Botan::PKCS11::KeyDerivation::Sha512Kdf
Botan::PKCS11::MechanismType::CastMacGeneral
CKA_NAME_HASH_ALGORITHM
#define CKA_NAME_HASH_ALGORITHM
Definition: pkcs11t.h:456
CKM_DES_ECB
#define CKM_DES_ECB
Definition: pkcs11t.h:656
CKM_DES3_KEY_GEN
#define CKM_DES3_KEY_GEN
Definition: pkcs11t.h:664
Botan::PKCS11::ReturnValue::PinLocked
Botan::PKCS11::LowLevel::C_SetAttributeValue
bool C_SetAttributeValue(SessionHandle session, ObjectHandle object, std::map< AttributeType, std::vector< uint8_t, TAlloc >> &attribute_values, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1649
Botan::PKCS11::ReturnValue::SessionExists
Botan::PKCS11::Notification::Surrender
CKM_CAST3_CBC
#define CKM_CAST3_CBC
Definition: pkcs11t.h:734
Botan::PKCS11::AttributeType::OtpTime
Botan::PKCS11::MechanismType::Rc2KeyGen
Botan::PKCS11::KeyType::Baton
CKF_USER_PIN_LOCKED
#define CKF_USER_PIN_LOCKED
Definition: pkcs11t.h:216
CKR_KEY_SIZE_RANGE
#define CKR_KEY_SIZE_RANGE
Definition: pkcs11t.h:1072
Botan::PKCS11::AttributeType::Value
Botan::PKCS11::MechanismType::JuniperCounter
Botan::PKCS11::MechanismType::DhPkcsKeyPairGen
Botan::PKCS11::AttributeType::Destroyable
Botan::PKCS11::MechanismType::Sha384KeyDerivation
Botan::PKCS11::AttributeType::Base
CKM_AES_CTS
#define CKM_AES_CTS
Definition: pkcs11t.h:922
Botan::PKCS11::MechanismType::AesXcbcMac96
CKK_ECDSA
#define CKK_ECDSA
Definition: pkcs11t.h:342
Botan::PKCS11::ReturnValue::SessionReadOnlyExists
Botan::PKCS11::MGF::Mgf1Sha384
Botan::PKCS11::CertificateCategory::TokenUser
CKA_MECHANISM_TYPE
#define CKA_MECHANISM_TYPE
Definition: pkcs11t.h:553
CKM_AES_CFB8
#define CKM_AES_CFB8
Definition: pkcs11t.h:965
Botan::PKCS11::MechanismType::Sha512224Hmac
Botan::PKCS11::CertificateType::X509
CKM_MD5
#define CKM_MD5
Definition: pkcs11t.h:690
CKM_CAMELLIA_ECB
#define CKM_CAMELLIA_ECB
Definition: pkcs11t.h:838
Botan::PKCS11::MGF
MGF
Definition: p11.h:270
Botan::PKCS11::HardwareType::Clock
Botan::PKCS11::MechanismType::WtlsServerKeyAndMacDerive
CKM_EC_KEY_PAIR_GEN
#define CKM_EC_KEY_PAIR_GEN
Definition: pkcs11t.h:889
Botan::PKCS11::MechanismType::PbeSha1Cast128Cbc
Botan::PKCS11::MechanismType::Tls10MacClient
CKM_RC5_KEY_GEN
#define CKM_RC5_KEY_GEN
Definition: pkcs11t.h:751
Botan::PKCS11::MechanismType::JuniperEcb128
CKG_MGF1_SHA512
#define CKG_MGF1_SHA512
Definition: pkcs11t.h:1249
CKA_SUBPRIME_BITS
#define CKA_SUBPRIME_BITS
Definition: pkcs11t.h:489
Botan::PKCS11::MechanismType::Rc2Mac
CKA_DERIVE_TEMPLATE
#define CKA_DERIVE_TEMPLATE
Definition: pkcs11t.h:518
CKU_USER
#define CKU_USER
Definition: pkcs11t.h:266
Botan::PKCS11::MechanismType::Tls12MasterKeyDeriveDh
Botan::PKCS11::MechanismType::TlsKeyAndMacDerive
CKM_MD5_HMAC_GENERAL
#define CKM_MD5_HMAC_GENERAL
Definition: pkcs11t.h:693
CKR_CRYPTOKI_ALREADY_INITIALIZED
#define CKR_CRYPTOKI_ALREADY_INITIALIZED
Definition: pkcs11t.h:1143
Botan::PKCS11::AttributeType::HasReset
Botan::PKCS11::HardwareType
HardwareType
Definition: p11.h:279
Botan::PKCS11::ReturnValue::DeviceRemoved
Botan::PKCS11::AttributeType::BitsPerPixel
Botan::PKCS11::MechanismType::Rc5Mac
CKK_GOST28147
#define CKK_GOST28147
Definition: pkcs11t.h:383
CKF_USER_PIN_COUNT_LOW
#define CKF_USER_PIN_COUNT_LOW
Definition: pkcs11t.h:205
CKF_RW_SESSION
#define CKF_RW_SESSION
Definition: pkcs11t.h:289
CKM_GOST28147
#define CKM_GOST28147
Definition: pkcs11t.h:953
CKM_CONCATENATE_DATA_AND_BASE
#define CKM_CONCATENATE_DATA_AND_BASE
Definition: pkcs11t.h:766
CKF_SO_PIN_TO_BE_CHANGED
#define CKF_SO_PIN_TO_BE_CHANGED
Definition: pkcs11t.h:246
Botan::PKCS11::MechanismType::RsaPkcsOaepTpm11
Botan::PKCS11::AttributeType::KeyGenMechanism
Botan::PKCS11::MechanismType::Tls12KeyAndMacDerive
CKM_SKIPJACK_RELAYX
#define CKM_SKIPJACK_RELAYX
Definition: pkcs11t.h:875
Botan::PKCS11::MechanismType::CamelliaEcbEncryptData
CKM_WTLS_MASTER_KEY_DERIVE
#define CKM_WTLS_MASTER_KEY_DERIVE
Definition: pkcs11t.h:812
Botan::PKCS11::AttributeType::AllowedMechanisms
Botan::PKCS11::MechanismType::Des3EcbEncryptData
CKM_SHA512
#define CKM_SHA512
Definition: pkcs11t.h:716
CKM_JUNIPER_CBC128
#define CKM_JUNIPER_CBC128
Definition: pkcs11t.h:907
CKM_CAMELLIA_CTR
#define CKM_CAMELLIA_CTR
Definition: pkcs11t.h:845
Botan::PKCS11::Flag::ArrayAttribute
CKK_RIPEMD160_HMAC
#define CKK_RIPEMD160_HMAC
Definition: pkcs11t.h:374
Botan::PKCS11::MechanismType::Gostr3410WithGostr3411
CKM_SHA512_256
#define CKM_SHA512_256
Definition: pkcs11t.h:635
Botan::PKCS11::ReturnValue::EncryptedDataInvalid
CKR_NEED_TO_CREATE_THREADS
#define CKR_NEED_TO_CREATE_THREADS
Definition: pkcs11t.h:1048
CKA_PIXEL_Y
#define CKA_PIXEL_Y
Definition: pkcs11t.h:544
Botan::PKCS11::KeyType::GenericSecret
Botan::PKCS11::ReturnValue::DomainParamsInvalid
Botan::PKCS11::initialize_token
void initialize_token(Slot &slot, const std::string &label, const secure_string &so_pin, const secure_string &pin)
Definition: p11.cpp:46
Botan::PKCS11::LowLevel
Provides access to all PKCS#11 functions.
Definition: p11.h:901
Botan::PKCS11::False
const Bbool False
Definition: p11.h:856
CKM_GOSTR3410_DERIVE
#define CKM_GOSTR3410_DERIVE
Definition: pkcs11t.h:948
CKM_MD2_RSA_PKCS
#define CKM_MD2_RSA_PKCS
Definition: pkcs11t.h:591
CKM_RSA_PKCS_PSS
#define CKM_RSA_PKCS_PSS
Definition: pkcs11t.h:602
Botan
Definition: alg_id.cpp:13
Botan::PKCS11::ObjectHandle
CK_OBJECT_HANDLE ObjectHandle
Definition: p11.h:846
Botan::PKCS11::Flag::Digest
CK_SESSION_INFO
struct CK_SESSION_INFO CK_SESSION_INFO
Botan::PKCS11::AttributeType::Prime2
Botan::Dynamically_Loaded_Library
Definition: dyn_load.h:19
CKA_TOKEN
#define CKA_TOKEN
Definition: pkcs11t.h:438
CKM_CMS_SIG
#define CKM_CMS_SIG
Definition: pkcs11t.h:832
CKR_CRYPTOKI_NOT_INITIALIZED
#define CKR_CRYPTOKI_NOT_INITIALIZED
Definition: pkcs11t.h:1142
Botan::PKCS11::AttributeType::EcParams
CKF_VERIFY
#define CKF_VERIFY
Definition: pkcs11t.h:1011
CKR_WRAPPING_KEY_HANDLE_INVALID
#define CKR_WRAPPING_KEY_HANDLE_INVALID
Definition: pkcs11t.h:1126
Botan::PKCS11::KeyType::Sha224Hmac
Botan::PKCS11::AttributeType::Prime
CKK_RSA
#define CKK_RSA
Definition: pkcs11t.h:339
CKM_MD2_HMAC_GENERAL
#define CKM_MD2_HMAC_GENERAL
Definition: pkcs11t.h:688
CKM_SHA384_RSA_PKCS_PSS
#define CKM_SHA384_RSA_PKCS_PSS
Definition: pkcs11t.h:625
CKR_TOKEN_NOT_PRESENT
#define CKR_TOKEN_NOT_PRESENT
Definition: pkcs11t.h:1110
Botan::PKCS11::change_pin
void change_pin(Slot &slot, const secure_string &old_pin, const secure_string &new_pin)
Definition: p11.cpp:52
Botan::PKCS11::ReturnValue::FunctionCanceled
Botan::PKCS11::MechanismType::Sha384
CKF_SIGN_RECOVER
#define CKF_SIGN_RECOVER
Definition: pkcs11t.h:1010
Botan::PKCS11::MechanismType::AriaMac
CKM_DES_CBC_ENCRYPT_DATA
#define CKM_DES_CBC_ENCRYPT_DATA
Definition: pkcs11t.h:938
Botan::PKCS11::MechanismType::DsaSha1
Botan::PKCS11::Flag::RwSession
CKM_DES_KEY_GEN
#define CKM_DES_KEY_GEN
Definition: pkcs11t.h:655
Botan::PKCS11::Flag::EcFP
CKM_TLS_MASTER_KEY_DERIVE
#define CKM_TLS_MASTER_KEY_DERIVE
Definition: pkcs11t.h:775
Botan::PKCS11::AttributeType::ObjectId
Botan::PKCS11::MechanismType::CdmfCbc
CKK_RC4
#define CKK_RC4
Definition: pkcs11t.h:348
CKR_UNWRAPPING_KEY_HANDLE_INVALID
#define CKR_UNWRAPPING_KEY_HANDLE_INVALID
Definition: pkcs11t.h:1113
CKM_WTLS_PRF
#define CKM_WTLS_PRF
Definition: pkcs11t.h:814
Botan::PKCS11::AttributeType::OtpCounter
Botan::PKCS11::ObjectClass::Data
Botan::PKCS11::LockMutex
CK_LOCKMUTEX LockMutex
Definition: p11.h:830
CKM_AES_ECB
#define CKM_AES_ECB
Definition: pkcs11t.h:914
CKF_DECRYPT
#define CKF_DECRYPT
Definition: pkcs11t.h:1007
CKO_DATA
#define CKO_DATA
Definition: pkcs11t.h:310
CKM_CAST3_MAC
#define CKM_CAST3_MAC
Definition: pkcs11t.h:735
CKM_JUNIPER_SHUFFLE
#define CKM_JUNIPER_SHUFFLE
Definition: pkcs11t.h:909
Botan::PKCS11::MechanismType::Sha512256Hmac
Botan::PKCS11::AttributeType::EncodingMethods
CKR_FUNCTION_REJECTED
#define CKR_FUNCTION_REJECTED
Definition: pkcs11t.h:1156
Botan::PKCS11::ReturnValue::MechanismInvalid
CKA_GOSTR3411_PARAMS
#define CKA_GOSTR3411_PARAMS
Definition: pkcs11t.h:536
Botan::PKCS11::MechanismType::Md2KeyDerivation
CKM_RIPEMD160_HMAC
#define CKM_RIPEMD160_HMAC
Definition: pkcs11t.h:704
CK_FUNCTION_LIST_PTR
CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR
Definition: pkcs11t.h:1175
CKM_SKIPJACK_OFB64
#define CKM_SKIPJACK_OFB64
Definition: pkcs11t.h:868
CKO_MECHANISM
#define CKO_MECHANISM
Definition: pkcs11t.h:317
CKM_CAST_ECB
#define CKM_CAST_ECB
Definition: pkcs11t.h:727
CKA_APPLICATION
#define CKA_APPLICATION
Definition: pkcs11t.h:441
CKA_OTP_USER_FRIENDLY_MODE
#define CKA_OTP_USER_FRIENDLY_MODE
Definition: pkcs11t.h:523
Botan::PKCS11::KeyType::Acti
Botan::PKCS11::ReturnValue::ArgumentsBad
CKA_SUPPORTED_CMS_ATTRIBUTES
#define CKA_SUPPORTED_CMS_ATTRIBUTES
Definition: pkcs11t.h:556
Botan::PKCS11::HardwareType::MonotonicCounter
Botan::PKCS11::MechanismType::SkipjackRelayx
CKO_HW_FEATURE
#define CKO_HW_FEATURE
Definition: pkcs11t.h:315
CKF_SO_PIN_FINAL_TRY
#define CKF_SO_PIN_FINAL_TRY
Definition: pkcs11t.h:234
Botan::PKCS11::AttributeType::OtpFormat
CKF_DONT_BLOCK
#define CKF_DONT_BLOCK
Definition: pkcs11t.h:1234
CKK_DES3
#define CKK_DES3
Definition: pkcs11t.h:351
CK_UTF8CHAR
CK_BYTE CK_UTF8CHAR
Definition: pkcs11t.h:42
Botan::PKCS11::ReturnValue::UserAlreadyLoggedIn
CK_STATE
CK_ULONG CK_STATE
Definition: pkcs11t.h:271
Botan::PKCS11::MechanismType::Sha512TKeyDerivation
Botan::PKCS11::ReturnValue::FunctionNotParallel
CKP_PKCS5_PBKD2_HMAC_SHA224
#define CKP_PKCS5_PBKD2_HMAC_SHA224
Definition: pkcs11t.h:1721
Botan::PKCS11::MechanismType::Md5HmacGeneral
CKM_SKIPJACK_CBC64
#define CKM_SKIPJACK_CBC64
Definition: pkcs11t.h:867
Botan::PKCS11::PublicPointEncoding::Raw
CKK_TWOFISH
#define CKK_TWOFISH
Definition: pkcs11t.h:364
Botan::PKCS11::AttributeType::SignRecover
Botan::PKCS11::Flag::NextOtp
Botan::PKCS11::Flags
CK_FLAGS Flags
Definition: p11.h:832
Botan::PKCS11::MechanismType::SeedMacGeneral
Botan::PKCS11::MechanismType::KeyWrapSetOaep
CKM_RC5_MAC
#define CKM_RC5_MAC
Definition: pkcs11t.h:754
Botan::PKCS11::MechanismType::AesEcb
Botan::PKCS11::MechanismType::TlsPreMasterKeyGen
Botan::PKCS11::MechanismType::Sha512HmacGeneral
Botan::PKCS11::ReturnValue::OK
Botan::PKCS11::MechanismType::CastCbc
Botan::PKCS11::MechanismType::AesCcm
Botan::PKCS11::MechanismType::CdmfEcb
Botan::PKCS11::ReturnValue::WrappingKeyTypeInconsistent
CKO_VENDOR_DEFINED
#define CKO_VENDOR_DEFINED
Definition: pkcs11t.h:320
Botan::PKCS11::MechanismType::CamelliaEcb
Botan::PKCS11::MechanismType::Tls12Mac
CK_ECDH1_DERIVE_PARAMS
Definition: pkcs11t.h:1307
Botan::PKCS11::MechanismType::AriaEcb
Botan::PKCS11::Flag::SoPinCountLow
CKM_CAST5_CBC_PAD
#define CKM_CAST5_CBC_PAD
Definition: pkcs11t.h:749
CKR_TOKEN_NOT_RECOGNIZED
#define CKR_TOKEN_NOT_RECOGNIZED
Definition: pkcs11t.h:1111
Botan::PKCS11::MechanismType::SkipjackPrivateWrap
Botan::PKCS11::MechanismType::JuniperKeyGen
CKM_CAST5_MAC_GENERAL
#define CKM_CAST5_MAC_GENERAL
Definition: pkcs11t.h:747
CKA_URL
#define CKA_URL
Definition: pkcs11t.h:453
Botan::PKCS11::Flag::TokenInitialized
Botan::PKCS11::True
const Bbool True
Definition: p11.h:855
CKR_SESSION_PARALLEL_NOT_SUPPORTED
#define CKR_SESSION_PARALLEL_NOT_SUPPORTED
Definition: pkcs11t.h:1099
Botan::PKCS11::MechanismType::AesKeyWrap
Botan::PKCS11::AttributeType::Exponent1
Botan::PKCS11::MechanismType::KipDerive
Botan::PKCS11::MechanismType::BatonCounter
CKM_ECDH1_COFACTOR_DERIVE
#define CKM_ECDH1_COFACTOR_DERIVE
Definition: pkcs11t.h:899
Botan::PKCS11::KeyDerivation::Sha1KdfConcatenate
CK_FLAGS
CK_ULONG CK_FLAGS
Definition: pkcs11t.h:54
Botan::PKCS11::PKCS11_ReturnError
Definition: p11.h:2833
Botan::PKCS11::Flag::DontBlock
CKA_NEVER_EXTRACTABLE
#define CKA_NEVER_EXTRACTABLE
Definition: pkcs11t.h:496
Botan::PKCS11::MechanismType::AesMac
CKK_SHA_1_HMAC
#define CKK_SHA_1_HMAC
Definition: pkcs11t.h:372
Botan::PKCS11::LowLevel::C_GetAttributeValue
bool C_GetAttributeValue(SessionHandle session, ObjectHandle object, std::map< AttributeType, std::vector< uint8_t, TAlloc >> &attribute_values, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1574
Botan::PKCS11::ReturnValue::DataLenRange
Botan::PKCS11::MechanismType::DsaSha224
CKF_DIGEST
#define CKF_DIGEST
Definition: pkcs11t.h:1008
CKM_CDMF_KEY_GEN
#define CKM_CDMF_KEY_GEN
Definition: pkcs11t.h:673
Botan::PKCS11::MechanismType::Gost28147KeyGen
CKK_CAST5
#define CKK_CAST5
Definition: pkcs11t.h:354
CKA_CLASS
#define CKA_CLASS
Definition: pkcs11t.h:437
Botan::PKCS11::MechanismType::Gost28147Mac
CKM_CAMELLIA_CBC
#define CKM_CAMELLIA_CBC
Definition: pkcs11t.h:839
CKM_SHA224_HMAC_GENERAL
#define CKM_SHA224_HMAC_GENERAL
Definition: pkcs11t.h:712
Botan::PKCS11::AttributeType::Gostr3410Params
CKD_SHA256_KDF
#define CKD_SHA256_KDF
Definition: pkcs11t.h:1297
Botan::PKCS11::MechanismType::Des3CmacGeneral
Botan::PKCS11::ReturnValue::TokenNotRecognized
Botan::PKCS11::MechanismType::AesCfb64
CKA_AC_ISSUER
#define CKA_AC_ISSUER
Definition: pkcs11t.h:447
Botan::PKCS11::ReturnValue::StateUnsaveable
CKA_CHECK_VALUE
#define CKA_CHECK_VALUE
Definition: pkcs11t.h:457
Botan::PKCS11::AttributeType::UnwrapTemplate
CK_CERTIFICATE_TYPE
CK_ULONG CK_CERTIFICATE_TYPE
Definition: pkcs11t.h:393
Botan::PKCS11::AttributeType::Local
Botan::PKCS11::MechanismType::DsaSha256
CKG_MGF1_SHA224
#define CKG_MGF1_SHA224
Definition: pkcs11t.h:1250
Botan::PKCS11::MechanismType::CamelliaKeyGen
Botan::PKCS11::MechanismType::AesCmac
Botan::PKCS11::MechanismType::Sha1RsaPkcsPss
CKM_JUNIPER_WRAP
#define CKM_JUNIPER_WRAP
Definition: pkcs11t.h:910
Botan::PKCS11::MechanismType::AesMacGeneral
Botan::PKCS11::AttributeType::PrimeBits
CKM_SHA512_256_HMAC_GENERAL
#define CKM_SHA512_256_HMAC_GENERAL
Definition: pkcs11t.h:637
CKM_AES_KEY_WRAP_PAD
#define CKM_AES_KEY_WRAP_PAD
Definition: pkcs11t.h:970
Botan::PKCS11::MechanismType::RsaPkcsOaep
CKM_TLS12_MASTER_KEY_DERIVE_DH
#define CKM_TLS12_MASTER_KEY_DERIVE_DH
Definition: pkcs11t.h:824
CKM_CAST128_MAC
#define CKM_CAST128_MAC
Definition: pkcs11t.h:746
Botan::PKCS11::SlotId
CK_SLOT_ID SlotId
Definition: p11.h:835
Botan::PKCS11::MechanismType::SkipjackCfb8
Botan::PKCS11::MechanismType::BlowfishKeyGen
Botan::PKCS11::MechanismType::SeedMac
CKA_VERIFY_RECOVER
#define CKA_VERIFY_RECOVER
Definition: pkcs11t.h:470
Botan::PKCS11::ObjectClass::Certificate
CKA_RESET_ON_INIT
#define CKA_RESET_ON_INIT
Definition: pkcs11t.h:540
Botan::PKCS11::AttributeType::SubprimeBits
Botan::PKCS11::MechanismType::Des3MacGeneral
Botan::PKCS11::MechanismType::DesCbc
CKM_CAST_MAC
#define CKM_CAST_MAC
Definition: pkcs11t.h:729
CKM_DES3_MAC_GENERAL
#define CKM_DES3_MAC_GENERAL
Definition: pkcs11t.h:669
CKR_USER_TYPE_INVALID
#define CKR_USER_TYPE_INVALID
Definition: pkcs11t.h:1119
CKA_BASE
#define CKA_BASE
Definition: pkcs11t.h:486
Botan::PKCS11::LowLevel::C_VerifyUpdate
bool C_VerifyUpdate(SessionHandle session, std::vector< uint8_t, TAlloc > part, ReturnValue *return_value=ThrowException) const
Definition: p11.h:2410
CKM_PKCS5_PBKD2
#define CKM_PKCS5_PBKD2
Definition: pkcs11t.h:807
Botan::PKCS11::ObjectClass::OtpKey
Botan::PKCS11::Flag::HwSlot
CKA_OTP_TIME
#define CKA_OTP_TIME
Definition: pkcs11t.h:529
CKO_PRIVATE_KEY
#define CKO_PRIVATE_KEY
Definition: pkcs11t.h:313
CKA_VERIFY
#define CKA_VERIFY
Definition: pkcs11t.h:469
CKM_X9_42_DH_PARAMETER_GEN
#define CKM_X9_42_DH_PARAMETER_GEN
Definition: pkcs11t.h:959
CKF_ENCRYPT
#define CKF_ENCRYPT
Definition: pkcs11t.h:1006
CKH_VENDOR_DEFINED
#define CKH_VENDOR_DEFINED
Definition: pkcs11t.h:333
CKM_KIP_DERIVE
#define CKM_KIP_DERIVE
Definition: pkcs11t.h:833
CKM_AES_XCBC_MAC
#define CKM_AES_XCBC_MAC
Definition: pkcs11t.h:926
Botan::PKCS11::MechanismType::Ecdh1Derive
Botan::PKCS11::MechanismType::Sha256HmacGeneral
CKR_UNWRAPPING_KEY_SIZE_RANGE
#define CKR_UNWRAPPING_KEY_SIZE_RANGE
Definition: pkcs11t.h:1114
Botan::PKCS11::MechanismType::PbeMd5Cast3Cbc
CKR_SESSION_HANDLE_INVALID
#define CKR_SESSION_HANDLE_INVALID
Definition: pkcs11t.h:1098
Botan::PKCS11::Flag::EcF2m
CKM_RIPEMD160_HMAC_GENERAL
#define CKM_RIPEMD160_HMAC_GENERAL
Definition: pkcs11t.h:705
Botan::PKCS11::Flag::EcUncompress
CKA_BITS_PER_PIXEL
#define CKA_BITS_PER_PIXEL
Definition: pkcs11t.h:549
CKF_RNG
#define CKF_RNG
Definition: pkcs11t.h:155
Botan::to_string
std::string to_string(const secure_vector< uint8_t > &bytes)
Definition: stl_util.h:25
CKA_SUBPRIME
#define CKA_SUBPRIME
Definition: pkcs11t.h:485
CKR_USER_ALREADY_LOGGED_IN
#define CKR_USER_ALREADY_LOGGED_IN
Definition: pkcs11t.h:1116
Botan::PKCS11::MechanismType::Gostr3411Hmac
Botan::PKCS11::MechanismType::DesOfb8
CKM_SKIPJACK_ECB64
#define CKM_SKIPJACK_ECB64
Definition: pkcs11t.h:866
CKM_SSL3_KEY_AND_MAC_DERIVE
#define CKM_SSL3_KEY_AND_MAC_DERIVE
Definition: pkcs11t.h:771
Botan::PKCS11::MechanismType::Rc4KeyGen
Botan::PKCS11::KeyType::Camellia
Botan::PKCS11::LowLevel::C_Encrypt
bool C_Encrypt(SessionHandle session, const std::vector< uint8_t, TAllocA > &plaintext_data, std::vector< uint8_t, TAllocB > &encrypted_data, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1787
Botan::PKCS11::MechanismType::Sha224HmacGeneral
Botan::PKCS11::Flag::UserFriendlyOtp
Botan::PKCS11::MechanismType::PbeMd5CastCbc
Botan::PKCS11::MechanismType::X942DhDerive
Botan::PKCS11::MechanismType
MechanismType
Definition: p11.h:335
CKM_RC2_CBC_PAD
#define CKM_RC2_CBC_PAD
Definition: pkcs11t.h:651
CKM_ARIA_MAC_GENERAL
#define CKM_ARIA_MAC_GENERAL
Definition: pkcs11t.h:851
CKA_COLOR
#define CKA_COLOR
Definition: pkcs11t.h:548
Botan::PKCS11::AttributeType::Modifiable
Botan::PKCS11::MechanismType::SeedEcbEncryptData
CKM_EXTRACT_KEY_FROM_KEY
#define CKM_EXTRACT_KEY_FROM_KEY
Definition: pkcs11t.h:768
Botan::PKCS11::MGF::Mgf1Sha256
Botan::PKCS11::KeyType::Hotp
Botan::PKCS11::KeyType::Securid
CKR_PIN_LEN_RANGE
#define CKR_PIN_LEN_RANGE
Definition: pkcs11t.h:1091
CKC_X_509_ATTR_CERT
#define CKC_X_509_ATTR_CERT
Definition: pkcs11t.h:408
CKA_SIGN_RECOVER
#define CKA_SIGN_RECOVER
Definition: pkcs11t.h:468
Botan::PKCS11::ReturnValue::FunctionNotSupported
Botan::PKCS11::ReturnValue::KeyUnextractable
CKM_BATON_CBC128
#define CKM_BATON_CBC128
Definition: pkcs11t.h:883
CKM_RSA_PKCS_OAEP_TPM_1_1
#define CKM_RSA_PKCS_OAEP_TPM_1_1
Definition: pkcs11t.h:973
Botan::PKCS11::ReturnValue::TemplateIncomplete
Botan::PKCS11::MechanismType::BatonEcb128
Botan::PKCS11::MechanismType::EcdsaSha384
Botan::PKCS11::Flag::WriteProtected
CKA_DEFAULT_CMS_ATTRIBUTES
#define CKA_DEFAULT_CMS_ATTRIBUTES
Definition: pkcs11t.h:555
Botan::PKCS11::AttributeType::Trusted
CKO_DOMAIN_PARAMETERS
#define CKO_DOMAIN_PARAMETERS
Definition: pkcs11t.h:316
CKR_KEY_UNEXTRACTABLE
#define CKR_KEY_UNEXTRACTABLE
Definition: pkcs11t.h:1081
Botan::PKCS11::AttributeType::Encrypt
Botan::PKCS11::MechanismType::PbeMd5DesCbc
CKN_SURRENDER
#define CKN_SURRENDER
Definition: pkcs11t.h:101
Botan::PKCS11::AttributeType::OtpUserIdentifier
Botan::PKCS11::SessionState::RoUserFunctions
CKM_CAST3_ECB
#define CKM_CAST3_ECB
Definition: pkcs11t.h:733
Botan::PKCS11::ReturnValue::OperationActive
Botan::PKCS11::MechanismType::BatonWrap
Botan::PKCS11::MechanismType::PbeSha1Rc440
CKM_IDEA_MAC
#define CKM_IDEA_MAC
Definition: pkcs11t.h:760
Botan::PKCS11::MechanismType::DsaSha512
CKM_KEA_KEY_PAIR_GEN
#define CKM_KEA_KEY_PAIR_GEN
Definition: pkcs11t.h:876
Botan::PKCS11::MechanismType::IdeaCbcPad
Botan::PKCS11::MechanismType::AesCtr
CKM_GOST28147_KEY_WRAP
#define CKM_GOST28147_KEY_WRAP
Definition: pkcs11t.h:955
Botan::PKCS11::UserType
UserType
Definition: p11.h:812
Botan::Blowfish
Definition: blowfish.h:18
Botan::PKCS11::MechanismType::Ssl3PreMasterKeyGen
CKM_TLS_MAC
#define CKM_TLS_MAC
Definition: pkcs11t.h:826
Botan::PKCS11::MechanismType::Sha512256KeyDerivation
CKM_AES_CBC
#define CKM_AES_CBC
Definition: pkcs11t.h:915
Botan::PKCS11::MechanismType::Rc2CbcPad
CKR_SESSION_READ_ONLY_EXISTS
#define CKR_SESSION_READ_ONLY_EXISTS
Definition: pkcs11t.h:1103
Botan::PKCS11::AttributeType::Modulus
Botan::PKCS11::AttributeType::PixelY
Botan::PKCS11::KeyType::Ecdsa
Botan::PKCS11::MechanismType::WtlsMasterKeyDerive
CKM_DES_OFB8
#define CKM_DES_OFB8
Definition: pkcs11t.h:681
CK_SLOT_INFO
struct CK_SLOT_INFO CK_SLOT_INFO
CKK_BLOWFISH
#define CKK_BLOWFISH
Definition: pkcs11t.h:363
Botan::PKCS11::MechanismType::Md5KeyDerivation
CKR_WRAPPED_KEY_LEN_RANGE
#define CKR_WRAPPED_KEY_LEN_RANGE
Definition: pkcs11t.h:1125
Botan::PKCS11::KeyDerivation
KeyDerivation
Definition: p11.h:193
Botan::PKCS11::MechanismType::AesKeyWrapPad
CKF_SERIAL_SESSION
#define CKF_SERIAL_SESSION
Definition: pkcs11t.h:290
CKA_KEY_GEN_MECHANISM
#define CKA_KEY_GEN_MECHANISM
Definition: pkcs11t.h:498
Botan::PKCS11::ReturnValue::FunctionRejected
CK_ECDH1_DERIVE_PARAMS
struct CK_ECDH1_DERIVE_PARAMS CK_ECDH1_DERIVE_PARAMS
Botan::PKCS11::AttributeType::Prime1
Botan::PKCS11::AttributeType::CharSets
Botan::PKCS11::MechanismType::PbeSha1Des2EdeCbc
CK_VOID_PTR
void CK_PTR CK_VOID_PTR
Definition: pkcs11t.h:66
Botan::PKCS11::PKCS11_ReturnError::get_return_value
ReturnValue get_return_value() const
Definition: p11.h:2841
Botan::PKCS11::MechanismType::DsaSha384
Botan::PKCS11::MechanismType::Md5RsaPkcs
Botan::PKCS11::KeyDerivation::Sha256Kdf
CKR_MECHANISM_INVALID
#define CKR_MECHANISM_INVALID
Definition: pkcs11t.h:1083
CKM_PBE_MD2_DES_CBC
#define CKM_PBE_MD2_DES_CBC
Definition: pkcs11t.h:792
CKM_CDMF_ECB
#define CKM_CDMF_ECB
Definition: pkcs11t.h:674
CKM_SHA512_T
#define CKM_SHA512_T
Definition: pkcs11t.h:640
CKR_KEY_FUNCTION_NOT_PERMITTED
#define CKR_KEY_FUNCTION_NOT_PERMITTED
Definition: pkcs11t.h:1079
CKM_DSA_KEY_PAIR_GEN
#define CKM_DSA_KEY_PAIR_GEN
Definition: pkcs11t.h:605
CKK_SHA384_HMAC
#define CKK_SHA384_HMAC
Definition: pkcs11t.h:376
Botan::PKCS11::MechanismType::Ssl3Md5Mac
Botan::PKCS11::ReturnValue::LibraryLoadFailed
Botan::PKCS11::ReturnValue::TemplateInconsistent
CKF_USER_PIN_TO_BE_CHANGED
#define CKF_USER_PIN_TO_BE_CHANGED
Definition: pkcs11t.h:223
Botan::PKCS11::MechanismType::Ssl3MasterKeyDerive
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacGostr3411
CKR_VENDOR_DEFINED
#define CKR_VENDOR_DEFINED
Definition: pkcs11t.h:1158
CKA_DECRYPT
#define CKA_DECRYPT
Definition: pkcs11t.h:464
CKA_OTP_TIME_INTERVAL
#define CKA_OTP_TIME_INTERVAL
Definition: pkcs11t.h:522
CK_INFO
Definition: pkcs11t.h:86
CKM_ARIA_CBC_ENCRYPT_DATA
#define CKM_ARIA_CBC_ENCRYPT_DATA
Definition: pkcs11t.h:854
Botan::PKCS11::KeyType::Sha256Hmac
Botan::PKCS11::ReturnValue::GeneralError
CKP_PKCS5_PBKD2_HMAC_SHA512_256
#define CKP_PKCS5_PBKD2_HMAC_SHA512_256
Definition: pkcs11t.h:1726
Botan::PKCS11::KeyType::Md5Hmac
Botan::PKCS11::MechanismType::RsaPkcsTpm11
CKM_DES3_MAC
#define CKM_DES3_MAC
Definition: pkcs11t.h:667
CKK_DES
#define CKK_DES
Definition: pkcs11t.h:349
Botan::PKCS11::MechanismType::KipMac
CKR_SESSION_READ_ONLY
#define CKR_SESSION_READ_ONLY
Definition: pkcs11t.h:1100
CKK_CAST3
#define CKK_CAST3
Definition: pkcs11t.h:353
CKF_EXCLUDE_TIME
#define CKF_EXCLUDE_TIME
Definition: pkcs11t.h:1810
Botan::PKCS11::MechanismType::CamelliaMacGeneral
Botan::PKCS11::ObjectClass::PrivateKey
CKM_DSA_SHA1
#define CKM_DSA_SHA1
Definition: pkcs11t.h:607
Botan::PKCS11::ReturnValue::BufferTooSmall
CKM_GOST28147_MAC
#define CKM_GOST28147_MAC
Definition: pkcs11t.h:954
Botan::PKCS11::secure_string
secure_vector< uint8_t > secure_string
Definition: p11.h:61
CKR_MECHANISM_PARAM_INVALID
#define CKR_MECHANISM_PARAM_INVALID
Definition: pkcs11t.h:1084
CKM_WTLS_PRE_MASTER_KEY_GEN
#define CKM_WTLS_PRE_MASTER_KEY_GEN
Definition: pkcs11t.h:811
Botan::PKCS11::MechanismType::WtlsPreMasterKeyGen
Botan::PKCS11::AttributeType::Label
CKF_TOKEN_INITIALIZED
#define CKF_TOKEN_INITIALIZED
Definition: pkcs11t.h:193
CKK_SHA512_HMAC
#define CKK_SHA512_HMAC
Definition: pkcs11t.h:377
Botan::PKCS11::MechanismType::Sha256
CKM_GOSTR3411_HMAC
#define CKM_GOSTR3411_HMAC
Definition: pkcs11t.h:950
CKM_DES3_ECB_ENCRYPT_DATA
#define CKM_DES3_ECB_ENCRYPT_DATA
Definition: pkcs11t.h:939
Botan::PKCS11::AttributeType::AlwaysSensitive
CK_RSA_PKCS_MGF_TYPE
CK_ULONG CK_RSA_PKCS_MGF_TYPE
Definition: pkcs11t.h:1241
CKM_ECDH_AES_KEY_WRAP
#define CKM_ECDH_AES_KEY_WRAP
Definition: pkcs11t.h:902
Botan::PKCS11::MechanismType::IdeaMac
CKM_PBE_SHA1_RC4_128
#define CKM_PBE_SHA1_RC4_128
Definition: pkcs11t.h:800
CKA_EXPONENT_2
#define CKA_EXPONENT_2
Definition: pkcs11t.h:481
CKP_PKCS5_PBKD2_HMAC_SHA384
#define CKP_PKCS5_PBKD2_HMAC_SHA384
Definition: pkcs11t.h:1723
Botan::PKCS11::MechanismType::KipWrap
Botan::PKCS11::PKCS11_ReturnError::PKCS11_ReturnError
PKCS11_ReturnError(ReturnValue return_val)
Definition: p11.h:2836
CKM_SHA224_KEY_DERIVATION
#define CKM_SHA224_KEY_DERIVATION
Definition: pkcs11t.h:790
CKM_CAST3_MAC_GENERAL
#define CKM_CAST3_MAC_GENERAL
Definition: pkcs11t.h:736
Botan::PKCS11::MechanismType::Cast3MacGeneral
CKA_VALUE_BITS
#define CKA_VALUE_BITS
Definition: pkcs11t.h:492
CKK_DH
#define CKK_DH
Definition: pkcs11t.h:341
CKR_KEY_HANDLE_INVALID
#define CKR_KEY_HANDLE_INVALID
Definition: pkcs11t.h:1070
Botan::PKCS11::ReturnValue::UserAnotherAlreadyLoggedIn
Botan::PKCS11::KeyType::Skipjack
CKM_GOSTR3410_KEY_WRAP
#define CKM_GOSTR3410_KEY_WRAP
Definition: pkcs11t.h:947
CKM_AES_GMAC
#define CKM_AES_GMAC
Definition: pkcs11t.h:928
Botan::PKCS11::Flag::ExcludeTime
CKA_DESTROYABLE
#define CKA_DESTROYABLE
Definition: pkcs11t.h:503
Botan::PKCS11::MechanismType::TlsMasterKeyDerive
CK_MECHANISM_INFO
struct CK_MECHANISM_INFO CK_MECHANISM_INFO
CKM_RIPEMD160
#define CKM_RIPEMD160
Definition: pkcs11t.h:703
CKR_NEW_PIN_MODE
#define CKR_NEW_PIN_MODE
Definition: pkcs11t.h:1147
CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN
#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN
Definition: pkcs11t.h:961
Botan::PKCS11::Flag::Extension
CKA_HASH_OF_SUBJECT_PUBLIC_KEY
#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY
Definition: pkcs11t.h:454
Botan::PKCS11::MechanismType::Gostr3410Derive
CKM_CAST_CBC_PAD
#define CKM_CAST_CBC_PAD
Definition: pkcs11t.h:731
Botan::PKCS11::LowLevel::C_Decrypt
bool C_Decrypt(SessionHandle session, const std::vector< uint8_t, TAllocA > &encrypted_data, std::vector< uint8_t, TAllocB > &decrypted_data, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1914
CKS_RW_PUBLIC_SESSION
#define CKS_RW_PUBLIC_SESSION
Definition: pkcs11t.h:274
CKR_KEY_CHANGED
#define CKR_KEY_CHANGED
Definition: pkcs11t.h:1076
CKM_SHA512_256_HMAC
#define CKM_SHA512_256_HMAC
Definition: pkcs11t.h:636
Botan::PKCS11::MechanismType::AriaKeyGen
CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE
CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE
Definition: pkcs11t.h:1714
Botan::PKCS11::AttributeType::Unwrap
Botan::PKCS11::MechanismType::AesGmac
Botan::PKCS11::MechanismType::Sha1RsaPkcs
CKM_PBE_MD5_CAST3_CBC
#define CKM_PBE_MD5_CAST3_CBC
Definition: pkcs11t.h:795
Botan::PKCS11::AttributeType::Copyable
Botan::PKCS11::ReturnValue::DeviceMemory
CKM_SHA512_256_KEY_DERIVATION
#define CKM_SHA512_256_KEY_DERIVATION
Definition: pkcs11t.h:638
CKR_DOMAIN_PARAMS_INVALID
#define CKR_DOMAIN_PARAMS_INVALID
Definition: pkcs11t.h:1133
Botan::PKCS11::MechanismType::Gost28147KeyWrap
Botan::PKCS11::MechanismType::AesOfb
CKA_PRIME_2
#define CKA_PRIME_2
Definition: pkcs11t.h:479
CKM_SKIPJACK_PRIVATE_WRAP
#define CKM_SKIPJACK_PRIVATE_WRAP
Definition: pkcs11t.h:874
Botan::PKCS11::MGF::Mgf1Sha1
CKA_MODIFIABLE
#define CKA_MODIFIABLE
Definition: pkcs11t.h:500
Botan::PKCS11::MechanismType::Ripemd160RsaPkcs
CKM_RC4_KEY_GEN
#define CKM_RC4_KEY_GEN
Definition: pkcs11t.h:653
Botan::PKCS11::LowLevel::C_InitPIN
bool C_InitPIN(SessionHandle session, const std::vector< uint8_t, TAlloc > &pin, ReturnValue *return_value=ThrowException) const
Definition: p11.h:1200
CKM_ACTI
#define CKM_ACTI
Definition: pkcs11t.h:723
Botan::PKCS11::KeyType
KeyType
Definition: p11.h:287
Botan::PKCS11::MechanismType::Ssl3KeyAndMacDerive
CKM_SHA224_HMAC
#define CKM_SHA224_HMAC
Definition: pkcs11t.h:711
CKR_USER_PIN_NOT_INITIALIZED
#define CKR_USER_PIN_NOT_INITIALIZED
Definition: pkcs11t.h:1118
Botan::PKCS11::MechanismType::Tls12Kdf
CKM_SEED_KEY_GEN
#define CKM_SEED_KEY_GEN
Definition: pkcs11t.h:856
Botan::PKCS11::Flag::SerialSession
CKM_RSA_PKCS_OAEP
#define CKM_RSA_PKCS_OAEP
Definition: pkcs11t.h:597
Botan::PKCS11::MechanismType::Sha512256
Botan::PKCS11::ReturnValue::RandomSeedNotSupported
Botan::PKCS11::MechanismType::CdmfMacGeneral
Botan::PKCS11::MechanismType::Md2HmacGeneral
Botan::PKCS11::KeyType::Kea
Botan::PKCS11::MechanismType::Ripemd128HmacGeneral
CKM_SEED_ECB
#define CKM_SEED_ECB
Definition: pkcs11t.h:857
CKM_ARIA_KEY_GEN
#define CKM_ARIA_KEY_GEN
Definition: pkcs11t.h:847
Botan::PKCS11::Notification
Notification
Definition: p11.h:672
CKD_SHA1_KDF
#define CKD_SHA1_KDF
Definition: pkcs11t.h:1291
CKA_WRAP_TEMPLATE
#define CKA_WRAP_TEMPLATE
Definition: pkcs11t.h:516
Botan::PKCS11::ObjectClass::HwFeature
CKF_EXCLUDE_PIN
#define CKF_EXCLUDE_PIN
Definition: pkcs11t.h:1813
CKM_CAMELLIA_KEY_GEN
#define CKM_CAMELLIA_KEY_GEN
Definition: pkcs11t.h:837
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha1
Botan::PKCS11::MechanismType::Sha512224
CK_CERTIFICATE_CATEGORY_TOKEN_USER
#define CK_CERTIFICATE_CATEGORY_TOKEN_USER
Definition: pkcs11t.h:396
Botan::PKCS11::PublicPointEncoding
PublicPointEncoding
Definition: p11.h:819
CKM_SHA512_T_HMAC
#define CKM_SHA512_T_HMAC
Definition: pkcs11t.h:641
Botan::PKCS11::LowLevel::C_Verify
bool C_Verify(SessionHandle session, const std::vector< uint8_t, TAllocA > &data, std::vector< uint8_t, TAllocB > &signature, ReturnValue *return_value=ThrowException) const
Definition: p11.h:2367
CKD_SHA1_KDF_ASN1
#define CKD_SHA1_KDF_ASN1
Definition: pkcs11t.h:1294
Botan::PKCS11::MechanismType::AesCbcEncryptData
CKM_CAST5_MAC
#define CKM_CAST5_MAC
Definition: pkcs11t.h:745
CKS_RW_SO_FUNCTIONS
#define CKS_RW_SO_FUNCTIONS
Definition: pkcs11t.h:276
CKM_DH_PKCS_KEY_PAIR_GEN
#define CKM_DH_PKCS_KEY_PAIR_GEN
Definition: pkcs11t.h:613
CKM_CAST128_CBC_PAD
#define CKM_CAST128_CBC_PAD
Definition: pkcs11t.h:750
CKA_OTP_SERVICE_IDENTIFIER
#define CKA_OTP_SERVICE_IDENTIFIER
Definition: pkcs11t.h:531
CKA_AUTH_PIN_FLAGS
#define CKA_AUTH_PIN_FLAGS
Definition: pkcs11t.h:511
Botan::PKCS11::ReturnValue::ActionProhibited
CKK_DSA
#define CKK_DSA
Definition: pkcs11t.h:340
Botan::PKCS11::DestroyMutex
CK_DESTROYMUTEX DestroyMutex
Definition: p11.h:829
CK_ATTRIBUTE
struct CK_ATTRIBUTE CK_ATTRIBUTE
Botan::PKCS11::MechanismType::SkipjackCfb64
Botan::PKCS11::KeyType::Cdmf
Botan::PKCS11::MechanismType::Sha512224HmacGeneral
CKM_RIPEMD160_RSA_PKCS
#define CKM_RIPEMD160_RSA_PKCS
Definition: pkcs11t.h:596
Botan::PKCS11::ReturnValue::SessionReadOnly
Botan::PKCS11::MechanismType::Sha256RsaPkcs
CKR_SESSION_CLOSED
#define CKR_SESSION_CLOSED
Definition: pkcs11t.h:1096
CKA_PRIME_BITS
#define CKA_PRIME_BITS
Definition: pkcs11t.h:488
CKM_CAMELLIA_MAC
#define CKM_CAMELLIA_MAC
Definition: pkcs11t.h:840
CKR_ENCRYPTED_DATA_LEN_RANGE
#define CKR_ENCRYPTED_DATA_LEN_RANGE
Definition: pkcs11t.h:1064
Botan::PKCS11::MechanismType::WtlsMasterKeyDeriveDhEcc
Botan::PKCS11::KeyType::Rsa
Botan::PKCS11::LowLevel::C_SignFinal
bool C_SignFinal(SessionHandle session, std::vector< uint8_t, TAlloc > &signature, ReturnValue *return_value=ThrowException) const
Definition: p11.h:2240
pkcs11.h
Botan::PKCS11::AttributeType::NeverExtractable
CKM_RC5_ECB
#define CKM_RC5_ECB
Definition: pkcs11t.h:752
CKM_DSA
#define CKM_DSA
Definition: pkcs11t.h:606
Botan::PKCS11::MechanismType::SkipjackEcb64
Botan::PKCS11::MechanismType::Rc2Ecb
Botan::PKCS11::ReturnValue::SessionHandleInvalid
CKM_TWOFISH_CBC
#define CKM_TWOFISH_CBC
Definition: pkcs11t.h:933
CKF_EC_F_2M
#define CKF_EC_F_2M
Definition: pkcs11t.h:1023
Botan::PKCS11::AttributeType::HashOfSubjectPublicKey
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha256
CKA_START_DATE
#define CKA_START_DATE
Definition: pkcs11t.h:472
Botan::PKCS11::ReturnValue::PinLenRange
CKM_RSA_X9_31
#define CKM_RSA_X9_31
Definition: pkcs11t.h:600
Botan::PKCS11::Flag::GenerateKeyPair
Botan::PKCS11::ReturnValue::SessionCount
CKR_WRAPPED_KEY_INVALID
#define CKR_WRAPPED_KEY_INVALID
Definition: pkcs11t.h:1124
Botan::PKCS11::KeyType::X942Dh
Botan::PKCS11::MechanismType::TlsKdf
CKM_SHA224_RSA_PKCS_PSS
#define CKM_SHA224_RSA_PKCS_PSS
Definition: pkcs11t.h:629
CKM_SHA512_224_HMAC
#define CKM_SHA512_224_HMAC
Definition: pkcs11t.h:632
Botan::PKCS11::SessionState::RoPublicSession
CKM_SHA384
#define CKM_SHA384
Definition: pkcs11t.h:713
CKM_SKIPJACK_CFB16
#define CKM_SKIPJACK_CFB16
Definition: pkcs11t.h:871
CKM_DES2_KEY_GEN
#define CKM_DES2_KEY_GEN
Definition: pkcs11t.h:663
CK_C_INITIALIZE_ARGS
Definition: pkcs11t.h:1213
Botan::PKCS11::ReturnValue::InformationSensitive
Botan::PKCS11::AttributeType::PrivateExponent
Botan::PKCS11::UserType::SO
CKR_SESSION_COUNT
#define CKR_SESSION_COUNT
Definition: pkcs11t.h:1097
Botan::PKCS11::CertificateCategory
CertificateCategory
Definition: p11.h:185
Botan::PKCS11::MechanismType::DesCfb64
CKM_AES_CBC_ENCRYPT_DATA
#define CKM_AES_CBC_ENCRYPT_DATA
Definition: pkcs11t.h:942
CKA_OTP_CHALLENGE_REQUIREMENT
#define CKA_OTP_CHALLENGE_REQUIREMENT
Definition: pkcs11t.h:524
Botan::PKCS11::MechanismType::Des3Cbc
Botan::PKCS11::ReturnValue::WrappedKeyLenRange
CKM_SHA256_RSA_PKCS
#define CKM_SHA256_RSA_PKCS
Definition: pkcs11t.h:621
Botan::PKCS11::AttributeType::SubPrimeBits
CKK_RIPEMD128_HMAC
#define CKK_RIPEMD128_HMAC
Definition: pkcs11t.h:373
CKM_CDMF_MAC_GENERAL
#define CKM_CDMF_MAC_GENERAL
Definition: pkcs11t.h:677
Botan::PKCS11::MechanismType::Tls12KeySafeDerive
CKM_RSA_X9_31_KEY_PAIR_GEN
#define CKM_RSA_X9_31_KEY_PAIR_GEN
Definition: pkcs11t.h:599
Botan::PKCS11::Flag::ErrorState
CKM_MD2
#define CKM_MD2
Definition: pkcs11t.h:685
Botan::PKCS11::AttributeType::OtpTimeRequirement
Botan::PKCS11::AttributeType::Url
Botan::PKCS11::MechanismType::PbeMd5Cast5Cbc
Botan::PKCS11::ReturnValue::KeySizeRange
CKM_BLOWFISH_CBC
#define CKM_BLOWFISH_CBC
Definition: pkcs11t.h:931
CKM_DES_MAC
#define CKM_DES_MAC
Definition: pkcs11t.h:658
CKA_VALUE_LEN
#define CKA_VALUE_LEN
Definition: pkcs11t.h:493
CKM_ARIA_CBC_PAD
#define CKM_ARIA_CBC_PAD
Definition: pkcs11t.h:852
Botan::PKCS11::MechanismType::BlowfishCbcPad
Botan::PKCS11::ReturnValue::SessionClosed
Botan::PKCS11::AttributeType::DeriveTemplate
Botan::PKCS11::MechanismType::PbeMd5Cast128Cbc
CKF_ARRAY_ATTRIBUTE
#define CKF_ARRAY_ATTRIBUTE
Definition: pkcs11t.h:421
CK_DATE
Definition: pkcs11t.h:573
CKA_MODULUS_BITS
#define CKA_MODULUS_BITS
Definition: pkcs11t.h:475
CKM_SECURID
#define CKM_SECURID
Definition: pkcs11t.h:720
Botan::PKCS11::KeyType::Dsa
Botan::PKCS11::MechanismType::BatonKeyGen
Botan::PKCS11::MechanismType::KeaDerive
Botan::PKCS11::MechanismType::AriaCbcPad
CKM_ARIA_CBC
#define CKM_ARIA_CBC
Definition: pkcs11t.h:849
CKM_SEED_CBC_PAD
#define CKM_SEED_CBC_PAD
Definition: pkcs11t.h:861
CKM_RC2_MAC_GENERAL
#define CKM_RC2_MAC_GENERAL
Definition: pkcs11t.h:650
Botan::PKCS11::Flag::ExcludePin
CKM_X9_42_DH_DERIVE
#define CKM_X9_42_DH_DERIVE
Definition: pkcs11t.h:617
Botan::PKCS11::AttributeType::Id
Botan::PKCS11::MechanismType::Sha224
CKM_ECMQV_DERIVE
#define CKM_ECMQV_DERIVE
Definition: pkcs11t.h:900
Botan::PKCS11::ObjectClass::SecretKey
Botan::PKCS11::ReturnValue::OperationNotInitialized
CKK_IDEA
#define CKK_IDEA
Definition: pkcs11t.h:357
CKA_SUB_PRIME_BITS
#define CKA_SUB_PRIME_BITS
Definition: pkcs11t.h:490
Botan::PKCS11::MechanismType::SkipjackCbc64
CKM_SSL3_SHA1_MAC
#define CKM_SSL3_SHA1_MAC
Definition: pkcs11t.h:782
Botan::PKCS11::MechanismType::KeyWrapLynks
CKM_SHA256_KEY_DERIVATION
#define CKM_SHA256_KEY_DERIVATION
Definition: pkcs11t.h:787
CKM_DES_MAC_GENERAL
#define CKM_DES_MAC_GENERAL
Definition: pkcs11t.h:660
Botan::PKCS11::KeyType::Des2
Botan::PKCS11::MechanismType::Cast5Mac
CKK_GOSTR3411
#define CKK_GOSTR3411
Definition: pkcs11t.h:382
Botan::PKCS11::MechanismType::EcdsaKeyPairGen
CKM_X9_42_DH_KEY_PAIR_GEN
#define CKM_X9_42_DH_KEY_PAIR_GEN
Definition: pkcs11t.h:616
CKM_TLS_KEY_AND_MAC_DERIVE
#define CKM_TLS_KEY_AND_MAC_DERIVE
Definition: pkcs11t.h:776
CKF_EXCLUDE_CHALLENGE
#define CKF_EXCLUDE_CHALLENGE
Definition: pkcs11t.h:1812
CKM_DSA_SHA256
#define CKM_DSA_SHA256
Definition: pkcs11t.h:609
CKR_CURVE_NOT_SUPPORTED
#define CKR_CURVE_NOT_SUPPORTED
Definition: pkcs11t.h:1135
CKM_DH_PKCS_DERIVE
#define CKM_DH_PKCS_DERIVE
Definition: pkcs11t.h:614
Botan::PKCS11::AttributeType::StartDate
Botan::PKCS11::MechanismType::CamelliaMac
CKR_TEMPLATE_INCOMPLETE
#define CKR_TEMPLATE_INCOMPLETE
Definition: pkcs11t.h:1108
Botan::PKCS11::ReturnValue::TokenWriteProtected
CKM_TLS12_MASTER_KEY_DERIVE
#define CKM_TLS12_MASTER_KEY_DERIVE
Definition: pkcs11t.h:822
CKM_HOTP
#define CKM_HOTP
Definition: pkcs11t.h:722
CKR_SESSION_READ_WRITE_SO_EXISTS
#define CKR_SESSION_READ_WRITE_SO_EXISTS
Definition: pkcs11t.h:1104
Botan::PKCS11::MechanismType::SeedEcb
Botan::PKCS11::SessionState
SessionState
Definition: p11.h:704
CKM_PBE_MD5_CAST128_CBC
#define CKM_PBE_MD5_CAST128_CBC
Definition: pkcs11t.h:797
Botan::PKCS11::MechanismType::IdeaEcb
Botan::PKCS11::MechanismType::Gostr3410KeyWrap
CK_ATTRIBUTE
Definition: pkcs11t.h:564
CKA_UNWRAP
#define CKA_UNWRAP
Definition: pkcs11t.h:466
Botan::PKCS11::MechanismType::SkipjackCfb16
CKA_JAVA_MIDP_SECURITY_DOMAIN
#define CKA_JAVA_MIDP_SECURITY_DOMAIN
Definition: pkcs11t.h:452
Botan::PKCS11::MechanismType::WtlsClientKeyAndMacDerive
CKR_DATA_LEN_RANGE
#define CKR_DATA_LEN_RANGE
Definition: pkcs11t.h:1059
CKM_IDEA_MAC_GENERAL
#define CKM_IDEA_MAC_GENERAL
Definition: pkcs11t.h:761
CKM_BLOWFISH_CBC_PAD
#define CKM_BLOWFISH_CBC_PAD
Definition: pkcs11t.h:934
Botan::PKCS11::ReturnValue::PinExpired
Botan::PKCS11::MechanismType::WtlsPrf
Botan::PKCS11::KeyType::Cast128
Botan::PKCS11::MechanismType::AesXcbcMac
Botan::PKCS11::MechanismType::SeedCbc
Botan::PKCS11::Bbool
CK_BBOOL Bbool
Definition: p11.h:834
CKM_SHA_1_HMAC
#define CKM_SHA_1_HMAC
Definition: pkcs11t.h:697
Botan::PKCS11::Flag
Flag
Definition: p11.h:206
CKA_HASH_OF_ISSUER_PUBLIC_KEY
#define CKA_HASH_OF_ISSUER_PUBLIC_KEY
Definition: pkcs11t.h:455
CKR_OPERATION_NOT_INITIALIZED
#define CKR_OPERATION_NOT_INITIALIZED
Definition: pkcs11t.h:1088
CKM_SHA_1
#define CKM_SHA_1
Definition: pkcs11t.h:695
CKM_DSA_SHA384
#define CKM_DSA_SHA384
Definition: pkcs11t.h:610
CKF_USER_PIN_FINAL_TRY
#define CKF_USER_PIN_FINAL_TRY
Definition: pkcs11t.h:210
Botan::PKCS11::PseudoRandom::Pkcs5Pbkd2HmacSha224
Botan::PKCS11::Flag::RemovableDevice
Botan::PKCS11::ReturnValue::AttributeReadOnly
Botan::PKCS11::MechanismType::ExtractKeyFromKey
Botan::PKCS11::AttributeType::NameHashAlgorithm
Botan::PKCS11::MechanismType::EcdsaSha512
CKM_SSL3_MASTER_KEY_DERIVE_DH
#define CKM_SSL3_MASTER_KEY_DERIVE_DH
Definition: pkcs11t.h:773
Botan::PKCS11::MechanismType::Cast128MacGeneral
CKD_CPDIVERSIFY_KDF
#define CKD_CPDIVERSIFY_KDF
Definition: pkcs11t.h:1300
CKR_HOST_MEMORY
#define CKR_HOST_MEMORY
Definition: pkcs11t.h:1040
CKA_CERTIFICATE_TYPE
#define CKA_CERTIFICATE_TYPE
Definition: pkcs11t.h:444
CKK_BATON
#define CKK_BATON
Definition: pkcs11t.h:359
CKM_GOST28147_ECB
#define CKM_GOST28147_ECB
Definition: pkcs11t.h:952
Botan::PKCS11::Flag::EcEcparameters
CKA_RESOLUTION
#define CKA_RESOLUTION
Definition: pkcs11t.h:545
Botan::PKCS11::AttributeType::JavaMidpSecurityDomain
CKM_CAST128_KEY_GEN
#define CKM_CAST128_KEY_GEN
Definition: pkcs11t.h:740
CKM_CAST5_KEY_GEN
#define CKM_CAST5_KEY_GEN
Definition: pkcs11t.h:739
CKM_SKIPJACK_CFB64
#define CKM_SKIPJACK_CFB64
Definition: pkcs11t.h:869
Botan::PKCS11::MechanismType::X942DhParameterGen
CKM_SHA256_RSA_PKCS_PSS
#define CKM_SHA256_RSA_PKCS_PSS
Definition: pkcs11t.h:624
CKM_IDEA_CBC_PAD
#define CKM_IDEA_CBC_PAD
Definition: pkcs11t.h:762