8244154: Update SunPKCS11 provider with PKCS11 v3.0 header files

Reviewed-by: weijun
This commit is contained in:
Valerie Peng 2020-12-01 00:49:39 +00:00
parent 4356469a31
commit 7d8985243d
7 changed files with 1742 additions and 596 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -54,7 +54,7 @@ import java.util.*;
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
* This class contains onyl static methods. It is the place for all functions
* This class contains only static methods. It is the place for all functions
* that are used by several classes in this package.
*
* @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
@ -350,6 +350,12 @@ public class Functions {
private static final Flags mechanismInfoFlags = new Flags(new long[] {
CKF_HW,
CKF_MESSAGE_ENCRYPT,
CKF_MESSAGE_DECRYPT,
CKF_MESSAGE_SIGN,
CKF_MESSAGE_VERIFY,
CKF_MULTI_MESSAGE,
CKF_FIND_OBJECTS,
CKF_ENCRYPT,
CKF_DECRYPT,
CKF_DIGEST,
@ -365,12 +371,19 @@ public class Functions {
CKF_EC_F_P,
CKF_EC_F_2M,
CKF_EC_ECPARAMETERS,
CKF_EC_NAMEDCURVE,
CKF_EC_OID,
CKF_EC_UNCOMPRESS,
CKF_EC_COMPRESS,
CKF_EC_CURVENAME,
CKF_EXTENSION,
}, new String[] {
"CKF_HW",
"CKF_MESSAGE_ENCRYPT",
"CKF_MESSAGE_DECRYPT",
"CKF_MESSAGE_SIGN",
"CKF_MESSAGE_VERIFY",
"CKF_MULTI_MESSAGE",
"CKF_FIND_OBJECTS",
"CKF_ENCRYPT",
"CKF_DECRYPT",
"CKF_DIGEST",
@ -386,9 +399,10 @@ public class Functions {
"CKF_EC_F_P",
"CKF_EC_F_2M",
"CKF_EC_ECPARAMETERS",
"CKF_EC_NAMEDCURVE",
"CKF_EC_OID",
"CKF_EC_UNCOMPRESS",
"CKF_EC_COMPRESS",
"CKF_EC_CURVENAME",
"CKF_EXTENSION",
});
@ -624,6 +638,7 @@ public class Functions {
addMapping(mgfNames, mgfIds, id, name);
}
// The ordering here follows the PKCS11Constants class
static {
addMech(CKM_RSA_PKCS_KEY_PAIR_GEN, "CKM_RSA_PKCS_KEY_PAIR_GEN");
addMech(CKM_RSA_PKCS, "CKM_RSA_PKCS");
@ -647,6 +662,10 @@ public class Functions {
addMech(CKM_DSA_SHA256, "CKM_DSA_SHA256");
addMech(CKM_DSA_SHA384, "CKM_DSA_SHA384");
addMech(CKM_DSA_SHA512, "CKM_DSA_SHA512");
addMech(CKM_DSA_SHA3_224, "CKM_DSA_SHA3_224");
addMech(CKM_DSA_SHA3_256, "CKM_DSA_SHA3_256");
addMech(CKM_DSA_SHA3_384, "CKM_DSA_SHA3_384");
addMech(CKM_DSA_SHA3_512, "CKM_DSA_SHA3_512");
addMech(CKM_DH_PKCS_KEY_PAIR_GEN, "CKM_DH_PKCS_KEY_PAIR_GEN");
addMech(CKM_DH_PKCS_DERIVE, "CKM_DH_PKCS_DERIVE");
@ -664,6 +683,28 @@ public class Functions {
addMech(CKM_SHA224_RSA_PKCS, "CKM_SHA224_RSA_PKCS");
addMech(CKM_SHA224_RSA_PKCS_PSS, "CKM_SHA224_RSA_PKCS_PSS");
addMech(CKM_SHA512_224, "CKM_SHA512_224");
addMech(CKM_SHA512_224_HMAC, "CKM_SHA512_224_HMAC");
addMech(CKM_SHA512_224_HMAC_GENERAL, "CKM_SHA512_224_HMAC_GENERAL");
addMech(CKM_SHA512_224_KEY_DERIVATION, "CKM_SHA512_224_KEY_DERIVATION");
addMech(CKM_SHA512_256, "CKM_SHA512_256");
addMech(CKM_SHA512_256_HMAC, "CKM_SHA512_256_HMAC");
addMech(CKM_SHA512_256_HMAC_GENERAL, "CKM_SHA512_256_HMAC_GENERAL");
addMech(CKM_SHA512_256_KEY_DERIVATION, "CKM_SHA512_256_KEY_DERIVATION");
addMech(CKM_SHA512_T, "CKM_SHA512_T");
addMech(CKM_SHA512_T_HMAC, "CKM_SHA512_T_HMAC");
addMech(CKM_SHA512_T_HMAC_GENERAL, "CKM_SHA512_T_HMAC_GENERAL");
addMech(CKM_SHA512_T_KEY_DERIVATION, "CKM_SHA512_T_KEY_DERIVATION");
addMech(CKM_SHA3_256_RSA_PKCS, "CKM_SHA3_256_RSA_PKCS");
addMech(CKM_SHA3_384_RSA_PKCS, "CKM_SHA3_384_RSA_PKCS");
addMech(CKM_SHA3_512_RSA_PKCS, "CKM_SHA3_512_RSA_PKCS");
addMech(CKM_SHA3_256_RSA_PKCS_PSS, "CKM_SHA3_256_RSA_PKCS_PSS");
addMech(CKM_SHA3_384_RSA_PKCS_PSS, "CKM_SHA3_384_RSA_PKCS_PSS");
addMech(CKM_SHA3_512_RSA_PKCS_PSS, "CKM_SHA3_512_RSA_PKCS_PSS");
addMech(CKM_SHA3_224_RSA_PKCS, "CKM_SHA3_224_RSA_PKCS");
addMech(CKM_SHA3_224_RSA_PKCS_PSS, "CKM_SHA3_224_RSA_PKCS_PSS");
addMech(CKM_RC2_KEY_GEN, "CKM_RC2_KEY_GEN");
addMech(CKM_RC2_ECB, "CKM_RC2_ECB");
addMech(CKM_RC2_CBC, "CKM_RC2_CBC");
@ -715,30 +756,18 @@ public class Functions {
addMech(CKM_RIPEMD160, "CKM_RIPEMD160");
addMech(CKM_RIPEMD160_HMAC, "CKM_RIPEMD160_HMAC");
addMech(CKM_RIPEMD160_HMAC_GENERAL, "CKM_RIPEMD160_HMAC_GENERAL");
addMech(CKM_SHA224, "CKM_SHA224");
addMech(CKM_SHA224_HMAC, "CKM_SHA224_HMAC");
addMech(CKM_SHA224_HMAC_GENERAL, "CKM_SHA224_HMAC_GENERAL");
addMech(CKM_SHA256, "CKM_SHA256");
addMech(CKM_SHA256_HMAC, "CKM_SHA256_HMAC");
addMech(CKM_SHA256_HMAC_GENERAL, "CKM_SHA256_HMAC_GENERAL");
addMech(CKM_SHA224, "CKM_SHA224");
addMech(CKM_SHA224_HMAC, "CKM_SHA224_HMAC");
addMech(CKM_SHA224_HMAC_GENERAL, "CKM_SHA224_HMAC_GENERAL");
addMech(CKM_SHA384, "CKM_SHA384");
addMech(CKM_SHA384_HMAC, "CKM_SHA384_HMAC");
addMech(CKM_SHA384_HMAC_GENERAL, "CKM_SHA384_HMAC_GENERAL");
addMech(CKM_SHA512, "CKM_SHA512");
addMech(CKM_SHA512_HMAC, "CKM_SHA512_HMAC");
addMech(CKM_SHA512_HMAC_GENERAL, "CKM_SHA512_HMAC_GENERAL");
addMech(CKM_SHA512_224, "CKM_SHA512_224");
addMech(CKM_SHA512_224_HMAC, "CKM_SHA512_224_HMAC");
addMech(CKM_SHA512_224_HMAC_GENERAL, "CKM_SHA512_224_HMAC_GENERAL");
addMech(CKM_SHA512_224_KEY_DERIVATION, "CKM_SHA512_224_KEY_DERIVATION");
addMech(CKM_SHA512_256, "CKM_SHA512_256");
addMech(CKM_SHA512_256_HMAC, "CKM_SHA512_256_HMAC");
addMech(CKM_SHA512_256_HMAC_GENERAL, "CKM_SHA512_256_HMAC_GENERAL");
addMech(CKM_SHA512_256_KEY_DERIVATION, "CKM_SHA512_256_KEY_DERIVATION");
addMech(CKM_SHA512_T, "CKM_SHA512_T");
addMech(CKM_SHA512_T_HMAC, "CKM_SHA512_T_HMAC");
addMech(CKM_SHA512_T_HMAC_GENERAL, "CKM_SHA512_T_HMAC_GENERAL");
addMech(CKM_SHA512_T_KEY_DERIVATION, "CKM_SHA512_T_KEY_DERIVATION");
addMech(CKM_SECURID_KEY_GEN, "CKM_SECURID_KEY_GEN");
addMech(CKM_SECURID, "CKM_SECURID");
@ -747,6 +776,23 @@ public class Functions {
addMech(CKM_ACTI, "CKM_ACTI");
addMech(CKM_ACTI_KEY_GEN, "CKM_ACTI_KEY_GEN");
addMech(CKM_SHA3_256, "CKM_SHA3_256");
addMech(CKM_SHA3_256_HMAC, "CKM_SHA3_256_HMAC");
addMech(CKM_SHA3_256_HMAC_GENERAL, "CKM_SHA3_256_HMAC_GENERAL");
addMech(CKM_SHA3_256_KEY_GEN, "CKM_SHA3_256_KEY_GEN");
addMech(CKM_SHA3_224, "CKM_SHA3_224");
addMech(CKM_SHA3_224_HMAC, "CKM_SHA3_224_HMAC");
addMech(CKM_SHA3_224_HMAC_GENERAL, "CKM_SHA3_224_HMAC_GENERAL");
addMech(CKM_SHA3_224_KEY_GEN, "CKM_SHA3_224_KEY_GEN");
addMech(CKM_SHA3_384, "CKM_SHA3_384");
addMech(CKM_SHA3_384_HMAC, "CKM_SHA3_384_HMAC");
addMech(CKM_SHA3_384_HMAC_GENERAL, "CKM_SHA3_384_HMAC_GENERAL");
addMech(CKM_SHA3_384_KEY_GEN, "CKM_SHA3_384_KEY_GEN");
addMech(CKM_SHA3_512, "CKM_SHA3_512");
addMech(CKM_SHA3_512_HMAC, "CKM_SHA3_512_HMAC");
addMech(CKM_SHA3_512_HMAC_GENERAL, "CKM_SHA3_512_HMAC_GENERAL");
addMech(CKM_SHA3_512_KEY_GEN, "CKM_SHA3_512_KEY_GEN");
addMech(CKM_CAST_KEY_GEN, "CKM_CAST_KEY_GEN");
addMech(CKM_CAST_ECB, "CKM_CAST_ECB");
addMech(CKM_CAST_CBC, "CKM_CAST_CBC");
@ -798,10 +844,17 @@ public class Functions {
addMech(CKM_MD5_KEY_DERIVATION, "CKM_MD5_KEY_DERIVATION");
addMech(CKM_MD2_KEY_DERIVATION, "CKM_MD2_KEY_DERIVATION");
addMech(CKM_SHA1_KEY_DERIVATION, "CKM_SHA1_KEY_DERIVATION");
addMech(CKM_SHA224_KEY_DERIVATION, "CKM_SHA224_KEY_DERIVATION");
addMech(CKM_SHA256_KEY_DERIVATION, "CKM_SHA256_KEY_DERIVATION");
addMech(CKM_SHA384_KEY_DERIVATION, "CKM_SHA384_KEY_DERIVATION");
addMech(CKM_SHA512_KEY_DERIVATION, "CKM_SHA512_KEY_DERIVATION");
addMech(CKM_SHA224_KEY_DERIVATION, "CKM_SHA224_KEY_DERIVATION");
addMech(CKM_SHA3_256_KEY_DERIVATION, "CKM_SHA3_256_KEY_DERIVATION");
addMech(CKM_SHA3_224_KEY_DERIVATION, "CKM_SHA3_224_KEY_DERIVATION");
addMech(CKM_SHA3_384_KEY_DERIVATION, "CKM_SHA3_384_KEY_DERIVATION");
addMech(CKM_SHA3_512_KEY_DERIVATION, "CKM_SHA3_512_KEY_DERIVATION");
addMech(CKM_SHAKE_128_KEY_DERIVATION, "CKM_SHAKE_128_KEY_DERIVATION");
addMech(CKM_SHAKE_256_KEY_DERIVATION, "CKM_SHAKE_256_KEY_DERIVATION");
addMech(CKM_PBE_MD2_DES_CBC, "CKM_PBE_MD2_DES_CBC");
addMech(CKM_PBE_MD5_DES_CBC, "CKM_PBE_MD5_DES_CBC");
addMech(CKM_PBE_MD5_CAST_CBC, "CKM_PBE_MD5_CAST_CBC");
@ -894,18 +947,29 @@ public class Functions {
addMech(CKM_BATON_SHUFFLE, "CKM_BATON_SHUFFLE");
addMech(CKM_BATON_WRAP, "CKM_BATON_WRAP");
addMech(CKM_EC_KEY_PAIR_GEN, "CKM_EC_KEY_PAIR_GEN");
addMech(CKM_EC_KEY_PAIR_GEN_W_EXTRA_BITS,
"CKM_EC_KEY_PAIR_GEN_W_EXTRA_BITS");
addMech(CKM_ECDSA, "CKM_ECDSA");
addMech(CKM_ECDSA_SHA1, "CKM_ECDSA_SHA1");
addMech(CKM_ECDSA_SHA224, "CKM_ECDSA_SHA224");
addMech(CKM_ECDSA_SHA256, "CKM_ECDSA_SHA256");
addMech(CKM_ECDSA_SHA384, "CKM_ECDSA_SHA384");
addMech(CKM_ECDSA_SHA512, "CKM_ECDSA_SHA512");
addMech(CKM_ECDSA_SHA3_224, "CKM_ECDSA_SHA3_224");
addMech(CKM_ECDSA_SHA3_256, "CKM_ECDSA_SHA3_256");
addMech(CKM_ECDSA_SHA3_384, "CKM_ECDSA_SHA3_384");
addMech(CKM_ECDSA_SHA3_512, "CKM_ECDSA_SHA3_512");
addMech(CKM_ECDH1_DERIVE, "CKM_ECDH1_DERIVE");
addMech(CKM_ECDH1_COFACTOR_DERIVE, "CKM_ECDH1_COFACTOR_DERIVE");
addMech(CKM_ECMQV_DERIVE, "CKM_ECMQV_DERIVE");
addMech(CKM_ECDH_AES_KEY_WRAP, "CKM_ECDH_AES_KEY_WRAP");
addMech(CKM_RSA_AES_KEY_WRAP, "CKM_RSA_AES_KEY_WRAP");
addMech(CKM_EC_EDWARDS_KEY_PAIR_GEN, "CKM_EC_EDWARDS_KEY_PAIR_GEN");
addMech(CKM_EC_MONTGOMERY_KEY_PAIR_GEN,
"CKM_EC_MONTGOMERY_KEY_PAIR_GEN");
addMech(CKM_EDDSA, "CKM_EDDSA");
addMech(CKM_JUNIPER_KEY_GEN, "CKM_JUNIPER_KEY_GEN");
addMech(CKM_JUNIPER_ECB128, "CKM_JUNIPER_ECB128");
@ -914,6 +978,9 @@ public class Functions {
addMech(CKM_JUNIPER_SHUFFLE, "CKM_JUNIPER_SHUFFLE");
addMech(CKM_JUNIPER_WRAP, "CKM_JUNIPER_WRAP");
addMech(CKM_FASTHASH, "CKM_FASTHASH");
addMech(CKM_AES_XTS, "CKM_AES_XTS");
addMech(CKM_AES_XTS_KEY_GEN, "CKM_AES_XTS_KEY_GEN");
addMech(CKM_AES_KEY_GEN, "CKM_AES_KEY_GEN");
addMech(CKM_AES_ECB, "CKM_AES_ECB");
addMech(CKM_AES_CBC, "CKM_AES_CBC");
@ -956,6 +1023,10 @@ public class Functions {
addMech(CKM_GOST28147, "CKM_GOST28147");
addMech(CKM_GOST28147_MAC, "CKM_GOST28147_MAC");
addMech(CKM_GOST28147_KEY_WRAP, "CKM_GOST28147_KEY_WRAP");
addMech(CKM_CHACHA20_KEY_GEN, "CKM_CHACHA20_KEY_GEN");
addMech(CKM_CHACHA20, "CKM_CHACHA20");
addMech(CKM_POLY1305_KEY_GEN, "CKM_POLY1305_KEY_GEN");
addMech(CKM_POLY1305, "CKM_POLY1305");
addMech(CKM_DSA_PARAMETER_GEN, "CKM_DSA_PARAMETER_GEN");
addMech(CKM_DH_PKCS_PARAMETER_GEN, "CKM_DH_PKCS_PARAMETER_GEN");
@ -964,6 +1035,8 @@ public class Functions {
"CKM_DSA_PROBABLISTIC_PARAMETER_GEN");
addMech(CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN,
"CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN");
addMech(CKM_DSA_FIPS_G_GEN, "CKM_DSA_FIPS_G_GEN");
addMech(CKM_AES_OFB, "CKM_AES_OFB");
addMech(CKM_AES_CFB64, "CKM_AES_CFB64");
addMech(CKM_AES_CFB8, "CKM_AES_CFB8");
@ -971,9 +1044,56 @@ public class Functions {
addMech(CKM_AES_CFB1, "CKM_AES_CFB1");
addMech(CKM_AES_KEY_WRAP, "CKM_AES_KEY_WRAP");
addMech(CKM_AES_KEY_WRAP_PAD, "CKM_AES_KEY_WRAP_PAD");
addMech(CKM_AES_KEY_WRAP_KWP, "CKM_AES_KEY_WRAP_KWP");
addMech(CKM_RSA_PKCS_TPM_1_1, "CKM_RSA_PKCS_TPM_1_1");
addMech(CKM_RSA_PKCS_OAEP_TPM_1_1, "CKM_RSA_PKCS_OAEP_TPM_1_1");
addMech(CKM_SHA_1_KEY_GEN, "CKM_SHA_1_KEY_GEN");
addMech(CKM_SHA224_KEY_GEN, "CKM_SHA224_KEY_GEN");
addMech(CKM_SHA256_KEY_GEN, "CKM_SHA256_KEY_GEN");
addMech(CKM_SHA384_KEY_GEN, "CKM_SHA384_KEY_GEN");
addMech(CKM_SHA512_KEY_GEN, "CKM_SHA512_KEY_GEN");
addMech(CKM_SHA512_224_KEY_GEN, "CKM_SHA512_224_KEY_GEN");
addMech(CKM_SHA512_256_KEY_GEN, "CKM_SHA512_256_KEY_GEN");
addMech(CKM_SHA512_T_KEY_GEN, "CKM_SHA512_T_KEY_GEN");
addMech(CKM_NULL, "CKM_NULL");
addMech(CKM_BLAKE2B_160, "CKM_BLAKE2B_160");
addMech(CKM_BLAKE2B_160_HMAC, "CKM_BLAKE2B_160_HMAC");
addMech(CKM_BLAKE2B_160_HMAC_GENERAL, "CKM_BLAKE2B_160_HMAC_GENERAL");
addMech(CKM_BLAKE2B_160_KEY_DERIVE, "CKM_BLAKE2B_160_KEY_DERIVE");
addMech(CKM_BLAKE2B_160_KEY_GEN, "CKM_BLAKE2B_160_KEY_GEN");
addMech(CKM_BLAKE2B_256, "CKM_BLAKE2B_256");
addMech(CKM_BLAKE2B_256_HMAC, "CKM_BLAKE2B_256_HMAC");
addMech(CKM_BLAKE2B_256_HMAC_GENERAL, "CKM_BLAKE2B_256_HMAC_GENERAL");
addMech(CKM_BLAKE2B_256_KEY_DERIVE, "CKM_BLAKE2B_256_KEY_DERIVE");
addMech(CKM_BLAKE2B_256_KEY_GEN, "CKM_BLAKE2B_256_KEY_GEN");
addMech(CKM_BLAKE2B_384, "CKM_BLAKE2B_384");
addMech(CKM_BLAKE2B_384_HMAC, "CKM_BLAKE2B_384_HMAC");
addMech(CKM_BLAKE2B_384_HMAC_GENERAL, "CKM_BLAKE2B_384_HMAC_GENERAL");
addMech(CKM_BLAKE2B_384_KEY_DERIVE, "CKM_BLAKE2B_384_KEY_DERIVE");
addMech(CKM_BLAKE2B_384_KEY_GEN, "CKM_BLAKE2B_384_KEY_GEN");
addMech(CKM_BLAKE2B_512, "CKM_BLAKE2B_512");
addMech(CKM_BLAKE2B_512_HMAC, "CKM_BLAKE2B_512_HMAC");
addMech(CKM_BLAKE2B_512_HMAC_GENERAL, "CKM_BLAKE2B_512_HMAC_GENERAL");
addMech(CKM_BLAKE2B_512_KEY_DERIVE, "CKM_BLAKE2B_512_KEY_DERIVE");
addMech(CKM_BLAKE2B_512_KEY_GEN, "CKM_BLAKE2B_512_KEY_GEN");
addMech(CKM_SALSA20, "CKM_SALSA20");
addMech(CKM_CHACHA20_POLY1305, "CKM_CHACHA20_POLY1305");
addMech(CKM_SALSA20_POLY1305, "CKM_SALSA20_POLY1305");
addMech(CKM_X3DH_INITIALIZE, "CKM_X3DH_INITIALIZE");
addMech(CKM_X3DH_RESPOND, "CKM_X3DH_RESPOND");
addMech(CKM_X2RATCHET_INITIALIZE, "CKM_X2RATCHET_INITIALIZE");
addMech(CKM_X2RATCHET_RESPOND, "CKM_X2RATCHET_RESPOND");
addMech(CKM_X2RATCHET_ENCRYPT, "CKM_X2RATCHET_ENCRYPT");
addMech(CKM_X2RATCHET_DECRYPT, "CKM_X2RATCHET_DECRYPT");
addMech(CKM_XEDDSA, "CKM_XEDDSA");
addMech(CKM_HKDF_DERIVE, "CKM_HKDF_DERIVE");
addMech(CKM_HKDF_DATA, "CKM_HKDF_DATA");
addMech(CKM_HKDF_KEY_GEN, "CKM_HKDF_KEY_GEN");
addMech(CKM_SALSA20_KEY_GEN, "CKM_SALSA20_KEY_GEN");
addMech(CKM_SP800_108_COUNTER_KDF, "CKM_SP800_108_COUNTER_KDF");
addMech(CKM_SP800_108_FEEDBACK_KDF, "CKM_SP800_108_FEEDBACK_KDF");
addMech(CKM_SP800_108_DOUBLE_PIPELINE_KDF,
"CKM_SP800_108_DOUBLE_PIPELINE_KDF");
addMech(CKM_VENDOR_DEFINED, "CKM_VENDOR_DEFINED");
@ -989,6 +1109,10 @@ public class Functions {
addHashMech(CKM_SHA512, "SHA-512", "SHA512");
addHashMech(CKM_SHA512_224, "SHA-512/224", "SHA512/224");
addHashMech(CKM_SHA512_256, "SHA-512/256", "SHA512/256");
addHashMech(CKM_SHA3_224, "SHA3-224");
addHashMech(CKM_SHA3_256, "SHA3-256");
addHashMech(CKM_SHA3_384, "SHA3-384");
addHashMech(CKM_SHA3_512, "SHA3-512");
addKeyType(CKK_RSA, "CKK_RSA");
addKeyType(CKK_DSA, "CKK_DSA");
@ -1031,6 +1155,27 @@ public class Functions {
addKeyType(CKK_GOSTR3410, "CKK_GOSTR3410");
addKeyType(CKK_GOSTR3411, "CKK_GOSTR3411");
addKeyType(CKK_GOST28147, "CKK_GOST28147");
addKeyType(CKK_CHACHA20, "CKK_CHACHA20");
addKeyType(CKK_POLY1305, "CKK_POLY1305");
addKeyType(CKK_AES_XTS, "CKK_AES_XTS");
addKeyType(CKK_SHA3_224_HMAC, "CKK_SHA3_224_HMAC");
addKeyType(CKK_SHA3_256_HMAC, "CKK_SHA3_256_HMAC");
addKeyType(CKK_SHA3_384_HMAC, "CKK_SHA3_384_HMAC");
addKeyType(CKK_SHA3_512_HMAC, "CKK_SHA3_512_HMAC");
addKeyType(CKK_BLAKE2B_160_HMAC, "CKK_BLAKE2B_160_HMAC");
addKeyType(CKK_BLAKE2B_256_HMAC, "CKK_BLAKE2B_256_HMAC");
addKeyType(CKK_BLAKE2B_384_HMAC, "CKK_BLAKE2B_384_HMAC");
addKeyType(CKK_BLAKE2B_512_HMAC, "CKK_BLAKE2B_512_HMAC");
addKeyType(CKK_SALSA20, "CKK_SALSA20");
addKeyType(CKK_X2RATCHET, "CKK_X2RATCHET");
addKeyType(CKK_EC_EDWARDS, "CKK_EC_EDWARDS");
addKeyType(CKK_EC_MONTGOMERY, "CKK_EC_MONTGOMERY");
addKeyType(CKK_HKDF, "CKK_HKDF");
addKeyType(CKK_SHA512_224_HMAC, "CKK_SHA512_224_HMAC");
addKeyType(CKK_SHA512_256_HMAC, "CKK_SHA512_256_HMAC");
addKeyType(CKK_SHA512_T_HMAC, "CKK_SHA512_T_HMAC");
addKeyType(CKK_VENDOR_DEFINED, "CKK_VENDOR_DEFINED");
@ -1040,6 +1185,7 @@ public class Functions {
addAttribute(CKA_TOKEN, "CKA_TOKEN");
addAttribute(CKA_PRIVATE, "CKA_PRIVATE");
addAttribute(CKA_LABEL, "CKA_LABEL");
addAttribute(CKA_UNIQUE_ID, "CKA_UNIQUE_ID");
addAttribute(CKA_APPLICATION, "CKA_APPLICATION");
addAttribute(CKA_VALUE, "CKA_VALUE");
addAttribute(CKA_OBJECT_ID, "CKA_OBJECT_ID");
@ -1154,6 +1300,24 @@ public class Functions {
addAttribute(CKA_SUPPORTED_CMS_ATTRIBUTES,
"CKA_SUPPORTED_CMS_ATTRIBUTES");
addAttribute(CKA_ALLOWED_MECHANISMS, "CKA_ALLOWED_MECHANISMS");
addAttribute(CKA_PROFILE_ID, "CKA_PROFILE_ID");
addAttribute(CKA_X2RATCHET_BAG, "CKA_X2RATCHET_BAG");
addAttribute(CKA_X2RATCHET_BAGSIZE, "CKA_X2RATCHET_BAGSIZE");
addAttribute(CKA_X2RATCHET_BOBS1STMSG, "CKA_X2RATCHET_BOBS1STMSG");
addAttribute(CKA_X2RATCHET_CKR, "CKA_X2RATCHET_CKR");
addAttribute(CKA_X2RATCHET_CKS, "CKA_X2RATCHET_CKS");
addAttribute(CKA_X2RATCHET_DHP, "CKA_X2RATCHET_DHP");
addAttribute(CKA_X2RATCHET_DHR, "CKA_X2RATCHET_DHR");
addAttribute(CKA_X2RATCHET_DHS, "CKA_X2RATCHET_DHS");
addAttribute(CKA_X2RATCHET_HKR, "CKA_X2RATCHET_HKR");
addAttribute(CKA_X2RATCHET_HKS, "CKA_X2RATCHET_HKS");
addAttribute(CKA_X2RATCHET_ISALICE, "CKA_X2RATCHET_ISALICE");
addAttribute(CKA_X2RATCHET_NHKR, "CKA_X2RATCHET_NHKR");
addAttribute(CKA_X2RATCHET_NHKS, "CKA_X2RATCHET_NHKS");
addAttribute(CKA_X2RATCHET_NR, "CKA_X2RATCHET_NR");
addAttribute(CKA_X2RATCHET_NS, "CKA_X2RATCHET_NS");
addAttribute(CKA_X2RATCHET_PNS, "CKA_X2RATCHET_PNS");
addAttribute(CKA_X2RATCHET_RK, "CKA_X2RATCHET_RK");
addAttribute(CKA_VENDOR_DEFINED, "CKA_VENDOR_DEFINED");
addAttribute(CKA_NETSCAPE_DB, "CKA_NETSCAPE_DB");
@ -1172,6 +1336,9 @@ public class Functions {
addObjectClass(CKO_SECRET_KEY, "CKO_SECRET_KEY");
addObjectClass(CKO_HW_FEATURE, "CKO_HW_FEATURE");
addObjectClass(CKO_DOMAIN_PARAMETERS, "CKO_DOMAIN_PARAMETERS");
addObjectClass(CKO_MECHANISM, "CKO_MECHANISM");
addObjectClass(CKO_OTP_KEY, "CKO_OTP_KEY");
addObjectClass(CKO_PROFILE, "CKO_PROFILE");
addObjectClass(CKO_VENDOR_DEFINED, "CKO_VENDOR_DEFINED");
addObjectClass(PCKO_ANY, "*");
@ -1181,6 +1348,10 @@ public class Functions {
addMGF(CKG_MGF1_SHA384, "CKG_MGF1_SHA384");
addMGF(CKG_MGF1_SHA512, "CKG_MGF1_SHA512");
addMGF(CKG_MGF1_SHA224, "CKG_MGF1_SHA224");
addMGF(CKG_MGF1_SHA3_224, "CKG_MGF1_SHA3_224");
addMGF(CKG_MGF1_SHA3_256, "CKG_MGF1_SHA3_256");
addMGF(CKG_MGF1_SHA3_384, "CKG_MGF1_SHA3_384");
addMGF(CKG_MGF1_SHA3_512, "CKG_MGF1_SHA3_512");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -48,7 +48,7 @@
package sun.security.pkcs11.wrapper;
/**
* This interface holds constants of the PKCS#11 v2.11 standard.
* This interface holds constants of the PKCS#11 v3.00 standard.
* This is mainly the content of the 'pkcs11t.h' header file.
*
* Mapping of primitiv data types to Java types:
@ -62,11 +62,15 @@ package sun.security.pkcs11.wrapper;
* CK_ULONG ...................................... long
* CK_LONG ....................................... long
* CK_FLAGS ...................................... long
* CK_BYTE_PTR ................................... byte[]
* CK_CHAR_PTR ................................... char[]
* CK_UTF8CHAR_PTR ............................... char[]
* CK_ULONG_PTR .................................. long[]
* CK_VOID_PTR ................................... Object[]
* CK_NOTIFICATION ............................... long
* CK_SLOT_ID .................................... long
* CK_SESSION_HANDLE ............................. long
* CK_USER_TYPE .................................. long
* CK_SESSION_HANDLE ............................. long
* CK_STATE ...................................... long
* CK_OBJECT_HANDLE .............................. long
* CK_OBJECT_CLASS ............................... long
@ -74,21 +78,27 @@ package sun.security.pkcs11.wrapper;
* CK_KEY_TYPE ................................... long
* CK_CERTIFICATE_TYPE ........................... long
* CK_ATTRIBUTE_TYPE ............................. long
* CK_VOID_PTR ................................... Object[]
* CK_BYTE_PTR ................................... byte[]
* CK_CHAR_PTR ................................... char[]
* CK_UTF8CHAR_PTR ............................... char[]
* CK_MECHANISM_TYPE ............................. long
* CK_RV ......................................... long
* CK_RSA_PKCS_OAEP_MGF_TYPE ..................... long
* CK_RSA_PKCS_MGF_TYPE .......................... long
* CK_RSA_PKCS_OAEP_SOURCE_TYPE .................. long
* CK_EC_KDF_TYPE ................................ long
* CK_X9_42_DH_KDF_TYPE .......................... long
* CK_RC2_PARAMS ................................. long
* CK_MAC_GENERAL_PARAMS ......................... long
* CK_EXTRACT_PARAMS ............................. long
* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE .... long
* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE .............. long
* CK_EC_KDF_TYPE ................................ long
* CK_X9_42_DH_KDF_TYPE .......................... long
* CK_OTP_PARAM_TYPE / CK_PARAM_TYPE ............. long
* CK_GENERATOR_FUNCTION ......................... long
* CK_JAVA_MIDP_SECURITY_DOMAIN .................. long
* CK_CERTIFICATE_CATEGORY ....................... long
* CK_PROFILE_ID ................................. long
* CK_PRF_DATA_TYPE .............................. long
* CK_SP800_108_DKM_LENGTH_METHOD ................ long
* CK_X3DH_KDF_TYPE .............................. long
* CK_X2RATCHET_KDF_TYPE ......................... long
* CK_XEDDSA_HASH_TYPE ........................... long
* </pre>
*
* @author <a href="mailto:Karl.Scheibelhofer@iaik.at"> Karl Scheibelhofer </a>
@ -201,16 +211,30 @@ public interface PKCS11Constants {
public static final long CKO_SECRET_KEY = 0x00000004L;
public static final long CKO_HW_FEATURE = 0x00000005L;
public static final long CKO_DOMAIN_PARAMETERS = 0x00000006L;
public static final long CKO_MECHANISM = 0x00000007L;
public static final long CKO_OTP_KEY = 0x00000008L;
public static final long CKO_PROFILE = 0x00000009L;
public static final long CKO_VENDOR_DEFINED = 0x80000000L;
// pseudo object class ANY (for template manager)
public static final long PCKO_ANY = 0x7FFFFF23L;
/* Uncomment when actually used
// Profile ID's
public static final long CKP_INVALID_ID = 0x00000000L;
public static final long CKP_BASELINE_PROVIDER = 0x00000001L;
public static final long CKP_EXTENDED_PROVIDER = 0x00000002L;
public static final long CKP_AUTHENTICATION_TOKEN = 0x00000003L;
public static final long CKP_PUBLIC_CERTIFICATES_TOKEN = 0x00000004L;
public static final long CKP_VENDOR_DEFINED = 0x80000000L;
/* The following hardware feature types are defined */
// The following hardware feature types are defined
public static final long CKH_MONOTONIC_COUNTER = 0x00000001L;
public static final long CKH_CLOCK = 0x00000002L;
public static final long CKH_USER_INTERFACE = 0x00000003L;
public static final long CKH_VENDOR_DEFINED = 0x80000000L;
*/
/* the following key types are defined: */
public static final long CKK_RSA = 0x00000000L;
@ -259,7 +283,29 @@ public interface PKCS11Constants {
public static final long CKK_GOSTR3410 = 0x00000030L;
public static final long CKK_GOSTR3411 = 0x00000031L;
public static final long CKK_GOST28147 = 0x00000032L;
;
public static final long CKK_CHACHA20 = 0x00000033L;
public static final long CKK_POLY1305 = 0x00000034L;
public static final long CKK_AES_XTS = 0x00000035L;
public static final long CKK_SHA3_224_HMAC = 0x00000036L;
public static final long CKK_SHA3_256_HMAC = 0x00000037L;
public static final long CKK_SHA3_384_HMAC = 0x00000038L;
public static final long CKK_SHA3_512_HMAC = 0x00000039L;
public static final long CKK_BLAKE2B_160_HMAC = 0x0000003aL;
public static final long CKK_BLAKE2B_256_HMAC = 0x0000003bL;
public static final long CKK_BLAKE2B_384_HMAC = 0x0000003cL;
public static final long CKK_BLAKE2B_512_HMAC = 0x0000003dL;
public static final long CKK_SALSA20 = 0x0000003eL;
public static final long CKK_X2RATCHET = 0x0000003fL;
public static final long CKK_EC_EDWARDS = 0x00000040L;
public static final long CKK_EC_MONTGOMERY = 0x00000041L;
public static final long CKK_HKDF = 0x00000042L;
public static final long CKK_SHA512_224_HMAC = 0x00000043L;
public static final long CKK_SHA512_256_HMAC = 0x00000044L;
public static final long CKK_SHA512_T_HMAC = 0x00000045L;
public static final long CKK_VENDOR_DEFINED = 0x80000000L;
// pseudo key type ANY (for template manager)
@ -271,9 +317,22 @@ public interface PKCS11Constants {
public static final long PCKK_TLSRSAPREMASTER = 0x7FFFFF26L;
public static final long PCKK_TLSMASTER = 0x7FFFFF27L;
/* Uncomment when actually used
public static final long CK_CERTIFICATE_CATEGORY_UNSPECIFIED = 0L;
public static final long CK_CERTIFICATE_CATEGORY_TOKEN_USER = 1L;
public static final long CK_CERTIFICATE_CATEGORY_AUTHORITY = 2L;
public static final long CK_CERTIFICATE_CATEGORY_OTHER_ENTITY = 3L;
public static final long CK_SECURITY_DOMAIN_UNSPECIFIED = 0L;
public static final long CK_SECURITY_DOMAIN_MANUFACTURER = 1L;
public static final long CK_SECURITY_DOMAIN_OPERATOR = 2L;
public static final long CK_SECURITY_DOMAIN_THIRD_PARTY = 3L;
*/
/* The following certificate types are defined: */
public static final long CKC_X_509 = 0x00000000L;
public static final long CKC_X_509_ATTR_CERT = 0x00000001L;
public static final long CKC_WTLS = 0x00000002L;
public static final long CKC_VENDOR_DEFINED = 0x80000000L;
/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which
@ -281,11 +340,23 @@ public interface PKCS11Constants {
*/
public static final long CKF_ARRAY_ATTRIBUTE = 0x40000000L;
/* Uncomment when actually used
public static final long CK_OTP_FORMAT_DECIMAL = 0L;
public static final long CK_OTP_FORMAT_HEXADECIMAL = 1L;
public static final long CK_OTP_FORMAT_ALPHANUMERIC = 2L;
public static final long CK_OTP_FORMAT_BINARY = 3L;
public static final long CK_OTP_PARAM_IGNORED = 0L;
public static final long CK_OTP_PARAM_OPTIONAL = 1L;
public static final long CK_OTP_PARAM_MANDATORY = 2L;
*/
/* The following attribute types are defined: */
public static final long CKA_CLASS = 0x00000000L;
public static final long CKA_TOKEN = 0x00000001L;
public static final long CKA_PRIVATE = 0x00000002L;
public static final long CKA_LABEL = 0x00000003L;
public static final long CKA_UNIQUE_ID = 0x00000004L;
public static final long CKA_APPLICATION = 0x00000010L;
public static final long CKA_VALUE = 0x00000011L;
public static final long CKA_OBJECT_ID = 0x00000012L;
@ -343,12 +414,10 @@ public interface PKCS11Constants {
public static final long CKA_VALUE_BITS = 0x00000160L;
public static final long CKA_VALUE_LEN = 0x00000161L;
public static final long CKA_EXTRACTABLE = 0x00000162L;
public static final long CKA_LOCAL = 0x00000163L;
public static final long CKA_NEVER_EXTRACTABLE = 0x00000164L;
public static final long CKA_ALWAYS_SENSITIVE = 0x00000165L;
public static final long CKA_KEY_GEN_MECHANISM = 0x00000166L;
public static final long CKA_MODIFIABLE = 0x00000170L;
@ -406,6 +475,25 @@ public interface PKCS11Constants {
public static final long CKA_SUPPORTED_CMS_ATTRIBUTES = 0x00000503L;
public static final long CKA_ALLOWED_MECHANISMS = (CKF_ARRAY_ATTRIBUTE|0x00000600L);
public static final long CKA_PROFILE_ID = 0x00000601L;
public static final long CKA_X2RATCHET_BAG = 0x00000602L;
public static final long CKA_X2RATCHET_BAGSIZE = 0x00000603L;
public static final long CKA_X2RATCHET_BOBS1STMSG = 0x00000604L;
public static final long CKA_X2RATCHET_CKR = 0x00000605L;
public static final long CKA_X2RATCHET_CKS = 0x00000606L;
public static final long CKA_X2RATCHET_DHP = 0x00000607L;
public static final long CKA_X2RATCHET_DHR = 0x00000608L;
public static final long CKA_X2RATCHET_DHS = 0x00000609L;
public static final long CKA_X2RATCHET_HKR = 0x0000060aL;
public static final long CKA_X2RATCHET_HKS = 0x0000060bL;
public static final long CKA_X2RATCHET_ISALICE = 0x0000060cL;
public static final long CKA_X2RATCHET_NHKR = 0x0000060dL;
public static final long CKA_X2RATCHET_NHKS = 0x0000060eL;
public static final long CKA_X2RATCHET_NR = 0x0000060fL;
public static final long CKA_X2RATCHET_NS = 0x00000610L;
public static final long CKA_X2RATCHET_PNS = 0x00000611L;
public static final long CKA_X2RATCHET_RK = 0x00000612L;
public static final long CKA_VENDOR_DEFINED = 0x80000000L;
/* the following mechanism types are defined: */
@ -435,6 +523,10 @@ public interface PKCS11Constants {
public static final long CKM_DSA_SHA256 = 0x00000014L;
public static final long CKM_DSA_SHA384 = 0x00000015L;
public static final long CKM_DSA_SHA512 = 0x00000016L;
public static final long CKM_DSA_SHA3_224 = 0x00000018L;
public static final long CKM_DSA_SHA3_256 = 0x00000019L;
public static final long CKM_DSA_SHA3_384 = 0x0000001AL;
public static final long CKM_DSA_SHA3_512 = 0x0000001BL;
public static final long CKM_DH_PKCS_KEY_PAIR_GEN = 0x00000020L;
public static final long CKM_DH_PKCS_DERIVE = 0x00000021L;
@ -468,6 +560,15 @@ public interface PKCS11Constants {
public static final long CKM_SHA512_T_HMAC_GENERAL = 0x00000052L;
public static final long CKM_SHA512_T_KEY_DERIVATION = 0x00000053L;
public static final long CKM_SHA3_256_RSA_PKCS = 0x00000060L;
public static final long CKM_SHA3_384_RSA_PKCS = 0x00000061L;
public static final long CKM_SHA3_512_RSA_PKCS = 0x00000062L;
public static final long CKM_SHA3_256_RSA_PKCS_PSS = 0x00000063L;
public static final long CKM_SHA3_384_RSA_PKCS_PSS = 0x00000064L;
public static final long CKM_SHA3_512_RSA_PKCS_PSS = 0x00000065L;
public static final long CKM_SHA3_224_RSA_PKCS = 0x00000066L;
public static final long CKM_SHA3_224_RSA_PKCS_PSS = 0x00000067L;
public static final long CKM_RC2_KEY_GEN = 0x00000100L;
public static final long CKM_RC2_ECB = 0x00000101L;
public static final long CKM_RC2_CBC = 0x00000102L;
@ -551,6 +652,23 @@ public interface PKCS11Constants {
public static final long CKM_ACTI = 0x000002A0L;
public static final long CKM_ACTI_KEY_GEN = 0x000002A1L;
public static final long CKM_SHA3_256 = 0x000002B0L;
public static final long CKM_SHA3_256_HMAC = 0x000002B1L;
public static final long CKM_SHA3_256_HMAC_GENERAL = 0x000002B2L;
public static final long CKM_SHA3_256_KEY_GEN = 0x000002B3L;
public static final long CKM_SHA3_224 = 0x000002B5L;
public static final long CKM_SHA3_224_HMAC = 0x000002B6L;
public static final long CKM_SHA3_224_HMAC_GENERAL = 0x000002B7L;
public static final long CKM_SHA3_224_KEY_GEN = 0x000002B8L;
public static final long CKM_SHA3_384 = 0x000002C0L;
public static final long CKM_SHA3_384_HMAC = 0x000002C1L;
public static final long CKM_SHA3_384_HMAC_GENERAL = 0x000002C2L;
public static final long CKM_SHA3_384_KEY_GEN = 0x000002C3L;
public static final long CKM_SHA3_512 = 0x000002D0L;
public static final long CKM_SHA3_512_HMAC = 0x000002D1L;
public static final long CKM_SHA3_512_HMAC_GENERAL = 0x000002D2L;
public static final long CKM_SHA3_512_KEY_GEN = 0x000002D3L;
public static final long CKM_CAST_KEY_GEN = 0x00000300L;
public static final long CKM_CAST_ECB = 0x00000301L;
public static final long CKM_CAST_CBC = 0x00000302L;
@ -611,19 +729,26 @@ public interface PKCS11Constants {
public static final long CKM_MD5_KEY_DERIVATION = 0x00000390L;
public static final long CKM_MD2_KEY_DERIVATION = 0x00000391L;
public static final long CKM_SHA1_KEY_DERIVATION = 0x00000392L;
public static final long CKM_SHA256_KEY_DERIVATION = 0x00000393L;
public static final long CKM_SHA384_KEY_DERIVATION = 0x00000394L;
public static final long CKM_SHA512_KEY_DERIVATION = 0x00000395L;
public static final long CKM_SHA224_KEY_DERIVATION = 0x00000396L;
public static final long CKM_SHA3_256_KEY_DERIVATION = 0x00000397L;
public static final long CKM_SHA3_224_KEY_DERIVATION = 0x00000398L;
public static final long CKM_SHA3_384_KEY_DERIVATION = 0x00000399L;
public static final long CKM_SHA3_512_KEY_DERIVATION = 0x0000039AL;
public static final long CKM_SHAKE_128_KEY_DERIVATION = 0x0000039BL;
public static final long CKM_SHAKE_256_KEY_DERIVATION = 0x0000039CL;
public static final long CKM_PBE_MD2_DES_CBC = 0x000003A0L;
public static final long CKM_PBE_MD5_DES_CBC = 0x000003A1L;
public static final long CKM_PBE_MD5_CAST_CBC = 0x000003A2L;
public static final long CKM_PBE_MD5_CAST3_CBC = 0x000003A3L;
public static final long CKM_PBE_MD5_CAST5_CBC = 0x000003A4L;
public static final long CKM_PBE_MD5_CAST5_CBC /*deprecated*/
= 0x000003A4L;
public static final long CKM_PBE_MD5_CAST128_CBC = 0x000003A4L;
public static final long CKM_PBE_SHA1_CAST5_CBC = 0x000003A5L;
public static final long CKM_PBE_SHA1_CAST5_CBC /*deprecated*/
= 0x000003A5L;
public static final long CKM_PBE_SHA1_CAST128_CBC = 0x000003A5L;
public static final long CKM_PBE_SHA1_RC4_128 = 0x000003A6L;
public static final long CKM_PBE_SHA1_RC4_40 = 0x000003A7L;
@ -643,11 +768,12 @@ public interface PKCS11Constants {
public static final long CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE = 0x000003D4L;
public static final long CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE = 0x000003D5L;
public static final long CKM_TLS10_MAC_SERVER = 0x000003D6L;
public static final long CKM_TLS10_MAC_CLIENT = 0x000003D7L;
public static final long CKM_TLS10_MAC_SERVER /*removed in 3.00*/
= 0x000003D6L;
public static final long CKM_TLS10_MAC_CLIENT /*removed in 3.00*/
= 0x000003D7L;
public static final long CKM_TLS12_MAC = 0x000003D8L;
public static final long CKM_TLS12_KDF = 0x000003D9L;
public static final long CKM_TLS12_MASTER_KEY_DERIVE = 0x000003E0L;
public static final long CKM_TLS12_KEY_AND_MAC_DERIVE = 0x000003E1L;
public static final long CKM_TLS12_MASTER_KEY_DERIVE_DH = 0x000003E2L;
@ -717,6 +843,7 @@ public interface PKCS11Constants {
public static final long CKM_ECDSA_KEY_PAIR_GEN /*deprecated*/
= 0x00001040L;
public static final long CKM_EC_KEY_PAIR_GEN = 0x00001040L;
public static final long CKM_EC_KEY_PAIR_GEN_W_EXTRA_BITS = 0x0000140BL;
public static final long CKM_ECDSA = 0x00001041L;
public static final long CKM_ECDSA_SHA1 = 0x00001042L;
@ -724,6 +851,10 @@ public interface PKCS11Constants {
public static final long CKM_ECDSA_SHA256 = 0x00001044L;
public static final long CKM_ECDSA_SHA384 = 0x00001045L;
public static final long CKM_ECDSA_SHA512 = 0x00001046L;
public static final long CKM_ECDSA_SHA3_224 = 0x00001047L;
public static final long CKM_ECDSA_SHA3_256 = 0x00001048L;
public static final long CKM_ECDSA_SHA3_384 = 0x00001049L;
public static final long CKM_ECDSA_SHA3_512 = 0x0000104AL;
public static final long CKM_ECDH1_DERIVE = 0x00001050L;
public static final long CKM_ECDH1_COFACTOR_DERIVE = 0x00001051L;
@ -732,6 +863,10 @@ public interface PKCS11Constants {
public static final long CKM_ECDH_AES_KEY_WRAP = 0x00001053L;
public static final long CKM_RSA_AES_KEY_WRAP = 0x00001054L;
public static final long CKM_EC_EDWARDS_KEY_PAIR_GEN = 0x00001055L;
public static final long CKM_EC_MONTGOMERY_KEY_PAIR_GEN = 0x00001056L;
public static final long CKM_EDDSA = 0x00001057L;
public static final long CKM_JUNIPER_KEY_GEN = 0x00001060L;
public static final long CKM_JUNIPER_ECB128 = 0x00001061L;
public static final long CKM_JUNIPER_CBC128 = 0x00001062L;
@ -740,6 +875,8 @@ public interface PKCS11Constants {
public static final long CKM_JUNIPER_WRAP = 0x00001065L;
public static final long CKM_FASTHASH = 0x00001070L;
public static final long CKM_AES_XTS = 0x00001071L;
public static final long CKM_AES_XTS_KEY_GEN = 0x00001072L;
public static final long CKM_AES_KEY_GEN = 0x00001080L;
public static final long CKM_AES_ECB = 0x00001081L;
public static final long CKM_AES_CBC = 0x00001082L;
@ -784,23 +921,80 @@ public interface PKCS11Constants {
public static final long CKM_GOST28147_MAC = 0x00001223L;
public static final long CKM_GOST28147_KEY_WRAP = 0x00001224L;
public static final long CKM_CHACHA20_KEY_GEN = 0x00001225L;
public static final long CKM_CHACHA20 = 0x00001226L;
public static final long CKM_POLY1305_KEY_GEN = 0x00001227L;
public static final long CKM_POLY1305 = 0x00001228L;
public static final long CKM_DSA_PARAMETER_GEN = 0x00002000L;
public static final long CKM_DH_PKCS_PARAMETER_GEN = 0x00002001L;
public static final long CKM_X9_42_DH_PARAMETER_GEN = 0x00002002L;
public static final long CKM_DSA_PROBABLISTIC_PARAMETER_GEN = 0x00002003L;
public static final long CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN = 0x00002004L;
public static final long CKM_DSA_FIPS_G_GEN = 0x00002005L;
public static final long CKM_AES_OFB = 0x00002104L;
public static final long CKM_AES_CFB64 = 0x00002105L;
public static final long CKM_AES_CFB8 = 0x00002106L;
public static final long CKM_AES_CFB128 = 0x00002107L;
public static final long CKM_AES_CFB1 = 0x00002108L;
public static final long CKM_AES_KEY_WRAP = 0x00002109L;
public static final long CKM_AES_KEY_WRAP_PAD = 0x0000210AL;
public static final long CKM_AES_KEY_WRAP /* WAS: 0x00001090 */
= 0x00002109L;
public static final long CKM_AES_KEY_WRAP_PAD /* WAS: 0x00001091 */
= 0x0000210AL;
public static final long CKM_AES_KEY_WRAP_KWP = 0x0000210BL;
public static final long CKM_RSA_PKCS_TPM_1_1 = 0x00004001L;
public static final long CKM_RSA_PKCS_OAEP_TPM_1_1 = 0x00004002L;
public static final long CKM_SHA_1_KEY_GEN = 0x00004003L;
public static final long CKM_SHA224_KEY_GEN = 0x00004004L;
public static final long CKM_SHA256_KEY_GEN = 0x00004005L;
public static final long CKM_SHA384_KEY_GEN = 0x00004006L;
public static final long CKM_SHA512_KEY_GEN = 0x00004007L;
public static final long CKM_SHA512_224_KEY_GEN = 0x00004008L;
public static final long CKM_SHA512_256_KEY_GEN = 0x00004009L;
public static final long CKM_SHA512_T_KEY_GEN = 0x0000400aL;
public static final long CKM_NULL = 0x0000400bL;
public static final long CKM_BLAKE2B_160 = 0x0000400cL;
public static final long CKM_BLAKE2B_160_HMAC = 0x0000400dL;
public static final long CKM_BLAKE2B_160_HMAC_GENERAL = 0x0000400eL;
public static final long CKM_BLAKE2B_160_KEY_DERIVE = 0x0000400fL;
public static final long CKM_BLAKE2B_160_KEY_GEN = 0x00004010L;
public static final long CKM_BLAKE2B_256 = 0x00004011L;
public static final long CKM_BLAKE2B_256_HMAC = 0x00004012L;
public static final long CKM_BLAKE2B_256_HMAC_GENERAL = 0x00004013L;
public static final long CKM_BLAKE2B_256_KEY_DERIVE = 0x00004014L;
public static final long CKM_BLAKE2B_256_KEY_GEN = 0x00004015L;
public static final long CKM_BLAKE2B_384 = 0x00004016L;
public static final long CKM_BLAKE2B_384_HMAC = 0x00004017L;
public static final long CKM_BLAKE2B_384_HMAC_GENERAL = 0x00004018L;
public static final long CKM_BLAKE2B_384_KEY_DERIVE = 0x00004019L;
public static final long CKM_BLAKE2B_384_KEY_GEN = 0x0000401aL;
public static final long CKM_BLAKE2B_512 = 0x0000401bL;
public static final long CKM_BLAKE2B_512_HMAC = 0x0000401cL;
public static final long CKM_BLAKE2B_512_HMAC_GENERAL = 0x0000401dL;
public static final long CKM_BLAKE2B_512_KEY_DERIVE = 0x0000401eL;
public static final long CKM_BLAKE2B_512_KEY_GEN = 0x0000401fL;
public static final long CKM_SALSA20 = 0x00004020L;
public static final long CKM_CHACHA20_POLY1305 = 0x00004021L;
public static final long CKM_SALSA20_POLY1305 = 0x00004022L;
public static final long CKM_X3DH_INITIALIZE = 0x00004023L;
public static final long CKM_X3DH_RESPOND = 0x00004024L;
public static final long CKM_X2RATCHET_INITIALIZE = 0x00004025L;
public static final long CKM_X2RATCHET_RESPOND = 0x00004026L;
public static final long CKM_X2RATCHET_ENCRYPT = 0x00004027L;
public static final long CKM_X2RATCHET_DECRYPT = 0x00004028L;
public static final long CKM_XEDDSA = 0x00004029L;
public static final long CKM_HKDF_DERIVE = 0x0000402aL;
public static final long CKM_HKDF_DATA = 0x0000402bL;
public static final long CKM_HKDF_KEY_GEN = 0x0000402cL;
public static final long CKM_SALSA20_KEY_GEN = 0x0000402dL;
public static final long CKM_SP800_108_COUNTER_KDF = 0x000003acL;
public static final long CKM_SP800_108_FEEDBACK_KDF = 0x000003adL;
public static final long CKM_SP800_108_DOUBLE_PIPELINE_KDF = 0x000003aeL;
public static final long CKM_VENDOR_DEFINED = 0x80000000L;
// NSS private
@ -813,6 +1007,13 @@ public interface PKCS11Constants {
/* The flags specify whether or not a mechanism can be used for a
* particular task */
public static final long CKF_HW = 0x00000001L;
public static final long CKF_MESSAGE_ENCRYPT = 0x00000002L;
public static final long CKF_MESSAGE_DECRYPT = 0x00000004L;
public static final long CKF_MESSAGE_SIGN = 0x00000008L;
public static final long CKF_MESSAGE_VERIFY = 0x00000010L;
public static final long CKF_MULTI_MESSAGE = 0x00000020L;
public static final long CKF_FIND_OBJECTS = 0x00000040L;
public static final long CKF_ENCRYPT = 0x00000100L;
public static final long CKF_DECRYPT = 0x00000200L;
public static final long CKF_DIGEST = 0x00000400L;
@ -832,13 +1033,15 @@ public interface PKCS11Constants {
public static final long CKF_EC_F_P = 0x00100000L;
public static final long CKF_EC_F_2M = 0x00200000L;
public static final long CKF_EC_ECPARAMETERS = 0x00400000L;
public static final long CKF_EC_NAMEDCURVE = 0x00800000L;
public static final long CKF_EC_OID = 0x00400000L;
public static final long CKF_EC_NAMEDCURVE /*deprecated since 3.00*/
= CKF_EC_OID;
public static final long CKF_EC_UNCOMPRESS = 0x01000000L;
public static final long CKF_EC_COMPRESS = 0x02000000L;
public static final long CKF_EC_CURVENAME = 0x04000000L;
public static final long CKF_EXTENSION = 0x80000000L;
/* Identifies the return value of a Cryptoki function */
public static final long CKR_OK = 0x00000000L;
public static final long CKR_CANCEL = 0x00000001L;
@ -867,6 +1070,7 @@ public interface PKCS11Constants {
public static final long CKR_DEVICE_REMOVED = 0x00000032L;
public static final long CKR_ENCRYPTED_DATA_INVALID = 0x00000040L;
public static final long CKR_ENCRYPTED_DATA_LEN_RANGE = 0x00000041L;
public static final long CKR_AEAD_DECRYPT_FAILED = 0x00000042L;
public static final long CKR_FUNCTION_CANCELED = 0x00000050L;
public static final long CKR_FUNCTION_NOT_PARALLEL = 0x00000051L;
@ -959,9 +1163,15 @@ public interface PKCS11Constants {
public static final long CKR_PIN_TOO_WEAK = 0x000001B8L;
public static final long CKR_PUBLIC_KEY_INVALID = 0x000001B9L;
public static final long CKR_FUNCTION_REJECTED = 0x00000200L;
public static final long CKR_TOKEN_RESOURCE_EXCEEDED = 0x00000201L;
public static final long CKR_OPERATION_CANCEL_FAILED = 0x00000202L;
public static final long CKR_VENDOR_DEFINED = 0x80000000L;
/* Uncomment when actually used
public static final long CKF_END_OF_MESSAGE = 0x00000001L;
public static final long CKF_INTERFACE_FORK_SAFE = 0x00000001L;
*/
/* flags: bit flags that provide capabilities of the slot
* Bit Flag = Mask
@ -969,7 +1179,6 @@ public interface PKCS11Constants {
public static final long CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001L;
public static final long CKF_OS_LOCKING_OK = 0x00000002L;
/* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */
public static final long CKF_DONT_BLOCK = 1L;
@ -979,16 +1188,20 @@ public interface PKCS11Constants {
public static final long CKG_MGF1_SHA384 = 0x00000003L;
public static final long CKG_MGF1_SHA512 = 0x00000004L;
public static final long CKG_MGF1_SHA224 = 0x00000005L;
public static final long CKG_MGF1_SHA3_224 = 0x00000006L;
public static final long CKG_MGF1_SHA3_256 = 0x00000007L;
public static final long CKG_MGF1_SHA3_384 = 0x00000008L;
public static final long CKG_MGF1_SHA3_512 = 0x00000009L;
/* The following encoding parameter sources are defined */
public static final long CKZ_DATA_SPECIFIED = 0x00000001L;
/* the following EC Key Derivation Functions are defined */
// the following EC Key Derivation Functions are defined
public static final long CKD_NULL = 0x00000001L;
public static final long CKD_SHA1_KDF = 0x00000002L;
/* the following X9.42 Diffie-Hellman Key Derivation Functions are defined */
/* Uncomment when actually used
// the following X9.42 Diffie-Hellman Key Derivation Functions are defined
public static final long CKD_SHA1_KDF_ASN1 = 0x00000003L;
public static final long CKD_SHA1_KDF_CONCATENATE = 0x00000004L;
public static final long CKD_SHA224_KDF = 0x00000005L;
@ -996,6 +1209,23 @@ public interface PKCS11Constants {
public static final long CKD_SHA384_KDF = 0x00000007L;
public static final long CKD_SHA512_KDF = 0x00000008L;
public static final long CKD_CPDIVERSIFY_KDF = 0x00000009L;
public static final long CKD_SHA3_224_KDF = 0x0000000AL;
public static final long CKD_SHA3_256_KDF = 0x0000000BL;
public static final long CKD_SHA3_384_KDF = 0x0000000CL;
public static final long CKD_SHA3_512_KDF = 0x0000000DL;
public static final long CKD_SHA1_KDF_SP800 = 0x0000000EL;
public static final long CKD_SHA224_KDF_SP800 = 0x0000000FL;
public static final long CKD_SHA256_KDF_SP800 = 0x00000010L;
public static final long CKD_SHA384_KDF_SP800 = 0x00000011L;
public static final long CKD_SHA512_KDF_SP800 = 0x00000012L;
public static final long CKD_SHA3_224_KDF_SP800 = 0x00000013L;
public static final long CKD_SHA3_256_KDF_SP800 = 0x00000014L;
public static final long CKD_SHA3_384_KDF_SP800 = 0x00000015L;
public static final long CKD_SHA3_512_KDF_SP800 = 0x00000016L;
public static final long CKD_BLAKE2B_160_KDF = 0x00000017L;
public static final long CKD_BLAKE2B_256_KDF = 0x00000018L;
public static final long CKD_BLAKE2B_384_KDF = 0x00000019L;
public static final long CKD_BLAKE2B_512_KDF = 0x0000001aL;
public static final long CKP_PKCS5_PBKD2_HMAC_SHA1 = 0x00000001L;
public static final long CKP_PKCS5_PBKD2_HMAC_GOSTR3411 = 0x00000002L;
@ -1024,33 +1254,53 @@ public interface PKCS11Constants {
public static final long CKF_EXCLUDE_PIN = 0x00000010L;
public static final long CKF_USER_FRIENDLY_OTP = 0x00000020L;
public static final long CKG_NO_GENERATE = 0x00000000L;
public static final long CKG_GENERATE = 0x00000001L;
public static final long CKG_GENERATE_COUNTER = 0x00000002L;
public static final long CKG_GENERATE_RANDOM = 0x00000003L;
public static final long CK_SP800_108_ITERATION_VARIABLE = 0x00000001L;
public static final long CK_SP800_108_OPTIONAL_COUNTER = 0x00000002L;
public static final long CK_SP800_108_DKM_LENGTH = 0x00000003L;
public static final long CK_SP800_108_BYTE_ARRAY = 0x00000004L;
public static final long CK_SP800_108_DKM_LENGTH_SUM_OF_KEYS
= 0x00000001L;
public static final long CK_SP800_108_DKM_LENGTH_SUM_OF_SEGMENTS
= 0x00000002L;
public static final long CKF_HKDF_SALT_NULL = 0x00000001L;
public static final long CKF_HKDF_SALT_DATA = 0x00000002L;
public static final long CKF_HKDF_SALT_KEY = 0x00000004L;
*/
// private NSS attribute (for DSA and DH private keys)
public static final long CKA_NETSCAPE_DB = 0xD5A0DB00L;
// base number of NSS private attributes
public static final long CKA_NETSCAPE_BASE = 0x80000000L + 0x4E534350L;
public static final long CKA_NETSCAPE_BASE /*0x80000000L + 0x4E534350L*/
= 0xCE534350L;
// object type for NSS trust
public static final long CKO_NETSCAPE_TRUST = CKA_NETSCAPE_BASE + 3;
public static final long CKO_NETSCAPE_TRUST = 0xCE534353L;
// base number for NSS trust attributes
public static final long CKA_NETSCAPE_TRUST_BASE = CKA_NETSCAPE_BASE + 0x2000;
public static final long CKA_NETSCAPE_TRUST_BASE = 0xCE536350L;
// attributes for NSS trust
public static final long CKA_NETSCAPE_TRUST_SERVER_AUTH = CKA_NETSCAPE_TRUST_BASE + 8;
public static final long CKA_NETSCAPE_TRUST_CLIENT_AUTH = CKA_NETSCAPE_TRUST_BASE + 9;
public static final long CKA_NETSCAPE_TRUST_CODE_SIGNING = CKA_NETSCAPE_TRUST_BASE + 10;
public static final long CKA_NETSCAPE_TRUST_EMAIL_PROTECTION = CKA_NETSCAPE_TRUST_BASE + 11;
public static final long CKA_NETSCAPE_CERT_SHA1_HASH = CKA_NETSCAPE_TRUST_BASE + 100;
public static final long CKA_NETSCAPE_CERT_MD5_HASH = CKA_NETSCAPE_TRUST_BASE + 101;
public static final long CKA_NETSCAPE_TRUST_SERVER_AUTH = 0xCE536358L;
public static final long CKA_NETSCAPE_TRUST_CLIENT_AUTH = 0xCE536359L;
public static final long CKA_NETSCAPE_TRUST_CODE_SIGNING = 0xCE53635AL;
public static final long CKA_NETSCAPE_TRUST_EMAIL_PROTECTION = 0xCE53635BL;
public static final long CKA_NETSCAPE_CERT_SHA1_HASH = 0xCE5363B4L;
public static final long CKA_NETSCAPE_CERT_MD5_HASH = 0xCE5363B5L;
// trust values for each of the NSS trust attributes
public static final long CKT_NETSCAPE_TRUSTED = CKA_NETSCAPE_BASE + 1;
public static final long CKT_NETSCAPE_TRUSTED_DELEGATOR = CKA_NETSCAPE_BASE + 2;
public static final long CKT_NETSCAPE_UNTRUSTED = CKA_NETSCAPE_BASE + 3;
public static final long CKT_NETSCAPE_MUST_VERIFY = CKA_NETSCAPE_BASE + 4;
public static final long CKT_NETSCAPE_TRUST_UNKNOWN = CKA_NETSCAPE_BASE + 5; /* default */
public static final long CKT_NETSCAPE_VALID = CKA_NETSCAPE_BASE + 10;
public static final long CKT_NETSCAPE_VALID_DELEGATOR = CKA_NETSCAPE_BASE + 11;
public static final long CKT_NETSCAPE_TRUSTED = 0xCE534351L;
public static final long CKT_NETSCAPE_TRUSTED_DELEGATOR = 0xCE534352L;
public static final long CKT_NETSCAPE_UNTRUSTED = 0xCE534353L;
public static final long CKT_NETSCAPE_MUST_VERIFY = 0xCE534354L;
public static final long CKT_NETSCAPE_TRUST_UNKNOWN /* default */
= 0xCE534355L;
public static final long CKT_NETSCAPE_VALID = 0xCE53435AL;
public static final long CKT_NETSCAPE_VALID_DELEGATOR = 0xCE53435BL;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -48,7 +48,7 @@
package sun.security.pkcs11.wrapper;
import java.util.*;
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/**
* This is the superclass of all checked exceptions used by this package. An
@ -73,101 +73,105 @@ public class PKCS11Exception extends Exception {
private static final Map<Long,String> errorMap;
static {
int[] errorCodes = new int[] {
0x00000000,
0x00000001,
0x00000002,
0x00000003,
0x00000005,
0x00000006,
0x00000007,
0x00000008,
0x00000009,
0x0000000A,
0x00000010,
0x00000011,
0x00000012,
0x00000013,
0x0000001B,
0x00000020,
0x00000021,
0x00000030,
0x00000031,
0x00000032,
0x00000040,
0x00000041,
0x00000050,
0x00000051,
0x00000054,
0x00000060,
0x00000062,
0x00000063,
0x00000064,
0x00000065,
0x00000066,
0x00000067,
0x00000068,
0x00000069,
0x0000006A,
0x00000070,
0x00000071,
0x00000082,
0x00000090,
0x00000091,
0x000000A0,
0x000000A1,
0x000000A2,
0x000000A3,
0x000000A4,
0x000000B0,
0x000000B1,
0x000000B3,
0x000000B4,
0x000000B5,
0x000000B6,
0x000000B7,
0x000000B8,
0x000000C0,
0x000000C1,
0x000000D0,
0x000000D1,
0x000000E0,
0x000000E1,
0x000000E2,
0x000000F0,
0x000000F1,
0x000000F2,
0x00000100,
0x00000101,
0x00000102,
0x00000103,
0x00000104,
0x00000105,
0x00000110,
0x00000112,
0x00000113,
0x00000114,
0x00000115,
0x00000120,
0x00000121,
0x00000130,
0x00000150,
0x00000160,
0x00000170,
0x00000180,
0x00000190,
0x00000191,
0x000001A0,
0x000001A1,
0x000001B0,
0x000001B1,
0x000001B5,
0x000001B6,
0x000001B7,
0x000001B8,
0x000001B9,
0x00000200,
0x80000000,
long[] errorCodes = new long[] {
CKR_OK,
CKR_CANCEL,
CKR_HOST_MEMORY,
CKR_SLOT_ID_INVALID,
CKR_GENERAL_ERROR,
CKR_FUNCTION_FAILED,
CKR_ARGUMENTS_BAD,
CKR_NO_EVENT,
CKR_NEED_TO_CREATE_THREADS,
CKR_CANT_LOCK,
CKR_ATTRIBUTE_READ_ONLY,
CKR_ATTRIBUTE_SENSITIVE,
CKR_ATTRIBUTE_TYPE_INVALID,
CKR_ATTRIBUTE_VALUE_INVALID,
CKR_ACTION_PROHIBITED,
CKR_DATA_INVALID,
CKR_DATA_LEN_RANGE,
CKR_DEVICE_ERROR,
CKR_DEVICE_MEMORY,
CKR_DEVICE_REMOVED,
CKR_ENCRYPTED_DATA_INVALID,
CKR_ENCRYPTED_DATA_LEN_RANGE,
CKR_AEAD_DECRYPT_FAILED,
CKR_FUNCTION_CANCELED,
CKR_FUNCTION_NOT_PARALLEL,
CKR_FUNCTION_NOT_SUPPORTED,
CKR_KEY_HANDLE_INVALID,
CKR_KEY_SIZE_RANGE,
CKR_KEY_TYPE_INCONSISTENT,
CKR_KEY_NOT_NEEDED,
CKR_KEY_CHANGED,
CKR_KEY_NEEDED,
CKR_KEY_INDIGESTIBLE,
CKR_KEY_FUNCTION_NOT_PERMITTED,
CKR_KEY_NOT_WRAPPABLE,
CKR_KEY_UNEXTRACTABLE,
CKR_MECHANISM_INVALID,
CKR_MECHANISM_PARAM_INVALID,
CKR_OBJECT_HANDLE_INVALID,
CKR_OPERATION_ACTIVE,
CKR_OPERATION_NOT_INITIALIZED,
CKR_PIN_INCORRECT,
CKR_PIN_INVALID,
CKR_PIN_LEN_RANGE,
CKR_PIN_EXPIRED,
CKR_PIN_LOCKED,
CKR_SESSION_CLOSED,
CKR_SESSION_COUNT,
CKR_SESSION_HANDLE_INVALID,
CKR_SESSION_PARALLEL_NOT_SUPPORTED,
CKR_SESSION_READ_ONLY,
CKR_SESSION_EXISTS,
CKR_SESSION_READ_ONLY_EXISTS,
CKR_SESSION_READ_WRITE_SO_EXISTS,
CKR_SIGNATURE_INVALID,
CKR_SIGNATURE_LEN_RANGE,
CKR_TEMPLATE_INCOMPLETE,
CKR_TEMPLATE_INCONSISTENT,
CKR_TOKEN_NOT_PRESENT,
CKR_TOKEN_NOT_RECOGNIZED,
CKR_TOKEN_WRITE_PROTECTED,
CKR_UNWRAPPING_KEY_HANDLE_INVALID,
CKR_UNWRAPPING_KEY_SIZE_RANGE,
CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT,
CKR_USER_ALREADY_LOGGED_IN,
CKR_USER_NOT_LOGGED_IN,
CKR_USER_PIN_NOT_INITIALIZED,
CKR_USER_TYPE_INVALID,
CKR_USER_ANOTHER_ALREADY_LOGGED_IN,
CKR_USER_TOO_MANY_TYPES,
CKR_WRAPPED_KEY_INVALID,
CKR_WRAPPED_KEY_LEN_RANGE,
CKR_WRAPPING_KEY_HANDLE_INVALID,
CKR_WRAPPING_KEY_SIZE_RANGE,
CKR_WRAPPING_KEY_TYPE_INCONSISTENT,
CKR_RANDOM_SEED_NOT_SUPPORTED,
CKR_RANDOM_NO_RNG,
CKR_DOMAIN_PARAMS_INVALID,
CKR_CURVE_NOT_SUPPORTED,
CKR_BUFFER_TOO_SMALL,
CKR_SAVED_STATE_INVALID,
CKR_INFORMATION_SENSITIVE,
CKR_STATE_UNSAVEABLE,
CKR_CRYPTOKI_NOT_INITIALIZED,
CKR_CRYPTOKI_ALREADY_INITIALIZED,
CKR_MUTEX_BAD,
CKR_MUTEX_NOT_LOCKED,
CKR_NEW_PIN_MODE,
CKR_NEXT_OTP,
CKR_EXCEEDED_MAX_ITERATIONS,
CKR_FIPS_SELF_TEST_FAILED,
CKR_LIBRARY_LOAD_FAILED,
CKR_PIN_TOO_WEAK,
CKR_PUBLIC_KEY_INVALID,
CKR_FUNCTION_REJECTED,
CKR_TOKEN_RESOURCE_EXCEEDED,
CKR_OPERATION_CANCEL_FAILED,
CKR_VENDOR_DEFINED,
};
String[] errorMessages = new String[] {
"CKR_OK",
@ -192,6 +196,7 @@ public class PKCS11Exception extends Exception {
"CKR_DEVICE_REMOVED",
"CKR_ENCRYPTED_DATA_INVALID",
"CKR_ENCRYPTED_DATA_LEN_RANGE",
"CKR_AEAD_DECRYPT_FAILED",
"CKR_FUNCTION_CANCELED",
"CKR_FUNCTION_NOT_PARALLEL",
"CKR_FUNCTION_NOT_SUPPORTED",
@ -247,6 +252,7 @@ public class PKCS11Exception extends Exception {
"CKR_RANDOM_SEED_NOT_SUPPORTED",
"CKR_RANDOM_NO_RNG",
"CKR_DOMAIN_PARAMS_INVALID",
"CKR_CURVE_NOT_SUPPORTED",
"CKR_BUFFER_TOO_SMALL",
"CKR_SAVED_STATE_INVALID",
"CKR_INFORMATION_SENSITIVE",
@ -263,6 +269,8 @@ public class PKCS11Exception extends Exception {
"CKR_PIN_TOO_WEAK",
"CKR_PUBLIC_KEY_INVALID",
"CKR_FUNCTION_REJECTED",
"CKR_TOKEN_RESOURCE_EXCEEDED",
"CKR_OPERATION_CANCEL_FAILED",
"CKR_VENDOR_DEFINED",
};
errorMap = new HashMap<Long,String>();

View File

@ -1,32 +1,72 @@
## OASIS PKCS #11 Cryptographic Token Interface v2.40
## OASIS PKCS #11 Cryptographic Token Interface v3.0
### OASIS PKCS #11 Cryptographic Token Interface License
```
<pre>
Copyright (c) OASIS Open 2016. All Rights Reserved.
Copyright © OASIS Open 2020. All Rights Reserved.
All capitalized terms in the following text have the meanings assigned to them in the OASIS
Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the
OASIS website: [http://www.oasis-open.org/policies-guidelines/ipr]
All capitalized terms in the following text have the meanings
assigned to them in the OASIS Intellectual Property Rights Policy (the
"OASIS IPR Policy"). The full Policy may be found at the OASIS website:
[http://www.oasis-open.org/policies-guidelines/ipr]
This document and translations of it may be copied and furnished to others, and derivative works
that comment on or otherwise explain it or assist in its implementation may be prepared, copied,
published, and distributed, in whole or in part, without restriction of any kind, provided that
the above copyright notice and this section are included on all such copies and derivative works.
However, this document itself may not be modified in any way, including by removing the copyright
notice or references to OASIS, except as needed for the purpose of developing any document or
deliverable produced by an OASIS Technical Committee (in which case the rules applicable to
copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it
into languages other than English.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it or
assist in its implementation may be prepared, copied, published, and
distributed, in whole or in part, without restriction of any kind,
provided that the above copyright notice and this section are included
on all such copies and derivative works. However, this document itself
may not be modified in any way, including by removing the copyright
notice or references to OASIS, except as needed for the purpose of
developing any document or deliverable produced by an OASIS Technical
Committee (in which case the rules applicable to copyrights, as set
forth in the OASIS IPR Policy, must be followed) or as required to
translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by OASIS or its
successors or assigns.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and OASIS
DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE
USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS AND ITS MEMBERS WILL NOT BE LIABLE FOR
ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR
ANY PART THEREOF.
This document and the information contained herein is provided on an
"AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS
AND ITS MEMBERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR ANY
PART THEREOF.
```
[OASIS requests that any OASIS Party or any other party that
believes it has patent claims that would necessarily be infringed by
implementations of this OASIS Standards Final Deliverable, to notify
OASIS TC Administrator and provide an indication of its willingness to
grant patent licenses to such patent claims in a manner consistent with
the IPR Mode of the OASIS Technical Committee that produced this
deliverable.]
[OASIS invites any party to contact the OASIS TC Administrator if it
is aware of a claim of ownership of any patent claims that would
necessarily be infringed by implementations of this OASIS Standards
Final Deliverable by a patent holder that is not willing to provide a
license to such patent claims in a manner consistent with the IPR Mode
of the OASIS Technical Committee that produced this OASIS Standards
Final Deliverable. OASIS may include such claims on its website, but
disclaims any obligation to do so.]
[OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this OASIS
Standards Final Deliverable or the extent to which any license under
such rights might or might not be available; neither does it represent
that it has made any effort to identify any such rights. Information on
OASIS' procedures with respect to rights in any document or deliverable
produced by an OASIS Technical Committee can be found on the OASIS
website. Copies of claims of rights made available for publication and
any assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this OASIS Standards
Final Deliverable, can be obtained from the OASIS TC Administrator.
OASIS makes no representation that any information or list of
intellectual property rights will at any time be complete, or that any
claims in such list are, in fact, Essential Claims.]
</pre>

View File

@ -1,14 +1,10 @@
/* Copyright (c) OASIS Open 2016. All Rights Reserved./
* /Distributed under the terms of the OASIS IPR Policy,
/* Copyright (c) OASIS Open 2016-2019. All Rights Reserved.
* Distributed under the terms of the OASIS IPR Policy,
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
* IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others.
*/
/* Latest version of the specification:
* http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
*/
#ifndef _PKCS11_H_
#define _PKCS11_H_ 1
@ -29,8 +25,7 @@ extern "C" {
* convention on packing is that structures should be 1-byte
* aligned.
*
* If you're using Microsoft Developer Studio 5.0 to produce
* Win32 stuff, this might be done by using the following
* If you're using Windows this might be done by using the following
* preprocessor directive before including pkcs11.h or pkcs11t.h:
*
* #pragma pack(push, cryptoki, 1)
@ -40,13 +35,6 @@ extern "C" {
*
* #pragma pack(pop, cryptoki)
*
* If you're using an earlier version of Microsoft Developer
* Studio to produce Win16 stuff, this might be done by using
* the following preprocessor directive before including
* pkcs11.h or pkcs11t.h:
*
* #pragma pack(1)
*
* In a UNIX environment, you're on your own for this. You might
* not need to do (or be able to do!) anything.
*
@ -59,16 +47,10 @@ extern "C" {
*
* typedef CK_BYTE CK_PTR CK_BYTE_PTR;
*
* If you're using Microsoft Developer Studio 5.0 to produce
* Win32 stuff, it might be defined by:
* If you're using windows, it might be defined by:
*
* #define CK_PTR *
*
* If you're using an earlier version of Microsoft Developer
* Studio to produce Win16 stuff, it might be defined by:
*
* #define CK_PTR far *
*
* In a typical UNIX environment, it might be defined by:
*
* #define CK_PTR *
@ -83,19 +65,12 @@ extern "C" {
* CK_VOID_PTR pReserved
* );
*
* If you're using Microsoft Developer Studio 5.0 to declare a
* function in a Win32 Cryptoki .dll, it might be defined by:
* If you're using Windows to declare a function in a Win32 cryptoki .dll,
* it might be defined by:
*
* #define CK_DECLARE_FUNCTION(returnType, name) \
* returnType __declspec(dllimport) name
*
* If you're using an earlier version of Microsoft Developer
* Studio to declare a function in a Win16 Cryptoki .dll, it
* might be defined by:
*
* #define CK_DECLARE_FUNCTION(returnType, name) \
* returnType __export _far _pascal name
*
* In a UNIX environment, it might be defined by:
*
* #define CK_DECLARE_FUNCTION(returnType, name) \
@ -120,19 +95,12 @@ extern "C" {
* typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args);
* funcPtrType funcPtr;
*
* If you're using Microsoft Developer Studio 5.0 to access
* If you're using Windows to access
* functions in a Win32 Cryptoki .dll, in might be defined by:
*
* #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
* returnType __declspec(dllimport) (* name)
*
* If you're using an earlier version of Microsoft Developer
* Studio to access functions in a Win16 Cryptoki .dll, it might
* be defined by:
*
* #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
* returnType __export _far _pascal (* name)
*
* In a UNIX environment, it might be defined by:
*
* #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
@ -153,18 +121,11 @@ extern "C" {
* typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args);
* myCallbackType myCallback;
*
* If you're using Microsoft Developer Studio 5.0 to do Win32
* Cryptoki development, it might be defined by:
* If you're using Windows, it might be defined by:
*
* #define CK_CALLBACK_FUNCTION(returnType, name) \
* returnType (* name)
*
* If you're using an earlier version of Microsoft Developer
* Studio to do Win16 development, it might be defined by:
*
* #define CK_CALLBACK_FUNCTION(returnType, name) \
* returnType _far _pascal (* name)
*
* In a UNIX environment, it might be defined by:
*
* #define CK_CALLBACK_FUNCTION(returnType, name) \
@ -240,6 +201,22 @@ extern "C" {
#define CK_PKCS11_FUNCTION_INFO(name) \
__PASTE(CK_,name) name;
/* Create the 3.0 Function list */
struct CK_FUNCTION_LIST_3_0 {
CK_VERSION version; /* Cryptoki version */
/* Pile all the function pointers into the CK_FUNCTION_LIST. */
/* pkcs11f.h has all the information about the Cryptoki
* function prototypes.
*/
#include "pkcs11f.h"
};
#define CK_PKCS11_2_0_ONLY 1
/* Continue to define the old CK_FUNCTION_LIST */
struct CK_FUNCTION_LIST {
CK_VERSION version; /* Cryptoki version */
@ -253,6 +230,7 @@ struct CK_FUNCTION_LIST {
};
#undef CK_PKCS11_FUNCTION_INFO
#undef CK_PKCS11_2_0_ONLY
#undef __PASTE
@ -263,3 +241,4 @@ struct CK_FUNCTION_LIST {
#endif /* _PKCS11_H_ */

View File

@ -1,4 +1,4 @@
/* Copyright (c) OASIS Open 2016. All Rights Reserved./
/* Copyright (c) OASIS Open 2016, 2019. All Rights Reserved./
* /Distributed under the terms of the OASIS IPR Policy,
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
* IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
@ -937,3 +937,261 @@ CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent)
);
#endif
#ifndef CK_PKCS11_2_0_ONLY
/* C_GetInterfaceList returns all the interfaces supported by the module*/
CK_PKCS11_FUNCTION_INFO(C_GetInterfaceList)
#ifdef CK_NEED_ARG_LIST
(
CK_INTERFACE_PTR pInterfacesList, /* returned interfaces */
CK_ULONG_PTR pulCount /* number of interfaces returned */
);
#endif
/* C_GetInterface returns a specific interface from the module. */
CK_PKCS11_FUNCTION_INFO(C_GetInterface)
#ifdef CK_NEED_ARG_LIST
(
CK_UTF8CHAR_PTR pInterfaceName, /* name of the interface */
CK_VERSION_PTR pVersion, /* version of the interface */
CK_INTERFACE_PTR_PTR ppInterface, /* returned interface */
CK_FLAGS flags /* flags controlling the semantics
* of the interface */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_LoginUser)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_USER_TYPE userType, /* the user type */
CK_UTF8CHAR_PTR pPin, /* the user's PIN */
CK_ULONG ulPinLen, /* the length of the PIN */
CK_UTF8CHAR_PTR pUsername, /* the user's name */
CK_ULONG ulUsernameLen /*the length of the user's name */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_SessionCancel)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_FLAGS flags /* flags control which sessions are cancelled */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageEncryptInit)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */
CK_OBJECT_HANDLE hKey /* handle of encryption key */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_EncryptMessage)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */
CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */
CK_BYTE_PTR pPlaintext, /* plain text */
CK_ULONG ulPlaintextLen, /* plain text length */
CK_BYTE_PTR pCiphertext, /* gets cipher text */
CK_ULONG_PTR pulCiphertextLen /* gets cipher text length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_EncryptMessageBegin)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */
CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_EncryptMessageNext)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pPlaintextPart, /* plain text */
CK_ULONG ulPlaintextPartLen, /* plain text length */
CK_BYTE_PTR pCiphertextPart, /* gets cipher text */
CK_ULONG_PTR pulCiphertextPartLen, /* gets cipher text length */
CK_FLAGS flags /* multi mode flag */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageEncryptFinal)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession /* the session's handle */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageDecryptInit)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */
CK_OBJECT_HANDLE hKey /* handle of decryption key */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_DecryptMessage)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */
CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */
CK_BYTE_PTR pCiphertext, /* cipher text */
CK_ULONG ulCiphertextLen, /* cipher text length */
CK_BYTE_PTR pPlaintext, /* gets plain text */
CK_ULONG_PTR pulPlaintextLen /* gets plain text length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_DecryptMessageBegin)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */
CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_DecryptMessageNext)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pCiphertextPart, /* cipher text */
CK_ULONG ulCiphertextPartLen, /* cipher text length */
CK_BYTE_PTR pPlaintextPart, /* gets plain text */
CK_ULONG_PTR pulPlaintextPartLen, /* gets plain text length */
CK_FLAGS flags /* multi mode flag */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageDecryptFinal)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession /* the session's handle */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageSignInit)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_MECHANISM_PTR pMechanism, /* the signing mechanism */
CK_OBJECT_HANDLE hKey /* handle of signing key */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_SignMessage)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pData, /* data to sign */
CK_ULONG ulDataLen, /* data to sign length */
CK_BYTE_PTR pSignature, /* gets signature */
CK_ULONG_PTR pulSignatureLen /* gets signature length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_SignMessageBegin)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen /* length of message specific parameter */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_SignMessageNext)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pData, /* data to sign */
CK_ULONG ulDataLen, /* data to sign length */
CK_BYTE_PTR pSignature, /* gets signature */
CK_ULONG_PTR pulSignatureLen /* gets signature length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageSignFinal)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession /* the session's handle */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageVerifyInit)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_MECHANISM_PTR pMechanism, /* the signing mechanism */
CK_OBJECT_HANDLE hKey /* handle of signing key */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_VerifyMessage)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pData, /* data to sign */
CK_ULONG ulDataLen, /* data to sign length */
CK_BYTE_PTR pSignature, /* signature */
CK_ULONG ulSignatureLen /* signature length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_VerifyMessageBegin)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen /* length of message specific parameter */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_VerifyMessageNext)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession, /* the session's handle */
CK_VOID_PTR pParameter, /* message specific parameter */
CK_ULONG ulParameterLen, /* length of message specific parameter */
CK_BYTE_PTR pData, /* data to sign */
CK_ULONG ulDataLen, /* data to sign length */
CK_BYTE_PTR pSignature, /* signature */
CK_ULONG ulSignatureLen /* signature length */
);
#endif
CK_PKCS11_FUNCTION_INFO(C_MessageVerifyFinal)
#ifdef CK_NEED_ARG_LIST
(
CK_SESSION_HANDLE hSession /* the session's handle */
);
#endif
#endif /* CK_PKCS11_2_0_ONLY */

File diff suppressed because it is too large Load Diff