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. /* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -54,7 +54,7 @@ import java.util.*;
import static sun.security.pkcs11.wrapper.PKCS11Constants.*; 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. * that are used by several classes in this package.
* *
* @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at> * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
@ -350,6 +350,12 @@ public class Functions {
private static final Flags mechanismInfoFlags = new Flags(new long[] { private static final Flags mechanismInfoFlags = new Flags(new long[] {
CKF_HW, CKF_HW,
CKF_MESSAGE_ENCRYPT,
CKF_MESSAGE_DECRYPT,
CKF_MESSAGE_SIGN,
CKF_MESSAGE_VERIFY,
CKF_MULTI_MESSAGE,
CKF_FIND_OBJECTS,
CKF_ENCRYPT, CKF_ENCRYPT,
CKF_DECRYPT, CKF_DECRYPT,
CKF_DIGEST, CKF_DIGEST,
@ -365,12 +371,19 @@ public class Functions {
CKF_EC_F_P, CKF_EC_F_P,
CKF_EC_F_2M, CKF_EC_F_2M,
CKF_EC_ECPARAMETERS, CKF_EC_ECPARAMETERS,
CKF_EC_NAMEDCURVE, CKF_EC_OID,
CKF_EC_UNCOMPRESS, CKF_EC_UNCOMPRESS,
CKF_EC_COMPRESS, CKF_EC_COMPRESS,
CKF_EC_CURVENAME,
CKF_EXTENSION, CKF_EXTENSION,
}, new String[] { }, new String[] {
"CKF_HW", "CKF_HW",
"CKF_MESSAGE_ENCRYPT",
"CKF_MESSAGE_DECRYPT",
"CKF_MESSAGE_SIGN",
"CKF_MESSAGE_VERIFY",
"CKF_MULTI_MESSAGE",
"CKF_FIND_OBJECTS",
"CKF_ENCRYPT", "CKF_ENCRYPT",
"CKF_DECRYPT", "CKF_DECRYPT",
"CKF_DIGEST", "CKF_DIGEST",
@ -386,9 +399,10 @@ public class Functions {
"CKF_EC_F_P", "CKF_EC_F_P",
"CKF_EC_F_2M", "CKF_EC_F_2M",
"CKF_EC_ECPARAMETERS", "CKF_EC_ECPARAMETERS",
"CKF_EC_NAMEDCURVE", "CKF_EC_OID",
"CKF_EC_UNCOMPRESS", "CKF_EC_UNCOMPRESS",
"CKF_EC_COMPRESS", "CKF_EC_COMPRESS",
"CKF_EC_CURVENAME",
"CKF_EXTENSION", "CKF_EXTENSION",
}); });
@ -624,6 +638,7 @@ public class Functions {
addMapping(mgfNames, mgfIds, id, name); addMapping(mgfNames, mgfIds, id, name);
} }
// The ordering here follows the PKCS11Constants class
static { static {
addMech(CKM_RSA_PKCS_KEY_PAIR_GEN, "CKM_RSA_PKCS_KEY_PAIR_GEN"); addMech(CKM_RSA_PKCS_KEY_PAIR_GEN, "CKM_RSA_PKCS_KEY_PAIR_GEN");
addMech(CKM_RSA_PKCS, "CKM_RSA_PKCS"); addMech(CKM_RSA_PKCS, "CKM_RSA_PKCS");
@ -647,6 +662,10 @@ public class Functions {
addMech(CKM_DSA_SHA256, "CKM_DSA_SHA256"); addMech(CKM_DSA_SHA256, "CKM_DSA_SHA256");
addMech(CKM_DSA_SHA384, "CKM_DSA_SHA384"); addMech(CKM_DSA_SHA384, "CKM_DSA_SHA384");
addMech(CKM_DSA_SHA512, "CKM_DSA_SHA512"); 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_KEY_PAIR_GEN, "CKM_DH_PKCS_KEY_PAIR_GEN");
addMech(CKM_DH_PKCS_DERIVE, "CKM_DH_PKCS_DERIVE"); 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, "CKM_SHA224_RSA_PKCS");
addMech(CKM_SHA224_RSA_PKCS_PSS, "CKM_SHA224_RSA_PKCS_PSS"); 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_KEY_GEN, "CKM_RC2_KEY_GEN");
addMech(CKM_RC2_ECB, "CKM_RC2_ECB"); addMech(CKM_RC2_ECB, "CKM_RC2_ECB");
addMech(CKM_RC2_CBC, "CKM_RC2_CBC"); addMech(CKM_RC2_CBC, "CKM_RC2_CBC");
@ -715,30 +756,18 @@ public class Functions {
addMech(CKM_RIPEMD160, "CKM_RIPEMD160"); addMech(CKM_RIPEMD160, "CKM_RIPEMD160");
addMech(CKM_RIPEMD160_HMAC, "CKM_RIPEMD160_HMAC"); addMech(CKM_RIPEMD160_HMAC, "CKM_RIPEMD160_HMAC");
addMech(CKM_RIPEMD160_HMAC_GENERAL, "CKM_RIPEMD160_HMAC_GENERAL"); 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, "CKM_SHA256");
addMech(CKM_SHA256_HMAC, "CKM_SHA256_HMAC"); addMech(CKM_SHA256_HMAC, "CKM_SHA256_HMAC");
addMech(CKM_SHA256_HMAC_GENERAL, "CKM_SHA256_HMAC_GENERAL"); 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, "CKM_SHA384");
addMech(CKM_SHA384_HMAC, "CKM_SHA384_HMAC"); addMech(CKM_SHA384_HMAC, "CKM_SHA384_HMAC");
addMech(CKM_SHA384_HMAC_GENERAL, "CKM_SHA384_HMAC_GENERAL"); addMech(CKM_SHA384_HMAC_GENERAL, "CKM_SHA384_HMAC_GENERAL");
addMech(CKM_SHA512, "CKM_SHA512"); addMech(CKM_SHA512, "CKM_SHA512");
addMech(CKM_SHA512_HMAC, "CKM_SHA512_HMAC"); addMech(CKM_SHA512_HMAC, "CKM_SHA512_HMAC");
addMech(CKM_SHA512_HMAC_GENERAL, "CKM_SHA512_HMAC_GENERAL"); 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_KEY_GEN, "CKM_SECURID_KEY_GEN");
addMech(CKM_SECURID, "CKM_SECURID"); addMech(CKM_SECURID, "CKM_SECURID");
@ -747,6 +776,23 @@ public class Functions {
addMech(CKM_ACTI, "CKM_ACTI"); addMech(CKM_ACTI, "CKM_ACTI");
addMech(CKM_ACTI_KEY_GEN, "CKM_ACTI_KEY_GEN"); 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_KEY_GEN, "CKM_CAST_KEY_GEN");
addMech(CKM_CAST_ECB, "CKM_CAST_ECB"); addMech(CKM_CAST_ECB, "CKM_CAST_ECB");
addMech(CKM_CAST_CBC, "CKM_CAST_CBC"); 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_MD5_KEY_DERIVATION, "CKM_MD5_KEY_DERIVATION");
addMech(CKM_MD2_KEY_DERIVATION, "CKM_MD2_KEY_DERIVATION"); addMech(CKM_MD2_KEY_DERIVATION, "CKM_MD2_KEY_DERIVATION");
addMech(CKM_SHA1_KEY_DERIVATION, "CKM_SHA1_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_SHA256_KEY_DERIVATION, "CKM_SHA256_KEY_DERIVATION");
addMech(CKM_SHA384_KEY_DERIVATION, "CKM_SHA384_KEY_DERIVATION"); addMech(CKM_SHA384_KEY_DERIVATION, "CKM_SHA384_KEY_DERIVATION");
addMech(CKM_SHA512_KEY_DERIVATION, "CKM_SHA512_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_MD2_DES_CBC, "CKM_PBE_MD2_DES_CBC");
addMech(CKM_PBE_MD5_DES_CBC, "CKM_PBE_MD5_DES_CBC"); addMech(CKM_PBE_MD5_DES_CBC, "CKM_PBE_MD5_DES_CBC");
addMech(CKM_PBE_MD5_CAST_CBC, "CKM_PBE_MD5_CAST_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_SHUFFLE, "CKM_BATON_SHUFFLE");
addMech(CKM_BATON_WRAP, "CKM_BATON_WRAP"); addMech(CKM_BATON_WRAP, "CKM_BATON_WRAP");
addMech(CKM_EC_KEY_PAIR_GEN, "CKM_EC_KEY_PAIR_GEN"); 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, "CKM_ECDSA");
addMech(CKM_ECDSA_SHA1, "CKM_ECDSA_SHA1"); addMech(CKM_ECDSA_SHA1, "CKM_ECDSA_SHA1");
addMech(CKM_ECDSA_SHA224, "CKM_ECDSA_SHA224"); addMech(CKM_ECDSA_SHA224, "CKM_ECDSA_SHA224");
addMech(CKM_ECDSA_SHA256, "CKM_ECDSA_SHA256"); addMech(CKM_ECDSA_SHA256, "CKM_ECDSA_SHA256");
addMech(CKM_ECDSA_SHA384, "CKM_ECDSA_SHA384"); addMech(CKM_ECDSA_SHA384, "CKM_ECDSA_SHA384");
addMech(CKM_ECDSA_SHA512, "CKM_ECDSA_SHA512"); 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_DERIVE, "CKM_ECDH1_DERIVE");
addMech(CKM_ECDH1_COFACTOR_DERIVE, "CKM_ECDH1_COFACTOR_DERIVE"); addMech(CKM_ECDH1_COFACTOR_DERIVE, "CKM_ECDH1_COFACTOR_DERIVE");
addMech(CKM_ECMQV_DERIVE, "CKM_ECMQV_DERIVE"); addMech(CKM_ECMQV_DERIVE, "CKM_ECMQV_DERIVE");
addMech(CKM_ECDH_AES_KEY_WRAP, "CKM_ECDH_AES_KEY_WRAP"); addMech(CKM_ECDH_AES_KEY_WRAP, "CKM_ECDH_AES_KEY_WRAP");
addMech(CKM_RSA_AES_KEY_WRAP, "CKM_RSA_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_KEY_GEN, "CKM_JUNIPER_KEY_GEN");
addMech(CKM_JUNIPER_ECB128, "CKM_JUNIPER_ECB128"); addMech(CKM_JUNIPER_ECB128, "CKM_JUNIPER_ECB128");
@ -914,6 +978,9 @@ public class Functions {
addMech(CKM_JUNIPER_SHUFFLE, "CKM_JUNIPER_SHUFFLE"); addMech(CKM_JUNIPER_SHUFFLE, "CKM_JUNIPER_SHUFFLE");
addMech(CKM_JUNIPER_WRAP, "CKM_JUNIPER_WRAP"); addMech(CKM_JUNIPER_WRAP, "CKM_JUNIPER_WRAP");
addMech(CKM_FASTHASH, "CKM_FASTHASH"); 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_KEY_GEN, "CKM_AES_KEY_GEN");
addMech(CKM_AES_ECB, "CKM_AES_ECB"); addMech(CKM_AES_ECB, "CKM_AES_ECB");
addMech(CKM_AES_CBC, "CKM_AES_CBC"); addMech(CKM_AES_CBC, "CKM_AES_CBC");
@ -956,6 +1023,10 @@ public class Functions {
addMech(CKM_GOST28147, "CKM_GOST28147"); addMech(CKM_GOST28147, "CKM_GOST28147");
addMech(CKM_GOST28147_MAC, "CKM_GOST28147_MAC"); addMech(CKM_GOST28147_MAC, "CKM_GOST28147_MAC");
addMech(CKM_GOST28147_KEY_WRAP, "CKM_GOST28147_KEY_WRAP"); 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_DSA_PARAMETER_GEN, "CKM_DSA_PARAMETER_GEN");
addMech(CKM_DH_PKCS_PARAMETER_GEN, "CKM_DH_PKCS_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"); "CKM_DSA_PROBABLISTIC_PARAMETER_GEN");
addMech(CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN, addMech(CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN,
"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_OFB, "CKM_AES_OFB");
addMech(CKM_AES_CFB64, "CKM_AES_CFB64"); addMech(CKM_AES_CFB64, "CKM_AES_CFB64");
addMech(CKM_AES_CFB8, "CKM_AES_CFB8"); addMech(CKM_AES_CFB8, "CKM_AES_CFB8");
@ -971,9 +1044,56 @@ public class Functions {
addMech(CKM_AES_CFB1, "CKM_AES_CFB1"); addMech(CKM_AES_CFB1, "CKM_AES_CFB1");
addMech(CKM_AES_KEY_WRAP, "CKM_AES_KEY_WRAP"); 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_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_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_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"); addMech(CKM_VENDOR_DEFINED, "CKM_VENDOR_DEFINED");
@ -989,6 +1109,10 @@ public class Functions {
addHashMech(CKM_SHA512, "SHA-512", "SHA512"); addHashMech(CKM_SHA512, "SHA-512", "SHA512");
addHashMech(CKM_SHA512_224, "SHA-512/224", "SHA512/224"); addHashMech(CKM_SHA512_224, "SHA-512/224", "SHA512/224");
addHashMech(CKM_SHA512_256, "SHA-512/256", "SHA512/256"); 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_RSA, "CKK_RSA");
addKeyType(CKK_DSA, "CKK_DSA"); addKeyType(CKK_DSA, "CKK_DSA");
@ -1031,6 +1155,27 @@ public class Functions {
addKeyType(CKK_GOSTR3410, "CKK_GOSTR3410"); addKeyType(CKK_GOSTR3410, "CKK_GOSTR3410");
addKeyType(CKK_GOSTR3411, "CKK_GOSTR3411"); addKeyType(CKK_GOSTR3411, "CKK_GOSTR3411");
addKeyType(CKK_GOST28147, "CKK_GOST28147"); 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"); addKeyType(CKK_VENDOR_DEFINED, "CKK_VENDOR_DEFINED");
@ -1040,6 +1185,7 @@ public class Functions {
addAttribute(CKA_TOKEN, "CKA_TOKEN"); addAttribute(CKA_TOKEN, "CKA_TOKEN");
addAttribute(CKA_PRIVATE, "CKA_PRIVATE"); addAttribute(CKA_PRIVATE, "CKA_PRIVATE");
addAttribute(CKA_LABEL, "CKA_LABEL"); addAttribute(CKA_LABEL, "CKA_LABEL");
addAttribute(CKA_UNIQUE_ID, "CKA_UNIQUE_ID");
addAttribute(CKA_APPLICATION, "CKA_APPLICATION"); addAttribute(CKA_APPLICATION, "CKA_APPLICATION");
addAttribute(CKA_VALUE, "CKA_VALUE"); addAttribute(CKA_VALUE, "CKA_VALUE");
addAttribute(CKA_OBJECT_ID, "CKA_OBJECT_ID"); addAttribute(CKA_OBJECT_ID, "CKA_OBJECT_ID");
@ -1154,6 +1300,24 @@ public class Functions {
addAttribute(CKA_SUPPORTED_CMS_ATTRIBUTES, addAttribute(CKA_SUPPORTED_CMS_ATTRIBUTES,
"CKA_SUPPORTED_CMS_ATTRIBUTES"); "CKA_SUPPORTED_CMS_ATTRIBUTES");
addAttribute(CKA_ALLOWED_MECHANISMS, "CKA_ALLOWED_MECHANISMS"); 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_VENDOR_DEFINED, "CKA_VENDOR_DEFINED");
addAttribute(CKA_NETSCAPE_DB, "CKA_NETSCAPE_DB"); addAttribute(CKA_NETSCAPE_DB, "CKA_NETSCAPE_DB");
@ -1172,6 +1336,9 @@ public class Functions {
addObjectClass(CKO_SECRET_KEY, "CKO_SECRET_KEY"); addObjectClass(CKO_SECRET_KEY, "CKO_SECRET_KEY");
addObjectClass(CKO_HW_FEATURE, "CKO_HW_FEATURE"); addObjectClass(CKO_HW_FEATURE, "CKO_HW_FEATURE");
addObjectClass(CKO_DOMAIN_PARAMETERS, "CKO_DOMAIN_PARAMETERS"); 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(CKO_VENDOR_DEFINED, "CKO_VENDOR_DEFINED");
addObjectClass(PCKO_ANY, "*"); addObjectClass(PCKO_ANY, "*");
@ -1181,6 +1348,10 @@ public class Functions {
addMGF(CKG_MGF1_SHA384, "CKG_MGF1_SHA384"); addMGF(CKG_MGF1_SHA384, "CKG_MGF1_SHA384");
addMGF(CKG_MGF1_SHA512, "CKG_MGF1_SHA512"); addMGF(CKG_MGF1_SHA512, "CKG_MGF1_SHA512");
addMGF(CKG_MGF1_SHA224, "CKG_MGF1_SHA224"); 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. /* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -48,7 +48,7 @@
package sun.security.pkcs11.wrapper; 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. * This is mainly the content of the 'pkcs11t.h' header file.
* *
* Mapping of primitiv data types to Java types: * Mapping of primitiv data types to Java types:
@ -62,11 +62,15 @@ package sun.security.pkcs11.wrapper;
* CK_ULONG ...................................... long * CK_ULONG ...................................... long
* CK_LONG ....................................... long * CK_LONG ....................................... long
* CK_FLAGS ...................................... 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_NOTIFICATION ............................... long
* CK_SLOT_ID .................................... long * CK_SLOT_ID .................................... long
* CK_SESSION_HANDLE ............................. long * CK_SESSION_HANDLE ............................. long
* CK_USER_TYPE .................................. long * CK_USER_TYPE .................................. long
* CK_SESSION_HANDLE ............................. long
* CK_STATE ...................................... long * CK_STATE ...................................... long
* CK_OBJECT_HANDLE .............................. long * CK_OBJECT_HANDLE .............................. long
* CK_OBJECT_CLASS ............................... long * CK_OBJECT_CLASS ............................... long
@ -74,21 +78,27 @@ package sun.security.pkcs11.wrapper;
* CK_KEY_TYPE ................................... long * CK_KEY_TYPE ................................... long
* CK_CERTIFICATE_TYPE ........................... long * CK_CERTIFICATE_TYPE ........................... long
* CK_ATTRIBUTE_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_MECHANISM_TYPE ............................. long
* CK_RV ......................................... 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_RSA_PKCS_OAEP_SOURCE_TYPE .................. long
* CK_EC_KDF_TYPE ................................ long
* CK_X9_42_DH_KDF_TYPE .......................... long
* CK_RC2_PARAMS ................................. long * CK_RC2_PARAMS ................................. long
* CK_MAC_GENERAL_PARAMS ......................... long * CK_MAC_GENERAL_PARAMS ......................... long
* CK_EXTRACT_PARAMS ............................. long * CK_EXTRACT_PARAMS ............................. long
* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE .... long * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE .... long
* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE .............. long * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE .............. long
* CK_EC_KDF_TYPE ................................ long * CK_OTP_PARAM_TYPE / CK_PARAM_TYPE ............. long
* CK_X9_42_DH_KDF_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> * </pre>
* *
* @author <a href="mailto:Karl.Scheibelhofer@iaik.at"> Karl Scheibelhofer </a> * @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_SECRET_KEY = 0x00000004L;
public static final long CKO_HW_FEATURE = 0x00000005L; public static final long CKO_HW_FEATURE = 0x00000005L;
public static final long CKO_DOMAIN_PARAMETERS = 0x00000006L; 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; public static final long CKO_VENDOR_DEFINED = 0x80000000L;
// pseudo object class ANY (for template manager) // pseudo object class ANY (for template manager)
public static final long PCKO_ANY = 0x7FFFFF23L; 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_MONOTONIC_COUNTER = 0x00000001L;
public static final long CKH_CLOCK = 0x00000002L; public static final long CKH_CLOCK = 0x00000002L;
public static final long CKH_USER_INTERFACE = 0x00000003L;
public static final long CKH_VENDOR_DEFINED = 0x80000000L; public static final long CKH_VENDOR_DEFINED = 0x80000000L;
*/
/* the following key types are defined: */ /* the following key types are defined: */
public static final long CKK_RSA = 0x00000000L; 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_GOSTR3410 = 0x00000030L;
public static final long CKK_GOSTR3411 = 0x00000031L; public static final long CKK_GOSTR3411 = 0x00000031L;
public static final long CKK_GOST28147 = 0x00000032L; 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; public static final long CKK_VENDOR_DEFINED = 0x80000000L;
// pseudo key type ANY (for template manager) // 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_TLSRSAPREMASTER = 0x7FFFFF26L;
public static final long PCKK_TLSMASTER = 0x7FFFFF27L; 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: */ /* The following certificate types are defined: */
public static final long CKC_X_509 = 0x00000000L; public static final long CKC_X_509 = 0x00000000L;
public static final long CKC_X_509_ATTR_CERT = 0x00000001L; 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; public static final long CKC_VENDOR_DEFINED = 0x80000000L;
/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which /* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which
@ -281,11 +340,23 @@ public interface PKCS11Constants {
*/ */
public static final long CKF_ARRAY_ATTRIBUTE = 0x40000000L; 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: */ /* The following attribute types are defined: */
public static final long CKA_CLASS = 0x00000000L; public static final long CKA_CLASS = 0x00000000L;
public static final long CKA_TOKEN = 0x00000001L; public static final long CKA_TOKEN = 0x00000001L;
public static final long CKA_PRIVATE = 0x00000002L; public static final long CKA_PRIVATE = 0x00000002L;
public static final long CKA_LABEL = 0x00000003L; 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_APPLICATION = 0x00000010L;
public static final long CKA_VALUE = 0x00000011L; public static final long CKA_VALUE = 0x00000011L;
public static final long CKA_OBJECT_ID = 0x00000012L; 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_BITS = 0x00000160L;
public static final long CKA_VALUE_LEN = 0x00000161L; public static final long CKA_VALUE_LEN = 0x00000161L;
public static final long CKA_EXTRACTABLE = 0x00000162L; public static final long CKA_EXTRACTABLE = 0x00000162L;
public static final long CKA_LOCAL = 0x00000163L; public static final long CKA_LOCAL = 0x00000163L;
public static final long CKA_NEVER_EXTRACTABLE = 0x00000164L; public static final long CKA_NEVER_EXTRACTABLE = 0x00000164L;
public static final long CKA_ALWAYS_SENSITIVE = 0x00000165L; public static final long CKA_ALWAYS_SENSITIVE = 0x00000165L;
public static final long CKA_KEY_GEN_MECHANISM = 0x00000166L; public static final long CKA_KEY_GEN_MECHANISM = 0x00000166L;
public static final long CKA_MODIFIABLE = 0x00000170L; 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_SUPPORTED_CMS_ATTRIBUTES = 0x00000503L;
public static final long CKA_ALLOWED_MECHANISMS = (CKF_ARRAY_ATTRIBUTE|0x00000600L); 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; public static final long CKA_VENDOR_DEFINED = 0x80000000L;
/* the following mechanism types are defined: */ /* 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_SHA256 = 0x00000014L;
public static final long CKM_DSA_SHA384 = 0x00000015L; public static final long CKM_DSA_SHA384 = 0x00000015L;
public static final long CKM_DSA_SHA512 = 0x00000016L; 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_KEY_PAIR_GEN = 0x00000020L;
public static final long CKM_DH_PKCS_DERIVE = 0x00000021L; 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_HMAC_GENERAL = 0x00000052L;
public static final long CKM_SHA512_T_KEY_DERIVATION = 0x00000053L; 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_KEY_GEN = 0x00000100L;
public static final long CKM_RC2_ECB = 0x00000101L; public static final long CKM_RC2_ECB = 0x00000101L;
public static final long CKM_RC2_CBC = 0x00000102L; 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 = 0x000002A0L;
public static final long CKM_ACTI_KEY_GEN = 0x000002A1L; 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_KEY_GEN = 0x00000300L;
public static final long CKM_CAST_ECB = 0x00000301L; public static final long CKM_CAST_ECB = 0x00000301L;
public static final long CKM_CAST_CBC = 0x00000302L; 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_MD5_KEY_DERIVATION = 0x00000390L;
public static final long CKM_MD2_KEY_DERIVATION = 0x00000391L; public static final long CKM_MD2_KEY_DERIVATION = 0x00000391L;
public static final long CKM_SHA1_KEY_DERIVATION = 0x00000392L; public static final long CKM_SHA1_KEY_DERIVATION = 0x00000392L;
public static final long CKM_SHA256_KEY_DERIVATION = 0x00000393L; public static final long CKM_SHA256_KEY_DERIVATION = 0x00000393L;
public static final long CKM_SHA384_KEY_DERIVATION = 0x00000394L; public static final long CKM_SHA384_KEY_DERIVATION = 0x00000394L;
public static final long CKM_SHA512_KEY_DERIVATION = 0x00000395L; public static final long CKM_SHA512_KEY_DERIVATION = 0x00000395L;
public static final long CKM_SHA224_KEY_DERIVATION = 0x00000396L; 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_MD2_DES_CBC = 0x000003A0L;
public static final long CKM_PBE_MD5_DES_CBC = 0x000003A1L; 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_CAST_CBC = 0x000003A2L;
public static final long CKM_PBE_MD5_CAST3_CBC = 0x000003A3L; 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_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_CAST128_CBC = 0x000003A5L;
public static final long CKM_PBE_SHA1_RC4_128 = 0x000003A6L; public static final long CKM_PBE_SHA1_RC4_128 = 0x000003A6L;
public static final long CKM_PBE_SHA1_RC4_40 = 0x000003A7L; 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_SERVER_KEY_AND_MAC_DERIVE = 0x000003D4L;
public static final long CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE = 0x000003D5L; 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_SERVER /*removed in 3.00*/
public static final long CKM_TLS10_MAC_CLIENT = 0x000003D7L; = 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_MAC = 0x000003D8L;
public static final long CKM_TLS12_KDF = 0x000003D9L; public static final long CKM_TLS12_KDF = 0x000003D9L;
public static final long CKM_TLS12_MASTER_KEY_DERIVE = 0x000003E0L; 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_KEY_AND_MAC_DERIVE = 0x000003E1L;
public static final long CKM_TLS12_MASTER_KEY_DERIVE_DH = 0x000003E2L; 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*/ public static final long CKM_ECDSA_KEY_PAIR_GEN /*deprecated*/
= 0x00001040L; = 0x00001040L;
public static final long CKM_EC_KEY_PAIR_GEN = 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 = 0x00001041L;
public static final long CKM_ECDSA_SHA1 = 0x00001042L; 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_SHA256 = 0x00001044L;
public static final long CKM_ECDSA_SHA384 = 0x00001045L; public static final long CKM_ECDSA_SHA384 = 0x00001045L;
public static final long CKM_ECDSA_SHA512 = 0x00001046L; 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_DERIVE = 0x00001050L;
public static final long CKM_ECDH1_COFACTOR_DERIVE = 0x00001051L; 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_ECDH_AES_KEY_WRAP = 0x00001053L;
public static final long CKM_RSA_AES_KEY_WRAP = 0x00001054L; 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_KEY_GEN = 0x00001060L;
public static final long CKM_JUNIPER_ECB128 = 0x00001061L; public static final long CKM_JUNIPER_ECB128 = 0x00001061L;
public static final long CKM_JUNIPER_CBC128 = 0x00001062L; 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_JUNIPER_WRAP = 0x00001065L;
public static final long CKM_FASTHASH = 0x00001070L; 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_KEY_GEN = 0x00001080L;
public static final long CKM_AES_ECB = 0x00001081L; public static final long CKM_AES_ECB = 0x00001081L;
public static final long CKM_AES_CBC = 0x00001082L; 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_MAC = 0x00001223L;
public static final long CKM_GOST28147_KEY_WRAP = 0x00001224L; 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_DSA_PARAMETER_GEN = 0x00002000L;
public static final long CKM_DH_PKCS_PARAMETER_GEN = 0x00002001L; 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_X9_42_DH_PARAMETER_GEN = 0x00002002L;
public static final long CKM_DSA_PROBABLISTIC_PARAMETER_GEN = 0x00002003L; 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_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_OFB = 0x00002104L;
public static final long CKM_AES_CFB64 = 0x00002105L; public static final long CKM_AES_CFB64 = 0x00002105L;
public static final long CKM_AES_CFB8 = 0x00002106L; public static final long CKM_AES_CFB8 = 0x00002106L;
public static final long CKM_AES_CFB128 = 0x00002107L; public static final long CKM_AES_CFB128 = 0x00002107L;
public static final long CKM_AES_CFB1 = 0x00002108L; 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 /* WAS: 0x00001090 */
public static final long CKM_AES_KEY_WRAP_PAD = 0x0000210AL; = 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_TPM_1_1 = 0x00004001L;
public static final long CKM_RSA_PKCS_OAEP_TPM_1_1 = 0x00004002L; 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; public static final long CKM_VENDOR_DEFINED = 0x80000000L;
// NSS private // NSS private
@ -813,6 +1007,13 @@ public interface PKCS11Constants {
/* The flags specify whether or not a mechanism can be used for a /* The flags specify whether or not a mechanism can be used for a
* particular task */ * particular task */
public static final long CKF_HW = 0x00000001L; 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_ENCRYPT = 0x00000100L;
public static final long CKF_DECRYPT = 0x00000200L; public static final long CKF_DECRYPT = 0x00000200L;
public static final long CKF_DIGEST = 0x00000400L; 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_P = 0x00100000L;
public static final long CKF_EC_F_2M = 0x00200000L; public static final long CKF_EC_F_2M = 0x00200000L;
public static final long CKF_EC_ECPARAMETERS = 0x00400000L; 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_UNCOMPRESS = 0x01000000L;
public static final long CKF_EC_COMPRESS = 0x02000000L; public static final long CKF_EC_COMPRESS = 0x02000000L;
public static final long CKF_EC_CURVENAME = 0x04000000L;
public static final long CKF_EXTENSION = 0x80000000L; public static final long CKF_EXTENSION = 0x80000000L;
/* Identifies the return value of a Cryptoki function */ /* Identifies the return value of a Cryptoki function */
public static final long CKR_OK = 0x00000000L; public static final long CKR_OK = 0x00000000L;
public static final long CKR_CANCEL = 0x00000001L; 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_DEVICE_REMOVED = 0x00000032L;
public static final long CKR_ENCRYPTED_DATA_INVALID = 0x00000040L; public static final long CKR_ENCRYPTED_DATA_INVALID = 0x00000040L;
public static final long CKR_ENCRYPTED_DATA_LEN_RANGE = 0x00000041L; 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_CANCELED = 0x00000050L;
public static final long CKR_FUNCTION_NOT_PARALLEL = 0x00000051L; 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_PIN_TOO_WEAK = 0x000001B8L;
public static final long CKR_PUBLIC_KEY_INVALID = 0x000001B9L; public static final long CKR_PUBLIC_KEY_INVALID = 0x000001B9L;
public static final long CKR_FUNCTION_REJECTED = 0x00000200L; 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; 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 /* flags: bit flags that provide capabilities of the slot
* Bit Flag = Mask * 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_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001L;
public static final long CKF_OS_LOCKING_OK = 0x00000002L; public static final long CKF_OS_LOCKING_OK = 0x00000002L;
/* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */
public static final long CKF_DONT_BLOCK = 1L; 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_SHA384 = 0x00000003L;
public static final long CKG_MGF1_SHA512 = 0x00000004L; public static final long CKG_MGF1_SHA512 = 0x00000004L;
public static final long CKG_MGF1_SHA224 = 0x00000005L; 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 */ /* The following encoding parameter sources are defined */
public static final long CKZ_DATA_SPECIFIED = 0x00000001L; 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_NULL = 0x00000001L;
public static final long CKD_SHA1_KDF = 0x00000002L; 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_ASN1 = 0x00000003L;
public static final long CKD_SHA1_KDF_CONCATENATE = 0x00000004L; public static final long CKD_SHA1_KDF_CONCATENATE = 0x00000004L;
public static final long CKD_SHA224_KDF = 0x00000005L; 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_SHA384_KDF = 0x00000007L;
public static final long CKD_SHA512_KDF = 0x00000008L; public static final long CKD_SHA512_KDF = 0x00000008L;
public static final long CKD_CPDIVERSIFY_KDF = 0x00000009L; 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_SHA1 = 0x00000001L;
public static final long CKP_PKCS5_PBKD2_HMAC_GOSTR3411 = 0x00000002L; 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_EXCLUDE_PIN = 0x00000010L;
public static final long CKF_USER_FRIENDLY_OTP = 0x00000020L; 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) // private NSS attribute (for DSA and DH private keys)
public static final long CKA_NETSCAPE_DB = 0xD5A0DB00L; public static final long CKA_NETSCAPE_DB = 0xD5A0DB00L;
// base number of NSS private attributes // 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 // 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 // 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 // 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_SERVER_AUTH = 0xCE536358L;
public static final long CKA_NETSCAPE_TRUST_CLIENT_AUTH = CKA_NETSCAPE_TRUST_BASE + 9; public static final long CKA_NETSCAPE_TRUST_CLIENT_AUTH = 0xCE536359L;
public static final long CKA_NETSCAPE_TRUST_CODE_SIGNING = CKA_NETSCAPE_TRUST_BASE + 10; public static final long CKA_NETSCAPE_TRUST_CODE_SIGNING = 0xCE53635AL;
public static final long CKA_NETSCAPE_TRUST_EMAIL_PROTECTION = CKA_NETSCAPE_TRUST_BASE + 11; public static final long CKA_NETSCAPE_TRUST_EMAIL_PROTECTION = 0xCE53635BL;
public static final long CKA_NETSCAPE_CERT_SHA1_HASH = CKA_NETSCAPE_TRUST_BASE + 100; public static final long CKA_NETSCAPE_CERT_SHA1_HASH = 0xCE5363B4L;
public static final long CKA_NETSCAPE_CERT_MD5_HASH = CKA_NETSCAPE_TRUST_BASE + 101; public static final long CKA_NETSCAPE_CERT_MD5_HASH = 0xCE5363B5L;
// trust values for each of the NSS trust attributes // 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 = 0xCE534351L;
public static final long CKT_NETSCAPE_TRUSTED_DELEGATOR = CKA_NETSCAPE_BASE + 2; public static final long CKT_NETSCAPE_TRUSTED_DELEGATOR = 0xCE534352L;
public static final long CKT_NETSCAPE_UNTRUSTED = CKA_NETSCAPE_BASE + 3; public static final long CKT_NETSCAPE_UNTRUSTED = 0xCE534353L;
public static final long CKT_NETSCAPE_MUST_VERIFY = CKA_NETSCAPE_BASE + 4; public static final long CKT_NETSCAPE_MUST_VERIFY = 0xCE534354L;
public static final long CKT_NETSCAPE_TRUST_UNKNOWN = CKA_NETSCAPE_BASE + 5; /* default */ public static final long CKT_NETSCAPE_TRUST_UNKNOWN /* default */
public static final long CKT_NETSCAPE_VALID = CKA_NETSCAPE_BASE + 10; = 0xCE534355L;
public static final long CKT_NETSCAPE_VALID_DELEGATOR = CKA_NETSCAPE_BASE + 11; 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. /* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -48,7 +48,7 @@
package sun.security.pkcs11.wrapper; package sun.security.pkcs11.wrapper;
import java.util.*; import java.util.*;
import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
/** /**
* This is the superclass of all checked exceptions used by this package. An * 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; private static final Map<Long,String> errorMap;
static { static {
int[] errorCodes = new int[] { long[] errorCodes = new long[] {
0x00000000, CKR_OK,
0x00000001, CKR_CANCEL,
0x00000002, CKR_HOST_MEMORY,
0x00000003, CKR_SLOT_ID_INVALID,
0x00000005, CKR_GENERAL_ERROR,
0x00000006, CKR_FUNCTION_FAILED,
0x00000007, CKR_ARGUMENTS_BAD,
0x00000008, CKR_NO_EVENT,
0x00000009, CKR_NEED_TO_CREATE_THREADS,
0x0000000A, CKR_CANT_LOCK,
0x00000010, CKR_ATTRIBUTE_READ_ONLY,
0x00000011, CKR_ATTRIBUTE_SENSITIVE,
0x00000012, CKR_ATTRIBUTE_TYPE_INVALID,
0x00000013, CKR_ATTRIBUTE_VALUE_INVALID,
0x0000001B, CKR_ACTION_PROHIBITED,
0x00000020, CKR_DATA_INVALID,
0x00000021, CKR_DATA_LEN_RANGE,
0x00000030, CKR_DEVICE_ERROR,
0x00000031, CKR_DEVICE_MEMORY,
0x00000032, CKR_DEVICE_REMOVED,
0x00000040, CKR_ENCRYPTED_DATA_INVALID,
0x00000041, CKR_ENCRYPTED_DATA_LEN_RANGE,
0x00000050, CKR_AEAD_DECRYPT_FAILED,
0x00000051, CKR_FUNCTION_CANCELED,
0x00000054, CKR_FUNCTION_NOT_PARALLEL,
0x00000060, CKR_FUNCTION_NOT_SUPPORTED,
0x00000062, CKR_KEY_HANDLE_INVALID,
0x00000063, CKR_KEY_SIZE_RANGE,
0x00000064, CKR_KEY_TYPE_INCONSISTENT,
0x00000065, CKR_KEY_NOT_NEEDED,
0x00000066, CKR_KEY_CHANGED,
0x00000067, CKR_KEY_NEEDED,
0x00000068, CKR_KEY_INDIGESTIBLE,
0x00000069, CKR_KEY_FUNCTION_NOT_PERMITTED,
0x0000006A, CKR_KEY_NOT_WRAPPABLE,
0x00000070, CKR_KEY_UNEXTRACTABLE,
0x00000071, CKR_MECHANISM_INVALID,
0x00000082, CKR_MECHANISM_PARAM_INVALID,
0x00000090, CKR_OBJECT_HANDLE_INVALID,
0x00000091, CKR_OPERATION_ACTIVE,
0x000000A0, CKR_OPERATION_NOT_INITIALIZED,
0x000000A1, CKR_PIN_INCORRECT,
0x000000A2, CKR_PIN_INVALID,
0x000000A3, CKR_PIN_LEN_RANGE,
0x000000A4, CKR_PIN_EXPIRED,
0x000000B0, CKR_PIN_LOCKED,
0x000000B1, CKR_SESSION_CLOSED,
0x000000B3, CKR_SESSION_COUNT,
0x000000B4, CKR_SESSION_HANDLE_INVALID,
0x000000B5, CKR_SESSION_PARALLEL_NOT_SUPPORTED,
0x000000B6, CKR_SESSION_READ_ONLY,
0x000000B7, CKR_SESSION_EXISTS,
0x000000B8, CKR_SESSION_READ_ONLY_EXISTS,
0x000000C0, CKR_SESSION_READ_WRITE_SO_EXISTS,
0x000000C1, CKR_SIGNATURE_INVALID,
0x000000D0, CKR_SIGNATURE_LEN_RANGE,
0x000000D1, CKR_TEMPLATE_INCOMPLETE,
0x000000E0, CKR_TEMPLATE_INCONSISTENT,
0x000000E1, CKR_TOKEN_NOT_PRESENT,
0x000000E2, CKR_TOKEN_NOT_RECOGNIZED,
0x000000F0, CKR_TOKEN_WRITE_PROTECTED,
0x000000F1, CKR_UNWRAPPING_KEY_HANDLE_INVALID,
0x000000F2, CKR_UNWRAPPING_KEY_SIZE_RANGE,
0x00000100, CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT,
0x00000101, CKR_USER_ALREADY_LOGGED_IN,
0x00000102, CKR_USER_NOT_LOGGED_IN,
0x00000103, CKR_USER_PIN_NOT_INITIALIZED,
0x00000104, CKR_USER_TYPE_INVALID,
0x00000105, CKR_USER_ANOTHER_ALREADY_LOGGED_IN,
0x00000110, CKR_USER_TOO_MANY_TYPES,
0x00000112, CKR_WRAPPED_KEY_INVALID,
0x00000113, CKR_WRAPPED_KEY_LEN_RANGE,
0x00000114, CKR_WRAPPING_KEY_HANDLE_INVALID,
0x00000115, CKR_WRAPPING_KEY_SIZE_RANGE,
0x00000120, CKR_WRAPPING_KEY_TYPE_INCONSISTENT,
0x00000121, CKR_RANDOM_SEED_NOT_SUPPORTED,
0x00000130, CKR_RANDOM_NO_RNG,
0x00000150, CKR_DOMAIN_PARAMS_INVALID,
0x00000160, CKR_CURVE_NOT_SUPPORTED,
0x00000170, CKR_BUFFER_TOO_SMALL,
0x00000180, CKR_SAVED_STATE_INVALID,
0x00000190, CKR_INFORMATION_SENSITIVE,
0x00000191, CKR_STATE_UNSAVEABLE,
0x000001A0, CKR_CRYPTOKI_NOT_INITIALIZED,
0x000001A1, CKR_CRYPTOKI_ALREADY_INITIALIZED,
0x000001B0, CKR_MUTEX_BAD,
0x000001B1, CKR_MUTEX_NOT_LOCKED,
0x000001B5, CKR_NEW_PIN_MODE,
0x000001B6, CKR_NEXT_OTP,
0x000001B7, CKR_EXCEEDED_MAX_ITERATIONS,
0x000001B8, CKR_FIPS_SELF_TEST_FAILED,
0x000001B9, CKR_LIBRARY_LOAD_FAILED,
0x00000200, CKR_PIN_TOO_WEAK,
0x80000000, CKR_PUBLIC_KEY_INVALID,
CKR_FUNCTION_REJECTED,
CKR_TOKEN_RESOURCE_EXCEEDED,
CKR_OPERATION_CANCEL_FAILED,
CKR_VENDOR_DEFINED,
}; };
String[] errorMessages = new String[] { String[] errorMessages = new String[] {
"CKR_OK", "CKR_OK",
@ -192,6 +196,7 @@ public class PKCS11Exception extends Exception {
"CKR_DEVICE_REMOVED", "CKR_DEVICE_REMOVED",
"CKR_ENCRYPTED_DATA_INVALID", "CKR_ENCRYPTED_DATA_INVALID",
"CKR_ENCRYPTED_DATA_LEN_RANGE", "CKR_ENCRYPTED_DATA_LEN_RANGE",
"CKR_AEAD_DECRYPT_FAILED",
"CKR_FUNCTION_CANCELED", "CKR_FUNCTION_CANCELED",
"CKR_FUNCTION_NOT_PARALLEL", "CKR_FUNCTION_NOT_PARALLEL",
"CKR_FUNCTION_NOT_SUPPORTED", "CKR_FUNCTION_NOT_SUPPORTED",
@ -247,6 +252,7 @@ public class PKCS11Exception extends Exception {
"CKR_RANDOM_SEED_NOT_SUPPORTED", "CKR_RANDOM_SEED_NOT_SUPPORTED",
"CKR_RANDOM_NO_RNG", "CKR_RANDOM_NO_RNG",
"CKR_DOMAIN_PARAMS_INVALID", "CKR_DOMAIN_PARAMS_INVALID",
"CKR_CURVE_NOT_SUPPORTED",
"CKR_BUFFER_TOO_SMALL", "CKR_BUFFER_TOO_SMALL",
"CKR_SAVED_STATE_INVALID", "CKR_SAVED_STATE_INVALID",
"CKR_INFORMATION_SENSITIVE", "CKR_INFORMATION_SENSITIVE",
@ -263,6 +269,8 @@ public class PKCS11Exception extends Exception {
"CKR_PIN_TOO_WEAK", "CKR_PIN_TOO_WEAK",
"CKR_PUBLIC_KEY_INVALID", "CKR_PUBLIC_KEY_INVALID",
"CKR_FUNCTION_REJECTED", "CKR_FUNCTION_REJECTED",
"CKR_TOKEN_RESOURCE_EXCEEDED",
"CKR_OPERATION_CANCEL_FAILED",
"CKR_VENDOR_DEFINED", "CKR_VENDOR_DEFINED",
}; };
errorMap = new HashMap<Long,String>(); 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 ### 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 All capitalized terms in the following text have the meanings
Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the assigned to them in the OASIS Intellectual Property Rights Policy (the
OASIS website: [http://www.oasis-open.org/policies-guidelines/ipr] "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 This document and translations of it may be copied and furnished to
that comment on or otherwise explain it or assist in its implementation may be prepared, copied, others, and derivative works that comment on or otherwise explain it or
published, and distributed, in whole or in part, without restriction of any kind, provided that assist in its implementation may be prepared, copied, published, and
the above copyright notice and this section are included on all such copies and derivative works. distributed, in whole or in part, without restriction of any kind,
However, this document itself may not be modified in any way, including by removing the copyright provided that the above copyright notice and this section are included
notice or references to OASIS, except as needed for the purpose of developing any document or on all such copies and derivative works. However, this document itself
deliverable produced by an OASIS Technical Committee (in which case the rules applicable to may not be modified in any way, including by removing the copyright
copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it notice or references to OASIS, except as needed for the purpose of
into languages other than English. 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 The limited permissions granted above are perpetual and will not be
successors or assigns. revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and OASIS This document and the information contained herein is provided on an
DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS AND ITS MEMBERS WILL NOT BE LIABLE FOR INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED
ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS
ANY PART THEREOF. 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./ /* Copyright (c) OASIS Open 2016-2019. All Rights Reserved.
* /Distributed under the terms of the OASIS IPR Policy, * Distributed under the terms of the OASIS IPR Policy,
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY * [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 * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. * 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_ #ifndef _PKCS11_H_
#define _PKCS11_H_ 1 #define _PKCS11_H_ 1
@ -29,8 +25,7 @@ extern "C" {
* convention on packing is that structures should be 1-byte * convention on packing is that structures should be 1-byte
* aligned. * aligned.
* *
* If you're using Microsoft Developer Studio 5.0 to produce * If you're using Windows this might be done by using the following
* Win32 stuff, this might be done by using the following
* preprocessor directive before including pkcs11.h or pkcs11t.h: * preprocessor directive before including pkcs11.h or pkcs11t.h:
* *
* #pragma pack(push, cryptoki, 1) * #pragma pack(push, cryptoki, 1)
@ -40,13 +35,6 @@ extern "C" {
* *
* #pragma pack(pop, cryptoki) * #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 * In a UNIX environment, you're on your own for this. You might
* not need to do (or be able to do!) anything. * not need to do (or be able to do!) anything.
* *
@ -59,16 +47,10 @@ extern "C" {
* *
* typedef CK_BYTE CK_PTR CK_BYTE_PTR; * typedef CK_BYTE CK_PTR CK_BYTE_PTR;
* *
* If you're using Microsoft Developer Studio 5.0 to produce * If you're using windows, it might be defined by:
* Win32 stuff, it might be defined by:
* *
* #define CK_PTR * * #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: * In a typical UNIX environment, it might be defined by:
* *
* #define CK_PTR * * #define CK_PTR *
@ -83,19 +65,12 @@ extern "C" {
* CK_VOID_PTR pReserved * CK_VOID_PTR pReserved
* ); * );
* *
* If you're using Microsoft Developer Studio 5.0 to declare a * If you're using Windows to declare a function in a Win32 cryptoki .dll,
* function in a Win32 Cryptoki .dll, it might be defined by: * it might be defined by:
* *
* #define CK_DECLARE_FUNCTION(returnType, name) \ * #define CK_DECLARE_FUNCTION(returnType, name) \
* returnType __declspec(dllimport) 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: * In a UNIX environment, it might be defined by:
* *
* #define CK_DECLARE_FUNCTION(returnType, name) \ * #define CK_DECLARE_FUNCTION(returnType, name) \
@ -120,19 +95,12 @@ extern "C" {
* typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args); * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args);
* funcPtrType funcPtr; * 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: * functions in a Win32 Cryptoki .dll, in might be defined by:
* *
* #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
* returnType __declspec(dllimport) (* 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: * In a UNIX environment, it might be defined by:
* *
* #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
@ -153,18 +121,11 @@ extern "C" {
* typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args); * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args);
* myCallbackType myCallback; * myCallbackType myCallback;
* *
* If you're using Microsoft Developer Studio 5.0 to do Win32 * If you're using Windows, it might be defined by:
* Cryptoki development, it might be defined by:
* *
* #define CK_CALLBACK_FUNCTION(returnType, name) \ * #define CK_CALLBACK_FUNCTION(returnType, name) \
* 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: * In a UNIX environment, it might be defined by:
* *
* #define CK_CALLBACK_FUNCTION(returnType, name) \ * #define CK_CALLBACK_FUNCTION(returnType, name) \
@ -240,6 +201,22 @@ extern "C" {
#define CK_PKCS11_FUNCTION_INFO(name) \ #define CK_PKCS11_FUNCTION_INFO(name) \
__PASTE(CK_,name) 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 { struct CK_FUNCTION_LIST {
CK_VERSION version; /* Cryptoki version */ CK_VERSION version; /* Cryptoki version */
@ -253,6 +230,7 @@ struct CK_FUNCTION_LIST {
}; };
#undef CK_PKCS11_FUNCTION_INFO #undef CK_PKCS11_FUNCTION_INFO
#undef CK_PKCS11_2_0_ONLY
#undef __PASTE #undef __PASTE
@ -263,3 +241,4 @@ struct CK_FUNCTION_LIST {
#endif /* _PKCS11_H_ */ #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, * /Distributed under the terms of the OASIS IPR Policy,
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY * [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 * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
@ -937,3 +937,261 @@ CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent)
); );
#endif #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 */

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, * /Distributed under the terms of the OASIS IPR Policy,
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY * [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 * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
@ -17,8 +17,8 @@
#ifndef _PKCS11T_H_ #ifndef _PKCS11T_H_
#define _PKCS11T_H_ 1 #define _PKCS11T_H_ 1
#define CRYPTOKI_VERSION_MAJOR 2 #define CRYPTOKI_VERSION_MAJOR 3
#define CRYPTOKI_VERSION_MINOR 40 #define CRYPTOKI_VERSION_MINOR 0
#define CRYPTOKI_VERSION_AMENDMENT 0 #define CRYPTOKI_VERSION_AMENDMENT 0
#define CK_TRUE 1 #define CK_TRUE 1
@ -317,11 +317,20 @@ typedef CK_ULONG CK_OBJECT_CLASS;
#define CKO_DOMAIN_PARAMETERS 0x00000006UL #define CKO_DOMAIN_PARAMETERS 0x00000006UL
#define CKO_MECHANISM 0x00000007UL #define CKO_MECHANISM 0x00000007UL
#define CKO_OTP_KEY 0x00000008UL #define CKO_OTP_KEY 0x00000008UL
#define CKO_PROFILE 0x00000009UL
#define CKO_VENDOR_DEFINED 0x80000000UL #define CKO_VENDOR_DEFINED 0x80000000UL
typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR;
/* Profile ID's */
#define CKP_INVALID_ID 0x00000000UL
#define CKP_BASELINE_PROVIDER 0x00000001UL
#define CKP_EXTENDED_PROVIDER 0x00000002UL
#define CKP_AUTHENTICATION_TOKEN 0x00000003UL
#define CKP_PUBLIC_CERTIFICATES_TOKEN 0x00000004UL
#define CKP_VENDOR_DEFINED 0x80000000UL
/* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type /* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type
* of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. * of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE.
*/ */
@ -369,6 +378,8 @@ typedef CK_ULONG CK_KEY_TYPE;
#define CKK_CAMELLIA 0x00000025UL #define CKK_CAMELLIA 0x00000025UL
#define CKK_ARIA 0x00000026UL #define CKK_ARIA 0x00000026UL
/* the following definitions were added in the 2.30 header file,
* but never defined in the spec. */
#define CKK_MD5_HMAC 0x00000027UL #define CKK_MD5_HMAC 0x00000027UL
#define CKK_SHA_1_HMAC 0x00000028UL #define CKK_SHA_1_HMAC 0x00000028UL
#define CKK_RIPEMD128_HMAC 0x00000029UL #define CKK_RIPEMD128_HMAC 0x00000029UL
@ -382,8 +393,25 @@ typedef CK_ULONG CK_KEY_TYPE;
#define CKK_GOSTR3410 0x00000030UL #define CKK_GOSTR3410 0x00000030UL
#define CKK_GOSTR3411 0x00000031UL #define CKK_GOSTR3411 0x00000031UL
#define CKK_GOST28147 0x00000032UL #define CKK_GOST28147 0x00000032UL
#define CKK_CHACHA20 0x00000033UL
#define CKK_POLY1305 0x00000034UL
#define CKK_AES_XTS 0x00000035UL
#define CKK_SHA3_224_HMAC 0x00000036UL
#define CKK_SHA3_256_HMAC 0x00000037UL
#define CKK_SHA3_384_HMAC 0x00000038UL
#define CKK_SHA3_512_HMAC 0x00000039UL
#define CKK_BLAKE2B_160_HMAC 0x0000003aUL
#define CKK_BLAKE2B_256_HMAC 0x0000003bUL
#define CKK_BLAKE2B_384_HMAC 0x0000003cUL
#define CKK_BLAKE2B_512_HMAC 0x0000003dUL
#define CKK_SALSA20 0x0000003eUL
#define CKK_X2RATCHET 0x0000003fUL
#define CKK_EC_EDWARDS 0x00000040UL
#define CKK_EC_MONTGOMERY 0x00000041UL
#define CKK_HKDF 0x00000042UL
#define CKK_SHA512_224_HMAC 0x00000043UL
#define CKK_SHA512_256_HMAC 0x00000044UL
#define CKK_SHA512_T_HMAC 0x00000045UL
#define CKK_VENDOR_DEFINED 0x80000000UL #define CKK_VENDOR_DEFINED 0x80000000UL
@ -439,6 +467,7 @@ typedef CK_ULONG CK_ATTRIBUTE_TYPE;
#define CKA_TOKEN 0x00000001UL #define CKA_TOKEN 0x00000001UL
#define CKA_PRIVATE 0x00000002UL #define CKA_PRIVATE 0x00000002UL
#define CKA_LABEL 0x00000003UL #define CKA_LABEL 0x00000003UL
#define CKA_UNIQUE_ID 0x00000004UL
#define CKA_APPLICATION 0x00000010UL #define CKA_APPLICATION 0x00000010UL
#define CKA_VALUE 0x00000011UL #define CKA_VALUE 0x00000011UL
#define CKA_OBJECT_ID 0x00000012UL #define CKA_OBJECT_ID 0x00000012UL
@ -556,6 +585,24 @@ typedef CK_ULONG CK_ATTRIBUTE_TYPE;
#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL #define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL
#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL #define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL
#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600UL) #define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600UL)
#define CKA_PROFILE_ID 0x00000601UL
#define CKA_X2RATCHET_BAG 0x00000602UL
#define CKA_X2RATCHET_BAGSIZE 0x00000603UL
#define CKA_X2RATCHET_BOBS1STMSG 0x00000604UL
#define CKA_X2RATCHET_CKR 0x00000605UL
#define CKA_X2RATCHET_CKS 0x00000606UL
#define CKA_X2RATCHET_DHP 0x00000607UL
#define CKA_X2RATCHET_DHR 0x00000608UL
#define CKA_X2RATCHET_DHS 0x00000609UL
#define CKA_X2RATCHET_HKR 0x0000060aUL
#define CKA_X2RATCHET_HKS 0x0000060bUL
#define CKA_X2RATCHET_ISALICE 0x0000060cUL
#define CKA_X2RATCHET_NHKR 0x0000060dUL
#define CKA_X2RATCHET_NHKS 0x0000060eUL
#define CKA_X2RATCHET_NR 0x0000060fUL
#define CKA_X2RATCHET_NS 0x00000610UL
#define CKA_X2RATCHET_PNS 0x00000611UL
#define CKA_X2RATCHET_RK 0x00000612UL
#define CKA_VENDOR_DEFINED 0x80000000UL #define CKA_VENDOR_DEFINED 0x80000000UL
@ -610,6 +657,10 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_DSA_SHA256 0x00000014UL #define CKM_DSA_SHA256 0x00000014UL
#define CKM_DSA_SHA384 0x00000015UL #define CKM_DSA_SHA384 0x00000015UL
#define CKM_DSA_SHA512 0x00000016UL #define CKM_DSA_SHA512 0x00000016UL
#define CKM_DSA_SHA3_224 0x00000018UL
#define CKM_DSA_SHA3_256 0x00000019UL
#define CKM_DSA_SHA3_384 0x0000001AUL
#define CKM_DSA_SHA3_512 0x0000001BUL
#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL #define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
#define CKM_DH_PKCS_DERIVE 0x00000021UL #define CKM_DH_PKCS_DERIVE 0x00000021UL
@ -643,6 +694,15 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL #define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL
#define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL #define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL
#define CKM_SHA3_256_RSA_PKCS 0x00000060UL
#define CKM_SHA3_384_RSA_PKCS 0x00000061UL
#define CKM_SHA3_512_RSA_PKCS 0x00000062UL
#define CKM_SHA3_256_RSA_PKCS_PSS 0x00000063UL
#define CKM_SHA3_384_RSA_PKCS_PSS 0x00000064UL
#define CKM_SHA3_512_RSA_PKCS_PSS 0x00000065UL
#define CKM_SHA3_224_RSA_PKCS 0x00000066UL
#define CKM_SHA3_224_RSA_PKCS_PSS 0x00000067UL
#define CKM_RC2_KEY_GEN 0x00000100UL #define CKM_RC2_KEY_GEN 0x00000100UL
#define CKM_RC2_ECB 0x00000101UL #define CKM_RC2_ECB 0x00000101UL
#define CKM_RC2_CBC 0x00000102UL #define CKM_RC2_CBC 0x00000102UL
@ -724,6 +784,24 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_ACTI 0x000002A0UL #define CKM_ACTI 0x000002A0UL
#define CKM_ACTI_KEY_GEN 0x000002A1UL #define CKM_ACTI_KEY_GEN 0x000002A1UL
#define CKM_SHA3_256 0x000002B0UL
#define CKM_SHA3_256_HMAC 0x000002B1UL
#define CKM_SHA3_256_HMAC_GENERAL 0x000002B2UL
#define CKM_SHA3_256_KEY_GEN 0x000002B3UL
#define CKM_SHA3_224 0x000002B5UL
#define CKM_SHA3_224_HMAC 0x000002B6UL
#define CKM_SHA3_224_HMAC_GENERAL 0x000002B7UL
#define CKM_SHA3_224_KEY_GEN 0x000002B8UL
#define CKM_SHA3_384 0x000002C0UL
#define CKM_SHA3_384_HMAC 0x000002C1UL
#define CKM_SHA3_384_HMAC_GENERAL 0x000002C2UL
#define CKM_SHA3_384_KEY_GEN 0x000002C3UL
#define CKM_SHA3_512 0x000002D0UL
#define CKM_SHA3_512_HMAC 0x000002D1UL
#define CKM_SHA3_512_HMAC_GENERAL 0x000002D2UL
#define CKM_SHA3_512_KEY_GEN 0x000002D3UL
#define CKM_CAST_KEY_GEN 0x00000300UL #define CKM_CAST_KEY_GEN 0x00000300UL
#define CKM_CAST_ECB 0x00000301UL #define CKM_CAST_ECB 0x00000301UL
#define CKM_CAST_CBC 0x00000302UL #define CKM_CAST_CBC 0x00000302UL
@ -789,6 +867,18 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_SHA384_KEY_DERIVATION 0x00000394UL #define CKM_SHA384_KEY_DERIVATION 0x00000394UL
#define CKM_SHA512_KEY_DERIVATION 0x00000395UL #define CKM_SHA512_KEY_DERIVATION 0x00000395UL
#define CKM_SHA224_KEY_DERIVATION 0x00000396UL #define CKM_SHA224_KEY_DERIVATION 0x00000396UL
#define CKM_SHA3_256_KEY_DERIVATION 0x00000397UL
#define CKM_SHA3_224_KEY_DERIVATION 0x00000398UL
#define CKM_SHA3_384_KEY_DERIVATION 0x00000399UL
#define CKM_SHA3_512_KEY_DERIVATION 0x0000039AUL
#define CKM_SHAKE_128_KEY_DERIVATION 0x0000039BUL
#define CKM_SHAKE_256_KEY_DERIVATION 0x0000039CUL
#define CKM_SHA3_256_KEY_DERIVE CKM_SHA3_256_KEY_DERIVATION
#define CKM_SHA3_224_KEY_DERIVE CKM_SHA3_224_KEY_DERIVATION
#define CKM_SHA3_384_KEY_DERIVE CKM_SHA3_384_KEY_DERIVATION
#define CKM_SHA3_512_KEY_DERIVE CKM_SHA3_512_KEY_DERIVATION
#define CKM_SHAKE_128_KEY_DERIVE CKM_SHAKE_128_KEY_DERIVATION
#define CKM_SHAKE_256_KEY_DERIVE CKM_SHAKE_256_KEY_DERIVATION
#define CKM_PBE_MD2_DES_CBC 0x000003A0UL #define CKM_PBE_MD2_DES_CBC 0x000003A0UL
#define CKM_PBE_MD5_DES_CBC 0x000003A1UL #define CKM_PBE_MD5_DES_CBC 0x000003A1UL
@ -816,8 +906,6 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL #define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL
#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL #define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL
#define CKM_TLS10_MAC_SERVER 0x000003D6UL
#define CKM_TLS10_MAC_CLIENT 0x000003D7UL
#define CKM_TLS12_MAC 0x000003D8UL #define CKM_TLS12_MAC 0x000003D8UL
#define CKM_TLS12_KDF 0x000003D9UL #define CKM_TLS12_KDF 0x000003D9UL
#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL #define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL
@ -895,6 +983,7 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_ECDSA_SHA256 0x00001044UL #define CKM_ECDSA_SHA256 0x00001044UL
#define CKM_ECDSA_SHA384 0x00001045UL #define CKM_ECDSA_SHA384 0x00001045UL
#define CKM_ECDSA_SHA512 0x00001046UL #define CKM_ECDSA_SHA512 0x00001046UL
#define CKM_EC_KEY_PAIR_GEN_W_EXTRA_BITS 0x0000140BUL
#define CKM_ECDH1_DERIVE 0x00001050UL #define CKM_ECDH1_DERIVE 0x00001050UL
#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL #define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL
@ -911,6 +1000,8 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_JUNIPER_WRAP 0x00001065UL #define CKM_JUNIPER_WRAP 0x00001065UL
#define CKM_FASTHASH 0x00001070UL #define CKM_FASTHASH 0x00001070UL
#define CKM_AES_XTS 0x00001071UL
#define CKM_AES_XTS_KEY_GEN 0x00001072UL
#define CKM_AES_KEY_GEN 0x00001080UL #define CKM_AES_KEY_GEN 0x00001080UL
#define CKM_AES_ECB 0x00001081UL #define CKM_AES_ECB 0x00001081UL
#define CKM_AES_CBC 0x00001082UL #define CKM_AES_CBC 0x00001082UL
@ -954,12 +1045,17 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_GOST28147 0x00001222UL #define CKM_GOST28147 0x00001222UL
#define CKM_GOST28147_MAC 0x00001223UL #define CKM_GOST28147_MAC 0x00001223UL
#define CKM_GOST28147_KEY_WRAP 0x00001224UL #define CKM_GOST28147_KEY_WRAP 0x00001224UL
#define CKM_CHACHA20_KEY_GEN 0x00001225UL
#define CKM_CHACHA20 0x00001226UL
#define CKM_POLY1305_KEY_GEN 0x00001227UL
#define CKM_POLY1305 0x00001228UL
#define CKM_DSA_PARAMETER_GEN 0x00002000UL #define CKM_DSA_PARAMETER_GEN 0x00002000UL
#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL #define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL
#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL #define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL
#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN 0x00002003UL #define CKM_DSA_PROBABILISTIC_PARAMETER_GEN 0x00002003UL
#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN CKM_DSA_PROBABILISTIC_PARAMETER_GEN
#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL #define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL
#define CKM_DSA_FIPS_G_GEN 0x00002005UL
#define CKM_AES_OFB 0x00002104UL #define CKM_AES_OFB 0x00002104UL
#define CKM_AES_CFB64 0x00002105UL #define CKM_AES_CFB64 0x00002105UL
@ -969,10 +1065,66 @@ typedef CK_ULONG CK_MECHANISM_TYPE;
#define CKM_AES_CFB1 0x00002108UL #define CKM_AES_CFB1 0x00002108UL
#define CKM_AES_KEY_WRAP 0x00002109UL /* WAS: 0x00001090 */ #define CKM_AES_KEY_WRAP 0x00002109UL /* WAS: 0x00001090 */
#define CKM_AES_KEY_WRAP_PAD 0x0000210AUL /* WAS: 0x00001091 */ #define CKM_AES_KEY_WRAP_PAD 0x0000210AUL /* WAS: 0x00001091 */
#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL
#define CKM_RSA_PKCS_TPM_1_1 0x00004001UL #define CKM_RSA_PKCS_TPM_1_1 0x00004001UL
#define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL #define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL
#define CKM_SHA_1_KEY_GEN 0x00004003UL
#define CKM_SHA224_KEY_GEN 0x00004004UL
#define CKM_SHA256_KEY_GEN 0x00004005UL
#define CKM_SHA384_KEY_GEN 0x00004006UL
#define CKM_SHA512_KEY_GEN 0x00004007UL
#define CKM_SHA512_224_KEY_GEN 0x00004008UL
#define CKM_SHA512_256_KEY_GEN 0x00004009UL
#define CKM_SHA512_T_KEY_GEN 0x0000400aUL
#define CKM_NULL 0x0000400bUL
#define CKM_BLAKE2B_160 0x0000400cUL
#define CKM_BLAKE2B_160_HMAC 0x0000400dUL
#define CKM_BLAKE2B_160_HMAC_GENERAL 0x0000400eUL
#define CKM_BLAKE2B_160_KEY_DERIVE 0x0000400fUL
#define CKM_BLAKE2B_160_KEY_GEN 0x00004010UL
#define CKM_BLAKE2B_256 0x00004011UL
#define CKM_BLAKE2B_256_HMAC 0x00004012UL
#define CKM_BLAKE2B_256_HMAC_GENERAL 0x00004013UL
#define CKM_BLAKE2B_256_KEY_DERIVE 0x00004014UL
#define CKM_BLAKE2B_256_KEY_GEN 0x00004015UL
#define CKM_BLAKE2B_384 0x00004016UL
#define CKM_BLAKE2B_384_HMAC 0x00004017UL
#define CKM_BLAKE2B_384_HMAC_GENERAL 0x00004018UL
#define CKM_BLAKE2B_384_KEY_DERIVE 0x00004019UL
#define CKM_BLAKE2B_384_KEY_GEN 0x0000401aUL
#define CKM_BLAKE2B_512 0x0000401bUL
#define CKM_BLAKE2B_512_HMAC 0x0000401cUL
#define CKM_BLAKE2B_512_HMAC_GENERAL 0x0000401dUL
#define CKM_BLAKE2B_512_KEY_DERIVE 0x0000401eUL
#define CKM_BLAKE2B_512_KEY_GEN 0x0000401fUL
#define CKM_SALSA20 0x00004020UL
#define CKM_CHACHA20_POLY1305 0x00004021UL
#define CKM_SALSA20_POLY1305 0x00004022UL
#define CKM_X3DH_INITIALIZE 0x00004023UL
#define CKM_X3DH_RESPOND 0x00004024UL
#define CKM_X2RATCHET_INITIALIZE 0x00004025UL
#define CKM_X2RATCHET_RESPOND 0x00004026UL
#define CKM_X2RATCHET_ENCRYPT 0x00004027UL
#define CKM_X2RATCHET_DECRYPT 0x00004028UL
#define CKM_XEDDSA 0x00004029UL
#define CKM_HKDF_DERIVE 0x0000402aUL
#define CKM_HKDF_DATA 0x0000402bUL
#define CKM_HKDF_KEY_GEN 0x0000402cUL
#define CKM_SALSA20_KEY_GEN 0x0000402dUL
#define CKM_ECDSA_SHA3_224 0x00001047UL
#define CKM_ECDSA_SHA3_256 0x00001048UL
#define CKM_ECDSA_SHA3_384 0x00001049UL
#define CKM_ECDSA_SHA3_512 0x0000104aUL
#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
#define CKM_EC_MONTGOMERY_KEY_PAIR_GEN 0x00001056UL
#define CKM_EDDSA 0x00001057UL
#define CKM_SP800_108_COUNTER_KDF 0x000003acUL
#define CKM_SP800_108_FEEDBACK_KDF 0x000003adUL
#define CKM_SP800_108_DOUBLE_PIPELINE_KDF 0x000003aeUL
#define CKM_VENDOR_DEFINED 0x80000000UL #define CKM_VENDOR_DEFINED 0x80000000UL
typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR;
@ -1004,6 +1156,14 @@ typedef struct CK_MECHANISM_INFO {
#define CKF_HW 0x00000001UL /* performed by HW */ #define CKF_HW 0x00000001UL /* performed by HW */
/* Specify whether or not a mechanism can be used for a particular task */ /* Specify whether or not a mechanism can be used for a particular task */
#define CKF_MESSAGE_ENCRYPT 0x00000002UL
#define CKF_MESSAGE_DECRYPT 0x00000004UL
#define CKF_MESSAGE_SIGN 0x00000008UL
#define CKF_MESSAGE_VERIFY 0x00000010UL
#define CKF_MULTI_MESSAGE 0x00000020UL
#define CKF_MULTI_MESSGE CKF_MULTI_MESSAGE
#define CKF_FIND_OBJECTS 0x00000040UL
#define CKF_ENCRYPT 0x00000100UL #define CKF_ENCRYPT 0x00000100UL
#define CKF_DECRYPT 0x00000200UL #define CKF_DECRYPT 0x00000200UL
#define CKF_DIGEST 0x00000400UL #define CKF_DIGEST 0x00000400UL
@ -1023,9 +1183,11 @@ typedef struct CK_MECHANISM_INFO {
#define CKF_EC_F_P 0x00100000UL #define CKF_EC_F_P 0x00100000UL
#define CKF_EC_F_2M 0x00200000UL #define CKF_EC_F_2M 0x00200000UL
#define CKF_EC_ECPARAMETERS 0x00400000UL #define CKF_EC_ECPARAMETERS 0x00400000UL
#define CKF_EC_NAMEDCURVE 0x00800000UL #define CKF_EC_OID 0x00800000UL
#define CKF_EC_NAMEDCURVE CKF_EC_OID /* deprecated since PKCS#11 3.00 */
#define CKF_EC_UNCOMPRESS 0x01000000UL #define CKF_EC_UNCOMPRESS 0x01000000UL
#define CKF_EC_COMPRESS 0x02000000UL #define CKF_EC_COMPRESS 0x02000000UL
#define CKF_EC_CURVENAME 0x04000000UL
#define CKF_EXTENSION 0x80000000UL #define CKF_EXTENSION 0x80000000UL
@ -1063,6 +1225,7 @@ typedef CK_ULONG CK_RV;
#define CKR_DEVICE_REMOVED 0x00000032UL #define CKR_DEVICE_REMOVED 0x00000032UL
#define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL #define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL
#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL #define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL
#define CKR_AEAD_DECRYPT_FAILED 0x00000042UL
#define CKR_FUNCTION_CANCELED 0x00000050UL #define CKR_FUNCTION_CANCELED 0x00000050UL
#define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL #define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL
@ -1155,6 +1318,8 @@ typedef CK_ULONG CK_RV;
#define CKR_PUBLIC_KEY_INVALID 0x000001B9UL #define CKR_PUBLIC_KEY_INVALID 0x000001B9UL
#define CKR_FUNCTION_REJECTED 0x00000200UL #define CKR_FUNCTION_REJECTED 0x00000200UL
#define CKR_TOKEN_RESOURCE_EXCEEDED 0x00000201UL
#define CKR_OPERATION_CANCEL_FAILED 0x00000202UL
#define CKR_VENDOR_DEFINED 0x80000000UL #define CKR_VENDOR_DEFINED 0x80000000UL
@ -1172,10 +1337,24 @@ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)(
* Cryptoki functions * Cryptoki functions
*/ */
typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST;
typedef struct CK_FUNCTION_LIST_3_0 CK_FUNCTION_LIST_3_0;
typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR;
typedef CK_FUNCTION_LIST_3_0 CK_PTR CK_FUNCTION_LIST_3_0_PTR;
typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR;
typedef CK_FUNCTION_LIST_3_0_PTR CK_PTR CK_FUNCTION_LIST_3_0_PTR_PTR;
typedef struct CK_INTERFACE {
CK_CHAR *pInterfaceName;
CK_VOID_PTR pFunctionList;
CK_FLAGS flags;
} CK_INTERFACE;
typedef CK_INTERFACE CK_PTR CK_INTERFACE_PTR;
typedef CK_INTERFACE_PTR CK_PTR CK_INTERFACE_PTR_PTR;
#define CKF_END_OF_MESSAGE 0x00000001UL
/* CK_CREATEMUTEX is an application callback for creating a /* CK_CREATEMUTEX is an application callback for creating a
@ -1207,6 +1386,8 @@ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)(
CK_VOID_PTR pMutex /* pointer to mutex */ CK_VOID_PTR pMutex /* pointer to mutex */
); );
/* Get functionlist flags */
#define CKF_INTERFACE_FORK_SAFE 0x00000001UL
/* CK_C_INITIALIZE_ARGS provides the optional arguments to /* CK_C_INITIALIZE_ARGS provides the optional arguments to
* C_Initialize * C_Initialize
@ -1229,6 +1410,7 @@ typedef struct CK_C_INITIALIZE_ARGS {
typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR;
/* additional flags for parameters to functions */ /* additional flags for parameters to functions */
/* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */
@ -1249,6 +1431,10 @@ typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR;
#define CKG_MGF1_SHA384 0x00000003UL #define CKG_MGF1_SHA384 0x00000003UL
#define CKG_MGF1_SHA512 0x00000004UL #define CKG_MGF1_SHA512 0x00000004UL
#define CKG_MGF1_SHA224 0x00000005UL #define CKG_MGF1_SHA224 0x00000005UL
#define CKG_MGF1_SHA3_224 0x00000006UL
#define CKG_MGF1_SHA3_256 0x00000007UL
#define CKG_MGF1_SHA3_384 0x00000008UL
#define CKG_MGF1_SHA3_512 0x00000009UL
/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source /* CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source
* of the encoding parameter when formatting a message block * of the encoding parameter when formatting a message block
@ -1286,6 +1472,7 @@ typedef struct CK_RSA_PKCS_PSS_PARAMS {
typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR; typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR;
typedef CK_ULONG CK_EC_KDF_TYPE; typedef CK_ULONG CK_EC_KDF_TYPE;
typedef CK_EC_KDF_TYPE CK_PTR CK_EC_KDF_TYPE_PTR;
/* The following EC Key Derivation Functions are defined */ /* The following EC Key Derivation Functions are defined */
#define CKD_NULL 0x00000001UL #define CKD_NULL 0x00000001UL
@ -1299,7 +1486,23 @@ typedef CK_ULONG CK_EC_KDF_TYPE;
#define CKD_SHA384_KDF 0x00000007UL #define CKD_SHA384_KDF 0x00000007UL
#define CKD_SHA512_KDF 0x00000008UL #define CKD_SHA512_KDF 0x00000008UL
#define CKD_CPDIVERSIFY_KDF 0x00000009UL #define CKD_CPDIVERSIFY_KDF 0x00000009UL
#define CKD_SHA3_224_KDF 0x0000000AUL
#define CKD_SHA3_256_KDF 0x0000000BUL
#define CKD_SHA3_384_KDF 0x0000000CUL
#define CKD_SHA3_512_KDF 0x0000000DUL
#define CKD_SHA1_KDF_SP800 0x0000000EUL
#define CKD_SHA224_KDF_SP800 0x0000000FUL
#define CKD_SHA256_KDF_SP800 0x00000010UL
#define CKD_SHA384_KDF_SP800 0x00000011UL
#define CKD_SHA512_KDF_SP800 0x00000012UL
#define CKD_SHA3_224_KDF_SP800 0x00000013UL
#define CKD_SHA3_256_KDF_SP800 0x00000014UL
#define CKD_SHA3_384_KDF_SP800 0x00000015UL
#define CKD_SHA3_512_KDF_SP800 0x00000016UL
#define CKD_BLAKE2B_160_KDF 0x00000017UL
#define CKD_BLAKE2B_256_KDF 0x00000018UL
#define CKD_BLAKE2B_384_KDF 0x00000019UL
#define CKD_BLAKE2B_512_KDF 0x0000001aUL
/* CK_ECDH1_DERIVE_PARAMS provides the parameters to the /* CK_ECDH1_DERIVE_PARAMS provides the parameters to the
* CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms, * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms,
@ -1498,7 +1701,8 @@ typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS {
CK_ULONG length; CK_ULONG length;
} CK_DES_CBC_ENCRYPT_DATA_PARAMS; } CK_DES_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR; typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR \
CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR;
typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS {
CK_BYTE iv[16]; CK_BYTE iv[16];
@ -1506,7 +1710,8 @@ typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS {
CK_ULONG length; CK_ULONG length;
} CK_AES_CBC_ENCRYPT_DATA_PARAMS; } CK_AES_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR \
CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR;
/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the
* CKM_SKIPJACK_PRIVATE_WRAP mechanism * CKM_SKIPJACK_PRIVATE_WRAP mechanism
@ -1841,6 +2046,23 @@ typedef struct CK_GCM_PARAMS {
typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR;
typedef CK_ULONG CK_GENERATOR_FUNCTION;
#define CKG_NO_GENERATE 0x00000000UL
#define CKG_GENERATE 0x00000001UL
#define CKG_GENERATE_COUNTER 0x00000002UL
#define CKG_GENERATE_RANDOM 0x00000003UL
typedef struct CK_GCM_MESSAGE_PARAMS {
CK_BYTE_PTR pIv;
CK_ULONG ulIvLen;
CK_ULONG ulIvFixedBits;
CK_GENERATOR_FUNCTION ivGenerator;
CK_BYTE_PTR pTag;
CK_ULONG ulTagBits;
} CK_GCM_MESSAGE_PARAMS;
typedef CK_GCM_MESSAGE_PARAMS CK_GCM_MESSAGE_PARAMS_PTR;
typedef struct CK_CCM_PARAMS { typedef struct CK_CCM_PARAMS {
CK_ULONG ulDataLen; CK_ULONG ulDataLen;
CK_BYTE_PTR pNonce; CK_BYTE_PTR pNonce;
@ -1852,6 +2074,18 @@ typedef struct CK_CCM_PARAMS {
typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR;
typedef struct CK_CCM_MESSAGE_PARAMS {
CK_ULONG ulDataLen; /*plaintext or ciphertext*/
CK_BYTE_PTR pNonce;
CK_ULONG ulNonceLen;
CK_ULONG ulNonceFixedBits;
CK_GENERATOR_FUNCTION nonceGenerator;
CK_BYTE_PTR pMAC;
CK_ULONG ulMACLen;
} CK_CCM_MESSAGE_PARAMS;
typedef CK_CCM_MESSAGE_PARAMS CK_CCM_MESSAGE_PARAMS_PTR;
/* Deprecated. Use CK_GCM_PARAMS */ /* Deprecated. Use CK_GCM_PARAMS */
typedef struct CK_AES_GCM_PARAMS { typedef struct CK_AES_GCM_PARAMS {
CK_BYTE_PTR pIv; CK_BYTE_PTR pIv;
@ -1999,6 +2233,212 @@ typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS {
typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \
CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR; CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR;
/*
* New PKCS 11 v3.0 data structures.
*/
typedef CK_ULONG CK_PROFILE_ID;
typedef CK_PROFILE_ID CK_PTR CK_PROFILE_ID_PTR;
/* Typedefs for Flexible KDF */
typedef CK_ULONG CK_PRF_DATA_TYPE;
typedef CK_MECHANISM_TYPE CK_SP800_108_PRF_TYPE;
#define CK_SP800_108_ITERATION_VARIABLE 0x00000001UL
#define CK_SP800_108_OPTIONAL_COUNTER 0x00000002UL
#define CK_SP800_108_DKM_LENGTH 0x00000003UL
#define CK_SP800_108_BYTE_ARRAY 0x00000004UL
#define CK_SP800_108_COUNTER CK_SP800_108_OPTIONAL_COUNTER
typedef struct CK_PRF_DATA_PARAM
{
CK_PRF_DATA_TYPE type;
CK_VOID_PTR pValue;
CK_ULONG ulValueLen;
} CK_PRF_DATA_PARAM;
typedef CK_PRF_DATA_PARAM CK_PTR CK_PRF_DATA_PARAM_PTR;
typedef struct CK_SP800_108_COUNTER_FORMAT
{
CK_BBOOL bLittleEndian;
CK_ULONG ulWidthInBits;
} CK_SP800_108_COUNTER_FORMAT;
typedef CK_SP800_108_COUNTER_FORMAT CK_PTR CK_SP800_108_COUNTER_FORMAT_PTR;
typedef CK_ULONG CK_SP800_108_DKM_LENGTH_METHOD;
#define CK_SP800_108_DKM_LENGTH_SUM_OF_KEYS 0x00000001UL
#define CK_SP800_108_DKM_LENGTH_SUM_OF_SEGMENTS 0x00000002UL
typedef struct CK_SP800_108_DKM_LENGTH_FORMAT
{
CK_SP800_108_DKM_LENGTH_METHOD dkmLengthMethod;
CK_BBOOL bLittleEndian;
CK_ULONG ulWidthInBits;
} CK_SP800_108_DKM_LENGTH_FORMAT;
typedef CK_SP800_108_DKM_LENGTH_FORMAT \
CK_PTR CK_SP800_108_DKM_LENGTH_FORMAT_PTR;
typedef struct CK_DERIVED_KEY
{
CK_ATTRIBUTE_PTR pTemplate;
CK_ULONG ulAttributeCount;
CK_OBJECT_HANDLE_PTR phKey;
} CK_DERIVED_KEY;
typedef CK_DERIVED_KEY CK_PTR CK_DERIVED_KEY_PTR;
typedef struct CK_SP800_108_KDF_PARAMS
{
CK_SP800_108_PRF_TYPE prfType;
CK_ULONG ulNumberOfDataParams;
CK_PRF_DATA_PARAM_PTR pDataParams;
CK_ULONG ulAdditionalDerivedKeys;
CK_DERIVED_KEY_PTR pAdditionalDerivedKeys;
} CK_SP800_108_KDF_PARAMS;
typedef CK_SP800_108_KDF_PARAMS CK_PTR CK_SP800_108_KDF_PARAMS_PTR;
typedef struct CK_SP800_108_FEEDBACK_KDF_PARAMS
{
CK_SP800_108_PRF_TYPE prfType;
CK_ULONG ulNumberOfDataParams;
CK_PRF_DATA_PARAM_PTR pDataParams;
CK_ULONG ulIVLen;
CK_BYTE_PTR pIV;
CK_ULONG ulAdditionalDerivedKeys;
CK_DERIVED_KEY_PTR pAdditionalDerivedKeys;
} CK_SP800_108_FEEDBACK_KDF_PARAMS;
typedef CK_SP800_108_FEEDBACK_KDF_PARAMS \
CK_PTR CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR;
/* EDDSA */
typedef struct CK_EDDSA_PARAMS {
CK_BBOOL phFlag;
CK_ULONG ulContextDataLen;
CK_BYTE_PTR pContextData;
} CK_EDDSA_PARAMS;
typedef CK_EDDSA_PARAMS CK_PTR CK_EDDSA_PARAMS_PTR;
/* Extended ChaCha20/Salsa20 support*/
typedef struct CK_CHACHA20_PARAMS {
CK_BYTE_PTR pBlockCounter;
CK_ULONG blockCounterBits;
CK_BYTE_PTR pNonce;
CK_ULONG ulNonceBits;
} CK_CHACHA20_PARAMS;
typedef CK_CHACHA20_PARAMS CK_PTR CK_CHACHA20_PARAMS_PTR;
typedef struct CK_SALSA20_PARAMS {
CK_BYTE_PTR pBlockCounter;
CK_BYTE_PTR pNonce;
CK_ULONG ulNonceBits;
} CK_SALSA20_PARAMS;
typedef CK_SALSA20_PARAMS CK_PTR CK_SALSA20_PARAMS_PTR;
typedef struct CK_SALSA20_CHACHA20_POLY1305_PARAMS {
CK_BYTE_PTR pNonce;
CK_ULONG ulNonceLen;
CK_BYTE_PTR pAAD;
CK_ULONG ulAADLen;
} CK_SALSA20_CHACHA20_POLY1305_PARAMS;
typedef CK_SALSA20_CHACHA20_POLY1305_PARAMS \
CK_PTR CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR;
typedef struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS {
CK_BYTE_PTR pNonce;
CK_ULONG ulNonceLen;
CK_BYTE_PTR pTag;
} CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS;
typedef CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS \
CK_PTR CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR;
typedef CK_ULONG CK_X3DH_KDF_TYPE;
typedef CK_X3DH_KDF_TYPE CK_PTR CK_X3DH_KDF_TYPE_PTR;
/* X3dh, ratchet */
typedef struct CK_X3DH_INITIATE_PARAMS {
CK_X3DH_KDF_TYPE kdf;
CK_OBJECT_HANDLE pPeer_identity;
CK_OBJECT_HANDLE pPeer_prekey;
CK_BYTE_PTR pPrekey_signature;
CK_BYTE_PTR pOnetime_key;
CK_OBJECT_HANDLE pOwn_identity;
CK_OBJECT_HANDLE pOwn_ephemeral;
} CK_X3DH_INITIATE_PARAMS;
typedef struct CK_X3DH_RESPOND_PARAMS {
CK_X3DH_KDF_TYPE kdf;
CK_BYTE_PTR pIdentity_id;
CK_BYTE_PTR pPrekey_id;
CK_BYTE_PTR pOnetime_id;
CK_OBJECT_HANDLE pInitiator_identity;
CK_BYTE_PTR pInitiator_ephemeral;
} CK_X3DH_RESPOND_PARAMS;
typedef CK_ULONG CK_X2RATCHET_KDF_TYPE;
typedef CK_X2RATCHET_KDF_TYPE CK_PTR CK_X2RATCHET_KDF_TYPE_PTR;
typedef struct CK_X2RATCHET_INITIALIZE_PARAMS {
CK_BYTE_PTR sk;
CK_OBJECT_HANDLE peer_public_prekey;
CK_OBJECT_HANDLE peer_public_identity;
CK_OBJECT_HANDLE own_public_identity;
CK_BBOOL bEncryptedHeader;
CK_ULONG eCurve;
CK_MECHANISM_TYPE aeadMechanism;
CK_X2RATCHET_KDF_TYPE kdfMechanism;
} CK_X2RATCHET_INITIALIZE_PARAMS;
typedef CK_X2RATCHET_INITIALIZE_PARAMS \
CK_PTR CK_X2RATCHET_INITIALIZE_PARAMS_PTR;
typedef struct CK_X2RATCHET_RESPOND_PARAMS {
CK_BYTE_PTR sk;
CK_OBJECT_HANDLE own_prekey;
CK_OBJECT_HANDLE initiator_identity;
CK_OBJECT_HANDLE own_public_identity;
CK_BBOOL bEncryptedHeader;
CK_ULONG eCurve;
CK_MECHANISM_TYPE aeadMechanism;
CK_X2RATCHET_KDF_TYPE kdfMechanism;
} CK_X2RATCHET_RESPOND_PARAMS;
typedef CK_X2RATCHET_RESPOND_PARAMS \
CK_PTR CK_X2RATCHET_RESPOND_PARAMS_PTR;
typedef CK_ULONG CK_XEDDSA_HASH_TYPE;
typedef CK_XEDDSA_HASH_TYPE CK_PTR CK_XEDDSA_HASH_TYPE_PTR;
/* XEDDSA */
typedef struct CK_XEDDSA_PARAMS {
CK_XEDDSA_HASH_TYPE hash;
} CK_XEDDSA_PARAMS;
typedef CK_XEDDSA_PARAMS CK_PTR CK_XEDDSA_PARAMS_PTR;
typedef struct CK_HKDF_PARAMS {
CK_BBOOL bExtract;
CK_BBOOL bExpand;
CK_MECHANISM_TYPE prfHashMechanism;
CK_ULONG ulSaltType;
CK_BYTE_PTR pSalt;
CK_ULONG ulSaltLen;
CK_OBJECT_HANDLE hSaltKey;
CK_BYTE_PTR pInfo;
CK_ULONG ulInfoLen;
} CK_HKDF_PARAMS;
typedef CK_HKDF_PARAMS CK_PTR CK_HKDF_PARAMS_PTR;
#define CKF_HKDF_SALT_NULL 0x00000001UL
#define CKF_HKDF_SALT_DATA 0x00000002UL
#define CKF_HKDF_SALT_KEY 0x00000004UL
#endif /* _PKCS11T_H_ */ #endif /* _PKCS11T_H_ */