Botan 2.19.3
Crypto and TLS for C&
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
p11.h File Reference
#include <botan/secmem.h>
#include <botan/exceptn.h>
#include <vector>
#include <string>
#include <map>
#include "pkcs11.h"

Go to the source code of this file.

Classes

class  Botan::PKCS11::LowLevel
 Provides access to all PKCS#11 functions. More...
 
class  Botan::PKCS11::PKCS11_Error
 
class  Botan::PKCS11::PKCS11_ReturnError
 

Namespaces

namespace  Botan
 
namespace  Botan::PKCS11
 

Macros

#define CK_CALLBACK_FUNCTION(returnType, name)    returnType (* name)
 
#define CK_DECLARE_FUNCTION(returnType, name)    returnType name
 
#define CK_DECLARE_FUNCTION_POINTER(returnType, name)    returnType (* name)
 
#define CK_PTR   *
 
#define NULL_PTR   nullptr
 

Typedefs

using Botan::PKCS11::Attribute = CK_ATTRIBUTE
 
using Botan::PKCS11::Bbool = CK_BBOOL
 
using Botan::PKCS11::Byte = CK_BYTE
 
using Botan::PKCS11::C_InitializeArgs = CK_C_INITIALIZE_ARGS
 
using Botan::PKCS11::CreateMutex = CK_CREATEMUTEX
 
using Botan::PKCS11::Date = CK_DATE
 
using Botan::PKCS11::DestroyMutex = CK_DESTROYMUTEX
 
using Botan::PKCS11::Ecdh1DeriveParams = CK_ECDH1_DERIVE_PARAMS
 
using Botan::PKCS11::Flags = CK_FLAGS
 
using Botan::PKCS11::FunctionListPtr = CK_FUNCTION_LIST_PTR
 
using Botan::PKCS11::Info = CK_INFO
 
using Botan::PKCS11::LockMutex = CK_LOCKMUTEX
 
using Botan::PKCS11::Mechanism = CK_MECHANISM
 
using Botan::PKCS11::MechanismInfo = CK_MECHANISM_INFO
 
using Botan::PKCS11::Notify = CK_NOTIFY
 
using Botan::PKCS11::ObjectHandle = CK_OBJECT_HANDLE
 
using Botan::PKCS11::RsaPkcsOaepParams = CK_RSA_PKCS_OAEP_PARAMS
 
using Botan::PKCS11::RsaPkcsPssParams = CK_RSA_PKCS_PSS_PARAMS
 
using Botan::PKCS11::secure_string = secure_vector< uint8_t >
 
using Botan::PKCS11::SessionHandle = CK_SESSION_HANDLE
 
using Botan::PKCS11::SessionInfo = CK_SESSION_INFO
 
using Botan::PKCS11::SlotId = CK_SLOT_ID
 
using Botan::PKCS11::SlotInfo = CK_SLOT_INFO
 
using Botan::PKCS11::TokenInfo = CK_TOKEN_INFO
 
using Botan::PKCS11::Ulong = CK_ULONG
 
using Botan::PKCS11::UnlockMutex = CK_UNLOCKMUTEX
 
using Botan::PKCS11::Utf8Char = CK_UTF8CHAR
 
using Botan::PKCS11::VoidPtr = CK_VOID_PTR
 

Enumerations

enum class  Botan::PKCS11::AttributeType : CK_ATTRIBUTE_TYPE {
  Botan::PKCS11::Class = 0x00000000UL , Botan::PKCS11::Token = 0x00000001UL , Botan::PKCS11::Private = 0x00000002UL , Botan::PKCS11::Label = 0x00000003UL ,
  Botan::PKCS11::Application = 0x00000010UL , Botan::PKCS11::Value = 0x00000011UL , Botan::PKCS11::ObjectId = 0x00000012UL , Botan::PKCS11::CertificateType = 0x00000080UL ,
  Botan::PKCS11::Issuer = 0x00000081UL , Botan::PKCS11::SerialNumber = 0x00000082UL , Botan::PKCS11::AcIssuer = 0x00000083UL , Botan::PKCS11::Owner = 0x00000084UL ,
  Botan::PKCS11::AttrTypes = 0x00000085UL , Botan::PKCS11::Trusted = 0x00000086UL , Botan::PKCS11::CertificateCategory = 0x00000087UL , Botan::PKCS11::JavaMidpSecurityDomain = 0x00000088UL ,
  Botan::PKCS11::Url = 0x00000089UL , Botan::PKCS11::HashOfSubjectPublicKey = 0x0000008AUL , Botan::PKCS11::HashOfIssuerPublicKey = 0x0000008BUL , Botan::PKCS11::NameHashAlgorithm = 0x0000008CUL ,
  Botan::PKCS11::CheckValue = 0x00000090UL , Botan::PKCS11::KeyType = 0x00000100UL , Botan::PKCS11::Subject = 0x00000101UL , Botan::PKCS11::Id = 0x00000102UL ,
  Botan::PKCS11::Sensitive = 0x00000103UL , Botan::PKCS11::Encrypt = 0x00000104UL , Botan::PKCS11::Decrypt = 0x00000105UL , Botan::PKCS11::Wrap = 0x00000106UL ,
  Botan::PKCS11::Unwrap = 0x00000107UL , Botan::PKCS11::Sign = 0x00000108UL , Botan::PKCS11::SignRecover = 0x00000109UL , Botan::PKCS11::Verify = 0x0000010AUL ,
  Botan::PKCS11::VerifyRecover = 0x0000010BUL , Botan::PKCS11::Derive = 0x0000010CUL , Botan::PKCS11::StartDate = 0x00000110UL , Botan::PKCS11::EndDate = 0x00000111UL ,
  Botan::PKCS11::Modulus = 0x00000120UL , Botan::PKCS11::ModulusBits = 0x00000121UL , Botan::PKCS11::PublicExponent = 0x00000122UL , Botan::PKCS11::PrivateExponent = 0x00000123UL ,
  Botan::PKCS11::Prime1 = 0x00000124UL , Botan::PKCS11::Prime2 = 0x00000125UL , Botan::PKCS11::Exponent1 = 0x00000126UL , Botan::PKCS11::Exponent2 = 0x00000127UL ,
  Botan::PKCS11::Coefficient = 0x00000128UL , Botan::PKCS11::PublicKeyInfo = 0x00000129UL , Botan::PKCS11::Prime = 0x00000130UL , Botan::PKCS11::Subprime = 0x00000131UL ,
  Botan::PKCS11::Base = 0x00000132UL , Botan::PKCS11::PrimeBits = 0x00000133UL , Botan::PKCS11::SubprimeBits = 0x00000134UL , Botan::PKCS11::SubPrimeBits = 0x00000134UL ,
  Botan::PKCS11::ValueBits = 0x00000160UL , Botan::PKCS11::ValueLen = 0x00000161UL , Botan::PKCS11::Extractable = 0x00000162UL , Botan::PKCS11::Local = 0x00000163UL ,
  Botan::PKCS11::NeverExtractable = 0x00000164UL , Botan::PKCS11::AlwaysSensitive = 0x00000165UL , Botan::PKCS11::KeyGenMechanism = 0x00000166UL , Botan::PKCS11::Modifiable = 0x00000170UL ,
  Botan::PKCS11::Copyable = 0x00000171UL , Botan::PKCS11::Destroyable = 0x00000172UL , Botan::PKCS11::EcdsaParams = 0x00000180UL , Botan::PKCS11::EcParams = 0x00000180UL ,
  Botan::PKCS11::EcPoint = 0x00000181UL , Botan::PKCS11::SecondaryAuth = 0x00000200UL , Botan::PKCS11::AuthPinFlags = 0x00000201UL , Botan::PKCS11::AlwaysAuthenticate = 0x00000202UL ,
  Botan::PKCS11::WrapWithTrusted = 0x00000210UL , Botan::PKCS11::WrapTemplate = ( 0x40000000UL |0x00000211UL) , Botan::PKCS11::UnwrapTemplate = ( 0x40000000UL |0x00000212UL) , Botan::PKCS11::DeriveTemplate = ( 0x40000000UL |0x00000213UL) ,
  Botan::PKCS11::OtpFormat = 0x00000220UL , Botan::PKCS11::OtpLength = 0x00000221UL , Botan::PKCS11::OtpTimeInterval = 0x00000222UL , Botan::PKCS11::OtpUserFriendlyMode = 0x00000223UL ,
  Botan::PKCS11::OtpChallengeRequirement = 0x00000224UL , Botan::PKCS11::OtpTimeRequirement = 0x00000225UL , Botan::PKCS11::OtpCounterRequirement = 0x00000226UL , Botan::PKCS11::OtpPinRequirement = 0x00000227UL ,
  Botan::PKCS11::OtpCounter = 0x0000022EUL , Botan::PKCS11::OtpTime = 0x0000022FUL , Botan::PKCS11::OtpUserIdentifier = 0x0000022AUL , Botan::PKCS11::OtpServiceIdentifier = 0x0000022BUL ,
  Botan::PKCS11::OtpServiceLogo = 0x0000022CUL , Botan::PKCS11::OtpServiceLogoType = 0x0000022DUL , Botan::PKCS11::Gostr3410Params = 0x00000250UL , Botan::PKCS11::Gostr3411Params = 0x00000251UL ,
  Botan::PKCS11::Gost28147Params = 0x00000252UL , Botan::PKCS11::HwFeatureType = 0x00000300UL , Botan::PKCS11::ResetOnInit = 0x00000301UL , Botan::PKCS11::HasReset = 0x00000302UL ,
  Botan::PKCS11::PixelX = 0x00000400UL , Botan::PKCS11::PixelY = 0x00000401UL , Botan::PKCS11::Resolution = 0x00000402UL , Botan::PKCS11::CharRows = 0x00000403UL ,
  Botan::PKCS11::CharColumns = 0x00000404UL , Botan::PKCS11::Color = 0x00000405UL , Botan::PKCS11::BitsPerPixel = 0x00000406UL , Botan::PKCS11::CharSets = 0x00000480UL ,
  Botan::PKCS11::EncodingMethods = 0x00000481UL , Botan::PKCS11::MimeTypes = 0x00000482UL , Botan::PKCS11::MechanismType = 0x00000500UL , Botan::PKCS11::RequiredCmsAttributes = 0x00000501UL ,
  Botan::PKCS11::DefaultCmsAttributes = 0x00000502UL , Botan::PKCS11::SupportedCmsAttributes = 0x00000503UL , Botan::PKCS11::AllowedMechanisms = ( 0x40000000UL |0x00000600UL) , Botan::PKCS11::VendorDefined = 0x80000000UL
}
 
enum class  Botan::PKCS11::CertificateCategory : CK_ULONG { Botan::PKCS11::Unspecified = 0UL , Botan::PKCS11::TokenUser = 1UL , Botan::PKCS11::Authority = 2UL , Botan::PKCS11::OtherEntity = 3UL }
 
enum class  Botan::PKCS11::CertificateType : CK_CERTIFICATE_TYPE { Botan::PKCS11::X509 = 0x00000000UL , Botan::PKCS11::X509AttrCert = 0x00000001UL , Botan::PKCS11::Wtls = 0x00000002UL , Botan::PKCS11::VendorDefined = 0x80000000UL }
 
enum class  Botan::PKCS11::Flag : CK_FLAGS {
  Botan::PKCS11::None = 0 , Botan::PKCS11::TokenPresent = 0x00000001UL , Botan::PKCS11::RemovableDevice = 0x00000002UL , Botan::PKCS11::HwSlot = 0x00000004UL ,
  Botan::PKCS11::Rng = 0x00000001UL , Botan::PKCS11::WriteProtected = 0x00000002UL , Botan::PKCS11::LoginRequired = 0x00000004UL , Botan::PKCS11::UserPinInitialized = 0x00000008UL ,
  Botan::PKCS11::RestoreKeyNotNeeded = 0x00000020UL , Botan::PKCS11::ClockOnToken = 0x00000040UL , Botan::PKCS11::ProtectedAuthenticationPath = 0x00000100UL , Botan::PKCS11::DualCryptoOperations = 0x00000200UL ,
  Botan::PKCS11::TokenInitialized = 0x00000400UL , Botan::PKCS11::SecondaryAuthentication = 0x00000800UL , Botan::PKCS11::UserPinCountLow = 0x00010000UL , Botan::PKCS11::UserPinFinalTry = 0x00020000UL ,
  Botan::PKCS11::UserPinLocked = 0x00040000UL , Botan::PKCS11::UserPinToBeChanged = 0x00080000UL , Botan::PKCS11::SoPinCountLow = 0x00100000UL , Botan::PKCS11::SoPinFinalTry = 0x00200000UL ,
  Botan::PKCS11::SoPinLocked = 0x00400000UL , Botan::PKCS11::SoPinToBeChanged = 0x00800000UL , Botan::PKCS11::ErrorState = 0x01000000UL , Botan::PKCS11::RwSession = 0x00000002UL ,
  Botan::PKCS11::SerialSession = 0x00000004UL , Botan::PKCS11::ArrayAttribute = 0x40000000UL , Botan::PKCS11::Hw = 0x00000001UL , Botan::PKCS11::Encrypt = 0x00000100UL ,
  Botan::PKCS11::Decrypt = 0x00000200UL , Botan::PKCS11::Digest = 0x00000400UL , Botan::PKCS11::Sign = 0x00000800UL , Botan::PKCS11::SignRecover = 0x00001000UL ,
  Botan::PKCS11::Verify = 0x00002000UL , Botan::PKCS11::VerifyRecover = 0x00004000UL , Botan::PKCS11::Generate = 0x00008000UL , Botan::PKCS11::GenerateKeyPair = 0x00010000UL ,
  Botan::PKCS11::Wrap = 0x00020000UL , Botan::PKCS11::Unwrap = 0x00040000UL , Botan::PKCS11::Derive = 0x00080000UL , Botan::PKCS11::EcFP = 0x00100000UL ,
  Botan::PKCS11::EcF2m = 0x00200000UL , Botan::PKCS11::EcEcparameters = 0x00400000UL , Botan::PKCS11::EcNamedcurve = 0x00800000UL , Botan::PKCS11::EcUncompress = 0x01000000UL ,
  Botan::PKCS11::EcCompress = 0x02000000UL , Botan::PKCS11::Extension = 0x80000000UL , Botan::PKCS11::LibraryCantCreateOsThreads = 0x00000001UL , Botan::PKCS11::OsLockingOk = 0x00000002UL ,
  Botan::PKCS11::DontBlock = 1 , Botan::PKCS11::NextOtp = 0x00000001UL , Botan::PKCS11::ExcludeTime = 0x00000002UL , Botan::PKCS11::ExcludeCounter = 0x00000004UL ,
  Botan::PKCS11::ExcludeChallenge = 0x00000008UL , Botan::PKCS11::ExcludePin = 0x00000010UL , Botan::PKCS11::UserFriendlyOtp = 0x00000020UL
}
 
enum class  Botan::PKCS11::HardwareType : CK_HW_FEATURE_TYPE { Botan::PKCS11::MonotonicCounter = 0x00000001UL , Botan::PKCS11::Clock = 0x00000002UL , Botan::PKCS11::UserInterface = 0x00000003UL , Botan::PKCS11::VendorDefined = 0x80000000UL }
 
enum class  Botan::PKCS11::KeyDerivation : CK_ULONG {
  Botan::PKCS11::Null = 0x00000001UL , Botan::PKCS11::Sha1Kdf = 0x00000002UL , Botan::PKCS11::Sha1KdfAsn1 = 0x00000003UL , Botan::PKCS11::Sha1KdfConcatenate = 0x00000004UL ,
  Botan::PKCS11::Sha224Kdf = 0x00000005UL , Botan::PKCS11::Sha256Kdf = 0x00000006UL , Botan::PKCS11::Sha384Kdf = 0x00000007UL , Botan::PKCS11::Sha512Kdf = 0x00000008UL ,
  Botan::PKCS11::CpdiversifyKdf = 0x00000009UL
}
 
enum class  Botan::PKCS11::KeyType : CK_KEY_TYPE {
  Botan::PKCS11::Rsa = 0x00000000UL , Botan::PKCS11::Dsa = 0x00000001UL , Botan::PKCS11::Dh = 0x00000002UL , Botan::PKCS11::Ecdsa = 0x00000003UL ,
  Botan::PKCS11::Ec = 0x00000003UL , Botan::PKCS11::X942Dh = 0x00000004UL , Botan::PKCS11::Kea = 0x00000005UL , Botan::PKCS11::GenericSecret = 0x00000010UL ,
  Botan::PKCS11::Rc2 = 0x00000011UL , Botan::PKCS11::Rc4 = 0x00000012UL , Botan::PKCS11::Des = 0x00000013UL , Botan::PKCS11::Des2 = 0x00000014UL ,
  Botan::PKCS11::Des3 = 0x00000015UL , Botan::PKCS11::Cast = 0x00000016UL , Botan::PKCS11::Cast3 = 0x00000017UL , Botan::PKCS11::Cast5 = 0x00000018UL ,
  Botan::PKCS11::Cast128 = 0x00000018UL , Botan::PKCS11::Rc5 = 0x00000019UL , Botan::PKCS11::Idea = 0x0000001AUL , Botan::PKCS11::Skipjack = 0x0000001BUL ,
  Botan::PKCS11::Baton = 0x0000001CUL , Botan::PKCS11::Juniper = 0x0000001DUL , Botan::PKCS11::Cdmf = 0x0000001EUL , Botan::PKCS11::Aes = 0x0000001FUL ,
  Botan::PKCS11::Blowfish = 0x00000020UL , Botan::PKCS11::Twofish = 0x00000021UL , Botan::PKCS11::Securid = 0x00000022UL , Botan::PKCS11::Hotp = 0x00000023UL ,
  Botan::PKCS11::Acti = 0x00000024UL , Botan::PKCS11::Camellia = 0x00000025UL , Botan::PKCS11::Aria = 0x00000026UL , Botan::PKCS11::Md5Hmac = 0x00000027UL ,
  Botan::PKCS11::Sha1Hmac = 0x00000028UL , Botan::PKCS11::Ripemd128Hmac = 0x00000029UL , Botan::PKCS11::Ripemd160Hmac = 0x0000002AUL , Botan::PKCS11::Sha256Hmac = 0x0000002BUL ,
  Botan::PKCS11::Sha384Hmac = 0x0000002CUL , Botan::PKCS11::Sha512Hmac = 0x0000002DUL , Botan::PKCS11::Sha224Hmac = 0x0000002EUL , Botan::PKCS11::Seed = 0x0000002FUL ,
  Botan::PKCS11::Gostr3410 = 0x00000030UL , Botan::PKCS11::Gostr3411 = 0x00000031UL , Botan::PKCS11::Gost28147 = 0x00000032UL , Botan::PKCS11::VendorDefined = 0x80000000UL
}
 
enum class  Botan::PKCS11::MechanismType : CK_MECHANISM_TYPE {
  Botan::PKCS11::RsaPkcsKeyPairGen = 0x00000000UL , Botan::PKCS11::RsaPkcs = 0x00000001UL , Botan::PKCS11::Rsa9796 = 0x00000002UL , Botan::PKCS11::RsaX509 = 0x00000003UL ,
  Botan::PKCS11::Md2RsaPkcs = 0x00000004UL , Botan::PKCS11::Md5RsaPkcs = 0x00000005UL , Botan::PKCS11::Sha1RsaPkcs = 0x00000006UL , Botan::PKCS11::Ripemd128RsaPkcs = 0x00000007UL ,
  Botan::PKCS11::Ripemd160RsaPkcs = 0x00000008UL , Botan::PKCS11::RsaPkcsOaep = 0x00000009UL , Botan::PKCS11::RsaX931KeyPairGen = 0x0000000AUL , Botan::PKCS11::RsaX931 = 0x0000000BUL ,
  Botan::PKCS11::Sha1RsaX931 = 0x0000000CUL , Botan::PKCS11::RsaPkcsPss = 0x0000000DUL , Botan::PKCS11::Sha1RsaPkcsPss = 0x0000000EUL , Botan::PKCS11::DsaKeyPairGen = 0x00000010UL ,
  Botan::PKCS11::Dsa = 0x00000011UL , Botan::PKCS11::DsaSha1 = 0x00000012UL , Botan::PKCS11::DsaSha224 = 0x00000013UL , Botan::PKCS11::DsaSha256 = 0x00000014UL ,
  Botan::PKCS11::DsaSha384 = 0x00000015UL , Botan::PKCS11::DsaSha512 = 0x00000016UL , Botan::PKCS11::DhPkcsKeyPairGen = 0x00000020UL , Botan::PKCS11::DhPkcsDerive = 0x00000021UL ,
  Botan::PKCS11::X942DhKeyPairGen = 0x00000030UL , Botan::PKCS11::X942DhDerive = 0x00000031UL , Botan::PKCS11::X942DhHybridDerive = 0x00000032UL , Botan::PKCS11::X942MqvDerive = 0x00000033UL ,
  Botan::PKCS11::Sha256RsaPkcs = 0x00000040UL , Botan::PKCS11::Sha384RsaPkcs = 0x00000041UL , Botan::PKCS11::Sha512RsaPkcs = 0x00000042UL , Botan::PKCS11::Sha256RsaPkcsPss = 0x00000043UL ,
  Botan::PKCS11::Sha384RsaPkcsPss = 0x00000044UL , Botan::PKCS11::Sha512RsaPkcsPss = 0x00000045UL , Botan::PKCS11::Sha224RsaPkcs = 0x00000046UL , Botan::PKCS11::Sha224RsaPkcsPss = 0x00000047UL ,
  Botan::PKCS11::Sha512224 = 0x00000048UL , Botan::PKCS11::Sha512224Hmac = 0x00000049UL , Botan::PKCS11::Sha512224HmacGeneral = 0x0000004AUL , Botan::PKCS11::Sha512224KeyDerivation = 0x0000004BUL ,
  Botan::PKCS11::Sha512256 = 0x0000004CUL , Botan::PKCS11::Sha512256Hmac = 0x0000004DUL , Botan::PKCS11::Sha512256HmacGeneral = 0x0000004EUL , Botan::PKCS11::Sha512256KeyDerivation = 0x0000004FUL ,
  Botan::PKCS11::Sha512T = 0x00000050UL , Botan::PKCS11::Sha512THmac = 0x00000051UL , Botan::PKCS11::Sha512THmacGeneral = 0x00000052UL , Botan::PKCS11::Sha512TKeyDerivation = 0x00000053UL ,
  Botan::PKCS11::Rc2KeyGen = 0x00000100UL , Botan::PKCS11::Rc2Ecb = 0x00000101UL , Botan::PKCS11::Rc2Cbc = 0x00000102UL , Botan::PKCS11::Rc2Mac = 0x00000103UL ,
  Botan::PKCS11::Rc2MacGeneral = 0x00000104UL , Botan::PKCS11::Rc2CbcPad = 0x00000105UL , Botan::PKCS11::Rc4KeyGen = 0x00000110UL , Botan::PKCS11::Rc4 = 0x00000111UL ,
  Botan::PKCS11::DesKeyGen = 0x00000120UL , Botan::PKCS11::DesEcb = 0x00000121UL , Botan::PKCS11::DesCbc = 0x00000122UL , Botan::PKCS11::DesMac = 0x00000123UL ,
  Botan::PKCS11::DesMacGeneral = 0x00000124UL , Botan::PKCS11::DesCbcPad = 0x00000125UL , Botan::PKCS11::Des2KeyGen = 0x00000130UL , Botan::PKCS11::Des3KeyGen = 0x00000131UL ,
  Botan::PKCS11::Des3Ecb = 0x00000132UL , Botan::PKCS11::Des3Cbc = 0x00000133UL , Botan::PKCS11::Des3Mac = 0x00000134UL , Botan::PKCS11::Des3MacGeneral = 0x00000135UL ,
  Botan::PKCS11::Des3CbcPad = 0x00000136UL , Botan::PKCS11::Des3CmacGeneral = 0x00000137UL , Botan::PKCS11::Des3Cmac = 0x00000138UL , Botan::PKCS11::CdmfKeyGen = 0x00000140UL ,
  Botan::PKCS11::CdmfEcb = 0x00000141UL , Botan::PKCS11::CdmfCbc = 0x00000142UL , Botan::PKCS11::CdmfMac = 0x00000143UL , Botan::PKCS11::CdmfMacGeneral = 0x00000144UL ,
  Botan::PKCS11::CdmfCbcPad = 0x00000145UL , Botan::PKCS11::DesOfb64 = 0x00000150UL , Botan::PKCS11::DesOfb8 = 0x00000151UL , Botan::PKCS11::DesCfb64 = 0x00000152UL ,
  Botan::PKCS11::DesCfb8 = 0x00000153UL , Botan::PKCS11::Md2 = 0x00000200UL , Botan::PKCS11::Md2Hmac = 0x00000201UL , Botan::PKCS11::Md2HmacGeneral = 0x00000202UL ,
  Botan::PKCS11::Md5 = 0x00000210UL , Botan::PKCS11::Md5Hmac = 0x00000211UL , Botan::PKCS11::Md5HmacGeneral = 0x00000212UL , Botan::PKCS11::Sha1 = 0x00000220UL ,
  Botan::PKCS11::Sha1Hmac = 0x00000221UL , Botan::PKCS11::Sha1HmacGeneral = 0x00000222UL , Botan::PKCS11::Ripemd128 = 0x00000230UL , Botan::PKCS11::Ripemd128Hmac = 0x00000231UL ,
  Botan::PKCS11::Ripemd128HmacGeneral = 0x00000232UL , Botan::PKCS11::Ripemd160 = 0x00000240UL , Botan::PKCS11::Ripemd160Hmac = 0x00000241UL , Botan::PKCS11::Ripemd160HmacGeneral = 0x00000242UL ,
  Botan::PKCS11::Sha256 = 0x00000250UL , Botan::PKCS11::Sha256Hmac = 0x00000251UL , Botan::PKCS11::Sha256HmacGeneral = 0x00000252UL , Botan::PKCS11::Sha224 = 0x00000255UL ,
  Botan::PKCS11::Sha224Hmac = 0x00000256UL , Botan::PKCS11::Sha224HmacGeneral = 0x00000257UL , Botan::PKCS11::Sha384 = 0x00000260UL , Botan::PKCS11::Sha384Hmac = 0x00000261UL ,
  Botan::PKCS11::Sha384HmacGeneral = 0x00000262UL , Botan::PKCS11::Sha512 = 0x00000270UL , Botan::PKCS11::Sha512Hmac = 0x00000271UL , Botan::PKCS11::Sha512HmacGeneral = 0x00000272UL ,
  Botan::PKCS11::SecuridKeyGen = 0x00000280UL , Botan::PKCS11::Securid = 0x00000282UL , Botan::PKCS11::HotpKeyGen = 0x00000290UL , Botan::PKCS11::Hotp = 0x00000291UL ,
  Botan::PKCS11::Acti = 0x000002A0UL , Botan::PKCS11::ActiKeyGen = 0x000002A1UL , Botan::PKCS11::CastKeyGen = 0x00000300UL , Botan::PKCS11::CastEcb = 0x00000301UL ,
  Botan::PKCS11::CastCbc = 0x00000302UL , Botan::PKCS11::CastMac = 0x00000303UL , Botan::PKCS11::CastMacGeneral = 0x00000304UL , Botan::PKCS11::CastCbcPad = 0x00000305UL ,
  Botan::PKCS11::Cast3KeyGen = 0x00000310UL , Botan::PKCS11::Cast3Ecb = 0x00000311UL , Botan::PKCS11::Cast3Cbc = 0x00000312UL , Botan::PKCS11::Cast3Mac = 0x00000313UL ,
  Botan::PKCS11::Cast3MacGeneral = 0x00000314UL , Botan::PKCS11::Cast3CbcPad = 0x00000315UL , Botan::PKCS11::Cast5KeyGen = 0x00000320UL , Botan::PKCS11::Cast128KeyGen = 0x00000320UL ,
  Botan::PKCS11::Cast5Ecb = 0x00000321UL , Botan::PKCS11::Cast128Ecb = 0x00000321UL , Botan::PKCS11::Cast5Cbc = 0x00000322UL , Botan::PKCS11::Cast128Cbc = 0x00000322UL ,
  Botan::PKCS11::Cast5Mac = 0x00000323UL , Botan::PKCS11::Cast128Mac = 0x00000323UL , Botan::PKCS11::Cast5MacGeneral = 0x00000324UL , Botan::PKCS11::Cast128MacGeneral = 0x00000324UL ,
  Botan::PKCS11::Cast5CbcPad = 0x00000325UL , Botan::PKCS11::Cast128CbcPad = 0x00000325UL , Botan::PKCS11::Rc5KeyGen = 0x00000330UL , Botan::PKCS11::Rc5Ecb = 0x00000331UL ,
  Botan::PKCS11::Rc5Cbc = 0x00000332UL , Botan::PKCS11::Rc5Mac = 0x00000333UL , Botan::PKCS11::Rc5MacGeneral = 0x00000334UL , Botan::PKCS11::Rc5CbcPad = 0x00000335UL ,
  Botan::PKCS11::IdeaKeyGen = 0x00000340UL , Botan::PKCS11::IdeaEcb = 0x00000341UL , Botan::PKCS11::IdeaCbc = 0x00000342UL , Botan::PKCS11::IdeaMac = 0x00000343UL ,
  Botan::PKCS11::IdeaMacGeneral = 0x00000344UL , Botan::PKCS11::IdeaCbcPad = 0x00000345UL , Botan::PKCS11::GenericSecretKeyGen = 0x00000350UL , Botan::PKCS11::ConcatenateBaseAndKey = 0x00000360UL ,
  Botan::PKCS11::ConcatenateBaseAndData = 0x00000362UL , Botan::PKCS11::ConcatenateDataAndBase = 0x00000363UL , Botan::PKCS11::XorBaseAndData = 0x00000364UL , Botan::PKCS11::ExtractKeyFromKey = 0x00000365UL ,
  Botan::PKCS11::Ssl3PreMasterKeyGen = 0x00000370UL , Botan::PKCS11::Ssl3MasterKeyDerive = 0x00000371UL , Botan::PKCS11::Ssl3KeyAndMacDerive = 0x00000372UL , Botan::PKCS11::Ssl3MasterKeyDeriveDh = 0x00000373UL ,
  Botan::PKCS11::TlsPreMasterKeyGen = 0x00000374UL , Botan::PKCS11::TlsMasterKeyDerive = 0x00000375UL , Botan::PKCS11::TlsKeyAndMacDerive = 0x00000376UL , Botan::PKCS11::TlsMasterKeyDeriveDh = 0x00000377UL ,
  Botan::PKCS11::TlsPrf = 0x00000378UL , Botan::PKCS11::Ssl3Md5Mac = 0x00000380UL , Botan::PKCS11::Ssl3Sha1Mac = 0x00000381UL , Botan::PKCS11::Md5KeyDerivation = 0x00000390UL ,
  Botan::PKCS11::Md2KeyDerivation = 0x00000391UL , Botan::PKCS11::Sha1KeyDerivation = 0x00000392UL , Botan::PKCS11::Sha256KeyDerivation = 0x00000393UL , Botan::PKCS11::Sha384KeyDerivation = 0x00000394UL ,
  Botan::PKCS11::Sha512KeyDerivation = 0x00000395UL , Botan::PKCS11::Sha224KeyDerivation = 0x00000396UL , Botan::PKCS11::PbeMd2DesCbc = 0x000003A0UL , Botan::PKCS11::PbeMd5DesCbc = 0x000003A1UL ,
  Botan::PKCS11::PbeMd5CastCbc = 0x000003A2UL , Botan::PKCS11::PbeMd5Cast3Cbc = 0x000003A3UL , Botan::PKCS11::PbeMd5Cast5Cbc = 0x000003A4UL , Botan::PKCS11::PbeMd5Cast128Cbc = 0x000003A4UL ,
  Botan::PKCS11::PbeSha1Cast5Cbc = 0x000003A5UL , Botan::PKCS11::PbeSha1Cast128Cbc = 0x000003A5UL , Botan::PKCS11::PbeSha1Rc4128 = 0x000003A6UL , Botan::PKCS11::PbeSha1Rc440 = 0x000003A7UL ,
  Botan::PKCS11::PbeSha1Des3EdeCbc = 0x000003A8UL , Botan::PKCS11::PbeSha1Des2EdeCbc = 0x000003A9UL , Botan::PKCS11::PbeSha1Rc2128Cbc = 0x000003AAUL , Botan::PKCS11::PbeSha1Rc240Cbc = 0x000003ABUL ,
  Botan::PKCS11::Pkcs5Pbkd2 = 0x000003B0UL , Botan::PKCS11::PbaSha1WithSha1Hmac = 0x000003C0UL , Botan::PKCS11::WtlsPreMasterKeyGen = 0x000003D0UL , Botan::PKCS11::WtlsMasterKeyDerive = 0x000003D1UL ,
  Botan::PKCS11::WtlsMasterKeyDeriveDhEcc = 0x000003D2UL , Botan::PKCS11::WtlsPrf = 0x000003D3UL , Botan::PKCS11::WtlsServerKeyAndMacDerive = 0x000003D4UL , Botan::PKCS11::WtlsClientKeyAndMacDerive = 0x000003D5UL ,
  Botan::PKCS11::Tls10MacServer = 0x000003D6UL , Botan::PKCS11::Tls10MacClient = 0x000003D7UL , Botan::PKCS11::Tls12Mac = 0x000003D8UL , Botan::PKCS11::Tls12Kdf = 0x000003D9UL ,
  Botan::PKCS11::Tls12MasterKeyDerive = 0x000003E0UL , Botan::PKCS11::Tls12KeyAndMacDerive = 0x000003E1UL , Botan::PKCS11::Tls12MasterKeyDeriveDh = 0x000003E2UL , Botan::PKCS11::Tls12KeySafeDerive = 0x000003E3UL ,
  Botan::PKCS11::TlsMac = 0x000003E4UL , Botan::PKCS11::TlsKdf = 0x000003E5UL , Botan::PKCS11::KeyWrapLynks = 0x00000400UL , Botan::PKCS11::KeyWrapSetOaep = 0x00000401UL ,
  Botan::PKCS11::CmsSig = 0x00000500UL , Botan::PKCS11::KipDerive = 0x00000510UL , Botan::PKCS11::KipWrap = 0x00000511UL , Botan::PKCS11::KipMac = 0x00000512UL ,
  Botan::PKCS11::CamelliaKeyGen = 0x00000550UL , Botan::PKCS11::CamelliaEcb = 0x00000551UL , Botan::PKCS11::CamelliaCbc = 0x00000552UL , Botan::PKCS11::CamelliaMac = 0x00000553UL ,
  Botan::PKCS11::CamelliaMacGeneral = 0x00000554UL , Botan::PKCS11::CamelliaCbcPad = 0x00000555UL , Botan::PKCS11::CamelliaEcbEncryptData = 0x00000556UL , Botan::PKCS11::CamelliaCbcEncryptData = 0x00000557UL ,
  Botan::PKCS11::CamelliaCtr = 0x00000558UL , Botan::PKCS11::AriaKeyGen = 0x00000560UL , Botan::PKCS11::AriaEcb = 0x00000561UL , Botan::PKCS11::AriaCbc = 0x00000562UL ,
  Botan::PKCS11::AriaMac = 0x00000563UL , Botan::PKCS11::AriaMacGeneral = 0x00000564UL , Botan::PKCS11::AriaCbcPad = 0x00000565UL , Botan::PKCS11::AriaEcbEncryptData = 0x00000566UL ,
  Botan::PKCS11::AriaCbcEncryptData = 0x00000567UL , Botan::PKCS11::SeedKeyGen = 0x00000650UL , Botan::PKCS11::SeedEcb = 0x00000651UL , Botan::PKCS11::SeedCbc = 0x00000652UL ,
  Botan::PKCS11::SeedMac = 0x00000653UL , Botan::PKCS11::SeedMacGeneral = 0x00000654UL , Botan::PKCS11::SeedCbcPad = 0x00000655UL , Botan::PKCS11::SeedEcbEncryptData = 0x00000656UL ,
  Botan::PKCS11::SeedCbcEncryptData = 0x00000657UL , Botan::PKCS11::SkipjackKeyGen = 0x00001000UL , Botan::PKCS11::SkipjackEcb64 = 0x00001001UL , Botan::PKCS11::SkipjackCbc64 = 0x00001002UL ,
  Botan::PKCS11::SkipjackOfb64 = 0x00001003UL , Botan::PKCS11::SkipjackCfb64 = 0x00001004UL , Botan::PKCS11::SkipjackCfb32 = 0x00001005UL , Botan::PKCS11::SkipjackCfb16 = 0x00001006UL ,
  Botan::PKCS11::SkipjackCfb8 = 0x00001007UL , Botan::PKCS11::SkipjackWrap = 0x00001008UL , Botan::PKCS11::SkipjackPrivateWrap = 0x00001009UL , Botan::PKCS11::SkipjackRelayx = 0x0000100aUL ,
  Botan::PKCS11::KeaKeyPairGen = 0x00001010UL , Botan::PKCS11::KeaKeyDerive = 0x00001011UL , Botan::PKCS11::KeaDerive = 0x00001012UL , Botan::PKCS11::FortezzaTimestamp = 0x00001020UL ,
  Botan::PKCS11::BatonKeyGen = 0x00001030UL , Botan::PKCS11::BatonEcb128 = 0x00001031UL , Botan::PKCS11::BatonEcb96 = 0x00001032UL , Botan::PKCS11::BatonCbc128 = 0x00001033UL ,
  Botan::PKCS11::BatonCounter = 0x00001034UL , Botan::PKCS11::BatonShuffle = 0x00001035UL , Botan::PKCS11::BatonWrap = 0x00001036UL , Botan::PKCS11::EcdsaKeyPairGen = 0x00001040UL ,
  Botan::PKCS11::EcKeyPairGen = 0x00001040UL , Botan::PKCS11::Ecdsa = 0x00001041UL , Botan::PKCS11::EcdsaSha1 = 0x00001042UL , Botan::PKCS11::EcdsaSha224 = 0x00001043UL ,
  Botan::PKCS11::EcdsaSha256 = 0x00001044UL , Botan::PKCS11::EcdsaSha384 = 0x00001045UL , Botan::PKCS11::EcdsaSha512 = 0x00001046UL , Botan::PKCS11::Ecdh1Derive = 0x00001050UL ,
  Botan::PKCS11::Ecdh1CofactorDerive = 0x00001051UL , Botan::PKCS11::EcmqvDerive = 0x00001052UL , Botan::PKCS11::EcdhAesKeyWrap = 0x00001053UL , Botan::PKCS11::RsaAesKeyWrap = 0x00001054UL ,
  Botan::PKCS11::JuniperKeyGen = 0x00001060UL , Botan::PKCS11::JuniperEcb128 = 0x00001061UL , Botan::PKCS11::JuniperCbc128 = 0x00001062UL , Botan::PKCS11::JuniperCounter = 0x00001063UL ,
  Botan::PKCS11::JuniperShuffle = 0x00001064UL , Botan::PKCS11::JuniperWrap = 0x00001065UL , Botan::PKCS11::Fasthash = 0x00001070UL , Botan::PKCS11::AesKeyGen = 0x00001080UL ,
  Botan::PKCS11::AesEcb = 0x00001081UL , Botan::PKCS11::AesCbc = 0x00001082UL , Botan::PKCS11::AesMac = 0x00001083UL , Botan::PKCS11::AesMacGeneral = 0x00001084UL ,
  Botan::PKCS11::AesCbcPad = 0x00001085UL , Botan::PKCS11::AesCtr = 0x00001086UL , Botan::PKCS11::AesGcm = 0x00001087UL , Botan::PKCS11::AesCcm = 0x00001088UL ,
  Botan::PKCS11::AesCts = 0x00001089UL , Botan::PKCS11::AesCmac = 0x0000108AUL , Botan::PKCS11::AesCmacGeneral = 0x0000108BUL , Botan::PKCS11::AesXcbcMac = 0x0000108CUL ,
  Botan::PKCS11::AesXcbcMac96 = 0x0000108DUL , Botan::PKCS11::AesGmac = 0x0000108EUL , Botan::PKCS11::BlowfishKeyGen = 0x00001090UL , Botan::PKCS11::BlowfishCbc = 0x00001091UL ,
  Botan::PKCS11::TwofishKeyGen = 0x00001092UL , Botan::PKCS11::TwofishCbc = 0x00001093UL , Botan::PKCS11::BlowfishCbcPad = 0x00001094UL , Botan::PKCS11::TwofishCbcPad = 0x00001095UL ,
  Botan::PKCS11::DesEcbEncryptData = 0x00001100UL , Botan::PKCS11::DesCbcEncryptData = 0x00001101UL , Botan::PKCS11::Des3EcbEncryptData = 0x00001102UL , Botan::PKCS11::Des3CbcEncryptData = 0x00001103UL ,
  Botan::PKCS11::AesEcbEncryptData = 0x00001104UL , Botan::PKCS11::AesCbcEncryptData = 0x00001105UL , Botan::PKCS11::Gostr3410KeyPairGen = 0x00001200UL , Botan::PKCS11::Gostr3410 = 0x00001201UL ,
  Botan::PKCS11::Gostr3410WithGostr3411 = 0x00001202UL , Botan::PKCS11::Gostr3410KeyWrap = 0x00001203UL , Botan::PKCS11::Gostr3410Derive = 0x00001204UL , Botan::PKCS11::Gostr3411 = 0x00001210UL ,
  Botan::PKCS11::Gostr3411Hmac = 0x00001211UL , Botan::PKCS11::Gost28147KeyGen = 0x00001220UL , Botan::PKCS11::Gost28147Ecb = 0x00001221UL , Botan::PKCS11::Gost28147 = 0x00001222UL ,
  Botan::PKCS11::Gost28147Mac = 0x00001223UL , Botan::PKCS11::Gost28147KeyWrap = 0x00001224UL , Botan::PKCS11::DsaParameterGen = 0x00002000UL , Botan::PKCS11::DhPkcsParameterGen = 0x00002001UL ,
  Botan::PKCS11::X942DhParameterGen = 0x00002002UL , Botan::PKCS11::DsaProbablisticParameterGen = 0x00002003UL , Botan::PKCS11::DsaShaweTaylorParameterGen = 0x00002004UL , Botan::PKCS11::AesOfb = 0x00002104UL ,
  Botan::PKCS11::AesCfb64 = 0x00002105UL , Botan::PKCS11::AesCfb8 = 0x00002106UL , Botan::PKCS11::AesCfb128 = 0x00002107UL , Botan::PKCS11::AesCfb1 = 0x00002108UL ,
  Botan::PKCS11::AesKeyWrap = 0x00002109UL , Botan::PKCS11::AesKeyWrapPad = 0x0000210AUL , Botan::PKCS11::RsaPkcsTpm11 = 0x00004001UL , Botan::PKCS11::RsaPkcsOaepTpm11 = 0x00004002UL ,
  Botan::PKCS11::VendorDefined = 0x80000000UL
}
 
enum class  Botan::PKCS11::MGF : CK_RSA_PKCS_MGF_TYPE {
  Botan::PKCS11::Mgf1Sha1 = 0x00000001UL , Botan::PKCS11::Mgf1Sha256 = 0x00000002UL , Botan::PKCS11::Mgf1Sha384 = 0x00000003UL , Botan::PKCS11::Mgf1Sha512 = 0x00000004UL ,
  Botan::PKCS11::Mgf1Sha224 = 0x00000005UL
}
 
enum class  Botan::PKCS11::Notification : CK_NOTIFICATION { Botan::PKCS11::Surrender = 0UL , Botan::PKCS11::OtpChanged = 1UL }
 
enum class  Botan::PKCS11::ObjectClass : CK_OBJECT_CLASS {
  Botan::PKCS11::Data = 0x00000000UL , Botan::PKCS11::Certificate = 0x00000001UL , Botan::PKCS11::PublicKey = 0x00000002UL , Botan::PKCS11::PrivateKey = 0x00000003UL ,
  Botan::PKCS11::SecretKey = 0x00000004UL , Botan::PKCS11::HwFeature = 0x00000005UL , Botan::PKCS11::DomainParameters = 0x00000006UL , Botan::PKCS11::Mechanism = 0x00000007UL ,
  Botan::PKCS11::OtpKey = 0x00000008UL , Botan::PKCS11::VendorDefined = 0x80000000UL
}
 
enum class  Botan::PKCS11::PseudoRandom : CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE {
  Botan::PKCS11::Pkcs5Pbkd2HmacSha1 = 0x00000001UL , Botan::PKCS11::Pkcs5Pbkd2HmacGostr3411 = 0x00000002UL , Botan::PKCS11::Pkcs5Pbkd2HmacSha224 = 0x00000003UL , Botan::PKCS11::Pkcs5Pbkd2HmacSha256 = 0x00000004UL ,
  Botan::PKCS11::Pkcs5Pbkd2HmacSha384 = 0x00000005UL , Botan::PKCS11::Pkcs5Pbkd2HmacSha512 = 0x00000006UL , Botan::PKCS11::Pkcs5Pbkd2HmacSha512224 = 0x00000007UL , Botan::PKCS11::Pkcs5Pbkd2HmacSha512256 = 0x00000008UL
}
 
enum class  Botan::PKCS11::PublicPointEncoding : uint32_t { Botan::PKCS11::Raw , Botan::PKCS11::Der }
 
enum class  Botan::PKCS11::ReturnValue : CK_RV {
  Botan::PKCS11::OK = 0x00000000UL , Botan::PKCS11::Cancel = 0x00000001UL , Botan::PKCS11::HostMemory = 0x00000002UL , Botan::PKCS11::SlotIdInvalid = 0x00000003UL ,
  Botan::PKCS11::GeneralError = 0x00000005UL , Botan::PKCS11::FunctionFailed = 0x00000006UL , Botan::PKCS11::ArgumentsBad = 0x00000007UL , Botan::PKCS11::NoEvent = 0x00000008UL ,
  Botan::PKCS11::NeedToCreateThreads = 0x00000009UL , Botan::PKCS11::CantLock = 0x0000000AUL , Botan::PKCS11::AttributeReadOnly = 0x00000010UL , Botan::PKCS11::AttributeSensitive = 0x00000011UL ,
  Botan::PKCS11::AttributeTypeInvalid = 0x00000012UL , Botan::PKCS11::AttributeValueInvalid = 0x00000013UL , Botan::PKCS11::ActionProhibited = 0x0000001BUL , Botan::PKCS11::DataInvalid = 0x00000020UL ,
  Botan::PKCS11::DataLenRange = 0x00000021UL , Botan::PKCS11::DeviceError = 0x00000030UL , Botan::PKCS11::DeviceMemory = 0x00000031UL , Botan::PKCS11::DeviceRemoved = 0x00000032UL ,
  Botan::PKCS11::EncryptedDataInvalid = 0x00000040UL , Botan::PKCS11::EncryptedDataLenRange = 0x00000041UL , Botan::PKCS11::FunctionCanceled = 0x00000050UL , Botan::PKCS11::FunctionNotParallel = 0x00000051UL ,
  Botan::PKCS11::FunctionNotSupported = 0x00000054UL , Botan::PKCS11::KeyHandleInvalid = 0x00000060UL , Botan::PKCS11::KeySizeRange = 0x00000062UL , Botan::PKCS11::KeyTypeInconsistent = 0x00000063UL ,
  Botan::PKCS11::KeyNotNeeded = 0x00000064UL , Botan::PKCS11::KeyChanged = 0x00000065UL , Botan::PKCS11::KeyNeeded = 0x00000066UL , Botan::PKCS11::KeyIndigestible = 0x00000067UL ,
  Botan::PKCS11::KeyFunctionNotPermitted = 0x00000068UL , Botan::PKCS11::KeyNotWrappable = 0x00000069UL , Botan::PKCS11::KeyUnextractable = 0x0000006AUL , Botan::PKCS11::MechanismInvalid = 0x00000070UL ,
  Botan::PKCS11::MechanismParamInvalid = 0x00000071UL , Botan::PKCS11::ObjectHandleInvalid = 0x00000082UL , Botan::PKCS11::OperationActive = 0x00000090UL , Botan::PKCS11::OperationNotInitialized = 0x00000091UL ,
  Botan::PKCS11::PinIncorrect = 0x000000A0UL , Botan::PKCS11::PinInvalid = 0x000000A1UL , Botan::PKCS11::PinLenRange = 0x000000A2UL , Botan::PKCS11::PinExpired = 0x000000A3UL ,
  Botan::PKCS11::PinLocked = 0x000000A4UL , Botan::PKCS11::SessionClosed = 0x000000B0UL , Botan::PKCS11::SessionCount = 0x000000B1UL , Botan::PKCS11::SessionHandleInvalid = 0x000000B3UL ,
  Botan::PKCS11::SessionParallelNotSupported = 0x000000B4UL , Botan::PKCS11::SessionReadOnly = 0x000000B5UL , Botan::PKCS11::SessionExists = 0x000000B6UL , Botan::PKCS11::SessionReadOnlyExists = 0x000000B7UL ,
  Botan::PKCS11::SessionReadWriteSoExists = 0x000000B8UL , Botan::PKCS11::SignatureInvalid = 0x000000C0UL , Botan::PKCS11::SignatureLenRange = 0x000000C1UL , Botan::PKCS11::TemplateIncomplete = 0x000000D0UL ,
  Botan::PKCS11::TemplateInconsistent = 0x000000D1UL , Botan::PKCS11::TokenNotPresent = 0x000000E0UL , Botan::PKCS11::TokenNotRecognized = 0x000000E1UL , Botan::PKCS11::TokenWriteProtected = 0x000000E2UL ,
  Botan::PKCS11::UnwrappingKeyHandleInvalid = 0x000000F0UL , Botan::PKCS11::UnwrappingKeySizeRange = 0x000000F1UL , Botan::PKCS11::UnwrappingKeyTypeInconsistent = 0x000000F2UL , Botan::PKCS11::UserAlreadyLoggedIn = 0x00000100UL ,
  Botan::PKCS11::UserNotLoggedIn = 0x00000101UL , Botan::PKCS11::UserPinNotInitialized = 0x00000102UL , Botan::PKCS11::UserTypeInvalid = 0x00000103UL , Botan::PKCS11::UserAnotherAlreadyLoggedIn = 0x00000104UL ,
  Botan::PKCS11::UserTooManyTypes = 0x00000105UL , Botan::PKCS11::WrappedKeyInvalid = 0x00000110UL , Botan::PKCS11::WrappedKeyLenRange = 0x00000112UL , Botan::PKCS11::WrappingKeyHandleInvalid = 0x00000113UL ,
  Botan::PKCS11::WrappingKeySizeRange = 0x00000114UL , Botan::PKCS11::WrappingKeyTypeInconsistent = 0x00000115UL , Botan::PKCS11::RandomSeedNotSupported = 0x00000120UL , Botan::PKCS11::RandomNoRng = 0x00000121UL ,
  Botan::PKCS11::DomainParamsInvalid = 0x00000130UL , Botan::PKCS11::CurveNotSupported = 0x00000140UL , Botan::PKCS11::BufferTooSmall = 0x00000150UL , Botan::PKCS11::SavedStateInvalid = 0x00000160UL ,
  Botan::PKCS11::InformationSensitive = 0x00000170UL , Botan::PKCS11::StateUnsaveable = 0x00000180UL , Botan::PKCS11::CryptokiNotInitialized = 0x00000190UL , Botan::PKCS11::CryptokiAlreadyInitialized = 0x00000191UL ,
  Botan::PKCS11::MutexBad = 0x000001A0UL , Botan::PKCS11::MutexNotLocked = 0x000001A1UL , Botan::PKCS11::NewPinMode = 0x000001B0UL , Botan::PKCS11::NextOtp = 0x000001B1UL ,
  Botan::PKCS11::ExceededMaxIterations = 0x000001B5UL , Botan::PKCS11::FipsSelfTestFailed = 0x000001B6UL , Botan::PKCS11::LibraryLoadFailed = 0x000001B7UL , Botan::PKCS11::PinTooWeak = 0x000001B8UL ,
  Botan::PKCS11::PublicKeyInvalid = 0x000001B9UL , Botan::PKCS11::FunctionRejected = 0x00000200UL , Botan::PKCS11::VendorDefined = 0x80000000UL
}
 
enum class  Botan::PKCS11::SessionState : CK_STATE {
  Botan::PKCS11::RoPublicSession = 0UL , Botan::PKCS11::RoUserFunctions = 1UL , Botan::PKCS11::RwPublicSession = 2UL , Botan::PKCS11::RwUserFunctions = 3UL ,
  Botan::PKCS11::RwSoFunctions = 4UL
}
 
enum class  Botan::PKCS11::UserType : CK_USER_TYPE { Botan::PKCS11::SO = 0UL , Botan::PKCS11::User = 1UL , Botan::PKCS11::ContextSpecific = 2UL }
 

Functions

void Botan::PKCS11::change_pin (Slot &slot, const secure_string &old_pin, const secure_string &new_pin)
 
void Botan::PKCS11::change_so_pin (Slot &slot, const secure_string &old_so_pin, const secure_string &new_so_pin)
 
Flags Botan::PKCS11::flags (Flag flags)
 
void Botan::PKCS11::initialize_token (Slot &slot, const std::string &label, const secure_string &so_pin, const secure_string &pin)
 
Flag Botan::PKCS11::operator| (Flag a, Flag b)
 
void Botan::PKCS11::set_pin (Slot &slot, const secure_string &so_pin, const secure_string &pin)
 

Variables

const Bbool Botan::PKCS11::False = 0
 
const Bbool Botan::PKCS11::True = 1
 

Macro Definition Documentation

◆ CK_CALLBACK_FUNCTION

#define CK_CALLBACK_FUNCTION (   returnType,
  name 
)     returnType (* name)

Definition at line 37 of file p11.h.

56 {
57
58class Dynamically_Loaded_Library;
59
60namespace PKCS11 {
61
62using secure_string = secure_vector<uint8_t>;
63
65 {
82 Url = CKA_URL,
89 Id = CKA_ID,
93 Wrap = CKA_WRAP,
95 Sign = CKA_SIGN,
114 Base = CKA_BASE,
174 };
175
177 {
178 X509 = CKC_X_509,
180 Wtls = CKC_WTLS,
182 };
183
184/// Indicates if a stored certificate is a user certificate for which the corresponding private key is available
185/// on the token ("token user"), a CA certificate ("authority"), or another end-entity certificate ("other entity").
186enum class CertificateCategory : CK_ULONG
187 {
192 };
193
194enum class KeyDerivation : CK_ULONG
195 {
196 Null = CKD_NULL,
205 };
206
207enum class Flag : CK_FLAGS
208 {
209 None = 0,
213 Rng = CKF_RNG,
235 Hw = CKF_HW,
239 Sign = CKF_SIGN,
245 Wrap = CKF_WRAP,
264 };
265
266inline Flag operator | (Flag a, Flag b)
267 {
268 return static_cast< Flag >(static_cast< CK_FLAGS >(a) | static_cast< CK_FLAGS >(b));
269 }
270
271enum class MGF : CK_RSA_PKCS_MGF_TYPE
272 {
278 };
279
281 {
286 };
287
288enum class KeyType : CK_KEY_TYPE
289 {
290 Rsa = CKK_RSA,
291 Dsa = CKK_DSA,
292 Dh = CKK_DH,
294 Ec = CKK_EC,
296 Kea = CKK_KEA,
298 Rc2 = CKK_RC2,
299 Rc4 = CKK_RC4,
300 Des = CKK_DES,
301 Des2 = CKK_DES2,
302 Des3 = CKK_DES3,
303 Cast = CKK_CAST,
307 Rc5 = CKK_RC5,
308 Idea = CKK_IDEA,
312 Cdmf = CKK_CDMF,
313 Aes = CKK_AES,
317 Hotp = CKK_HOTP,
318 Acti = CKK_ACTI,
320 Aria = CKK_ARIA,
329 Seed = CKK_SEED,
334 };
335
337 {
354 Dsa = CKM_DSA,
393 Rc4 = CKM_RC4,
419 Md2 = CKM_MD2,
422 Md5 = CKM_MD5,
425 Sha1 = CKM_SHA_1,
449 Hotp = CKM_HOTP,
450 Acti = CKM_ACTI,
671 };
672
673enum class Notification : CK_NOTIFICATION
674 {
677 };
678
679enum class ObjectClass : CK_OBJECT_CLASS
680 {
681 Data = CKO_DATA,
691 };
692
694 {
703 };
704
705enum class SessionState : CK_STATE
706 {
712 };
713
714enum class ReturnValue : CK_RV
715 {
716 OK = CKR_OK,
811 };
812
813enum class UserType : CK_USER_TYPE
814 {
815 SO = CKU_SO,
816 User = CKU_USER,
818 };
819
820enum class PublicPointEncoding : uint32_t
821 {
822 Raw,
823 Der
824 };
825
827using VoidPtr = CK_VOID_PTR;
829using CreateMutex = CK_CREATEMUTEX;
830using DestroyMutex = CK_DESTROYMUTEX;
831using LockMutex = CK_LOCKMUTEX;
832using UnlockMutex = CK_UNLOCKMUTEX;
833using Flags = CK_FLAGS;
834using Info = CK_INFO;
835using Bbool = CK_BBOOL;
836using SlotId = CK_SLOT_ID;
837using Ulong = CK_ULONG;
838using SlotInfo = CK_SLOT_INFO;
840using Mechanism = CK_MECHANISM;
842using Utf8Char = CK_UTF8CHAR;
843using Notify = CK_NOTIFY;
846using Attribute = CK_ATTRIBUTE;
848using Byte = CK_BYTE;
852using Date = CK_DATE;
853
854BOTAN_PUBLIC_API(2,0) extern ReturnValue* ThrowException;
855
856const Bbool True = CK_TRUE;
857const Bbool False = CK_FALSE;
858
859inline Flags flags(Flag flags)
860 {
861 return static_cast<Flags>(flags);
862 }
863
864class Slot;
865
866/**
867* Initializes a token
868* @param slot The slot with the attached token that should be initialized
869* @param label The token label
870* @param so_pin PIN of the security officer. Will be set if the token is uninitialized other this has to be the current SO_PIN
871* @param pin The user PIN that will be set
872*/
873BOTAN_PUBLIC_API(2,0) void initialize_token(Slot& slot, const std::string& label, const secure_string& so_pin,
874 const secure_string& pin);
875
876/**
877* Change PIN with old PIN to new PIN
878* @param slot The slot with the attached token
879* @param old_pin The old user PIN
880* @param new_pin The new user PIN
881*/
882
883BOTAN_PUBLIC_API(2,0) void change_pin(Slot& slot, const secure_string& old_pin, const secure_string& new_pin);
884
885/**
886* Change SO_PIN with old SO_PIN to new SO_PIN
887* @param slot The slot with the attached token
888* @param old_so_pin The old SO_PIN
889* @param new_so_pin The new SO_PIN
890*/
891BOTAN_PUBLIC_API(2,0) void change_so_pin(Slot& slot, const secure_string& old_so_pin, const secure_string& new_so_pin);
892
893/**
894* Sets user PIN with SO_PIN
895* @param slot The slot with the attached token
896* @param so_pin PIN of the security officer
897* @param pin The user PIN that should be set
898*/
899BOTAN_PUBLIC_API(2,0) void set_pin(Slot& slot, const secure_string& so_pin, const secure_string& pin);
900
901/// Provides access to all PKCS#11 functions
902class BOTAN_PUBLIC_API(2,0) LowLevel
903 {
904 public:
905 /// @param ptr the functon list pointer to use. Can be retrieved via `LowLevel::C_GetFunctionList`
906 explicit LowLevel(FunctionListPtr ptr);
907
908 /****************************** General purpose functions ******************************/
909
910 /**
911 * C_Initialize initializes the Cryptoki library.
912 * @param init_args if this is not nullptr, it gets cast to (`C_InitializeArgs`) and dereferenced
913 * @param return_value default value (`ThrowException`): throw exception on error.
914 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
915 * At least the following PKCS#11 return values may be returned:
916 * \li ArgumentsBad \li CantLock \li CryptokiAlreadyInitialized
917 * \li FunctionFailed \li GeneralError \li HostMemory
918 * \li NeedToCreateThreads \li OK
919 * @return true on success, false otherwise
920 */
921 bool C_Initialize(VoidPtr init_args,
922 ReturnValue* return_value = ThrowException) const;
923
924 /**
925 * C_Finalize indicates that an application is done with the Cryptoki library.
926 * @param reserved reserved. Should be nullptr
927 * @param return_value default value (`ThrowException`): throw exception on error.
928 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
929 * At least the following PKCS#11 return values may be returned:
930 * \li ArgumentsBad \li CryptokiNotInitialized \li FunctionFailed
931 * \li GeneralError \li HostMemory \li OK
932 * @return true on success, false otherwise
933 */
934 bool C_Finalize(VoidPtr reserved,
935 ReturnValue* return_value = ThrowException) const;
936
937 /**
938 * C_GetInfo returns general information about Cryptoki.
939 * @param info_ptr location that receives information
940 * @param return_value default value (`ThrowException`): throw exception on error.
941 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
942 * At least the following PKCS#11 return values may be returned:
943 * \li ArgumentsBad \li CryptokiNotInitialized \li FunctionFailed
944 * \li GeneralError \li HostMemory \li OK
945 * @return true on success, false otherwise
946 */
947 bool C_GetInfo(Info* info_ptr,
948 ReturnValue* return_value = ThrowException) const;
949
950 /**
951 * C_GetFunctionList returns the function list.
952 * @param pkcs11_module The PKCS#11 module
953 * @param function_list_ptr_ptr receives pointer to function list
954 * @param return_value default value (`ThrowException`): throw exception on error.
955 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
956 * At least the following PKCS#11 return values may be returned:
957 * \li ArgumentsBad \li FunctionFailed \li GeneralError
958 * \li HostMemory \li OK
959 * @return true on success, false otherwise
960 */
961 static bool C_GetFunctionList(Dynamically_Loaded_Library& pkcs11_module, FunctionListPtr* function_list_ptr_ptr,
962 ReturnValue* return_value = ThrowException);
963
964 /****************************** Slot and token management functions ******************************/
965
966 /**
967 * C_GetSlotList obtains a list of slots in the system.
968 * @param token_present only slots with tokens
969 * @param slot_list_ptr receives array of slot IDs
970 * @param count_ptr receives number of slots
971 * @param return_value default value (`ThrowException`): throw exception on error.
972 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
973 * At least the following PKCS#11 return values may be returned:
974 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
975 * \li FunctionFailed \li GeneralError \li HostMemory
976 * \li OK
977 * @return true on success, false otherwise
978 */
979 bool C_GetSlotList(Bbool token_present,
980 SlotId* slot_list_ptr,
981 Ulong* count_ptr,
982 ReturnValue* return_value = ThrowException) const;
983
984 /**
985 * C_GetSlotList obtains a list of slots in the system.
986 * @param token_present only slots with tokens
987 * @param slot_ids receives vector of slot IDs
988 * @param return_value default value (`ThrowException`): throw exception on error.
989 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
990 * At least the following PKCS#11 return values may be returned:
991 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
992 * \li FunctionFailed \li GeneralError \li HostMemory
993 * \li OK
994 * @return true on success, false otherwise
995 */
996 bool C_GetSlotList(bool token_present,
997 std::vector<SlotId>& slot_ids,
998 ReturnValue* return_value = ThrowException) const;
999
1000 /**
1001 * C_GetSlotInfo obtains information about a particular slot in the system.
1002 * @param slot_id the ID of the slot
1003 * @param info_ptr receives the slot information
1004 * @param return_value default value (`ThrowException`): throw exception on error.
1005 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1006 * At least the following PKCS#11 return values may be returned:
1007 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1008 * \li FunctionFailed \li GeneralError \li HostMemory
1009 * \li OK \li SlotIdInvalid
1010 * @return true on success, false otherwise
1011 */
1012 bool C_GetSlotInfo(SlotId slot_id,
1013 SlotInfo* info_ptr,
1014 ReturnValue* return_value = ThrowException) const;
1015
1016 /**
1017 * C_GetTokenInfo obtains information about a particular token in the system.
1018 * @param slot_id ID of the token's slot
1019 * @param info_ptr receives the token information
1020 * @param return_value default value (`ThrowException`): throw exception on error.
1021 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1022 * At least the following PKCS#11 return values may be returned:
1023 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1024 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1025 * \li HostMemory \li OK \li SlotIdInvalid
1026 * \li TokenNotPresent \li TokenNotRecognized \li ArgumentsBad
1027 * @return true on success, false otherwise
1028 */
1029 bool C_GetTokenInfo(SlotId slot_id,
1030 TokenInfo* info_ptr,
1031 ReturnValue* return_value = ThrowException) const;
1032
1033 /**
1034 * C_WaitForSlotEvent waits for a slot event (token insertion, removal, etc.) to occur.
1035 * @param flags blocking/nonblocking flag
1036 * @param slot_ptr location that receives the slot ID
1037 * @param reserved reserved. Should be NULL_PTR
1038 * @param return_value default value (`ThrowException`): throw exception on error.
1039 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1040 * At least the following PKCS#11 return values may be returned:
1041 * \li ArgumentsBad \li CryptokiNotInitialized \li FunctionFailed
1042 * \li GeneralError \li HostMemory \li NoEvent
1043 * \li OK
1044 * @return true on success, false otherwise
1045 */
1046 bool C_WaitForSlotEvent(Flags flags,
1047 SlotId* slot_ptr,
1048 VoidPtr reserved,
1049 ReturnValue* return_value = ThrowException) const;
1050
1051 /**
1052 * C_GetMechanismList obtains a list of mechanism types supported by a token.
1053 * @param slot_id ID of token's slot
1054 * @param mechanism_list_ptr gets mech. array
1055 * @param count_ptr gets # of mechs.
1056 * @param return_value default value (`ThrowException`): throw exception on error.
1057 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1058 * At least the following PKCS#11 return values may be returned:
1059 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1060 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1061 * \li GeneralError \li HostMemory \li OK
1062 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1063 * \li ArgumentsBad
1064 * @return true on success, false otherwise
1065 */
1066 bool C_GetMechanismList(SlotId slot_id,
1067 MechanismType* mechanism_list_ptr,
1068 Ulong* count_ptr,
1069 ReturnValue* return_value = ThrowException) const;
1070
1071 /**
1072 * C_GetMechanismList obtains a list of mechanism types supported by a token.
1073 * @param slot_id ID of token's slot
1074 * @param mechanisms receives vector of supported mechanisms
1075 * @param return_value default value (`ThrowException`): throw exception on error.
1076 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1077 * At least the following PKCS#11 return values may be returned:
1078 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1079 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1080 * \li GeneralError \li HostMemory \li OK
1081 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1082 * \li ArgumentsBad
1083 * @return true on success, false otherwise
1084 */
1085 bool C_GetMechanismList(SlotId slot_id,
1086 std::vector<MechanismType>& mechanisms,
1087 ReturnValue* return_value = ThrowException) const;
1088
1089 /**
1090 * C_GetMechanismInfo obtains information about a particular mechanism possibly supported by a token.
1091 * @param slot_id ID of the token's slot
1092 * @param type type of mechanism
1093 * @param info_ptr receives mechanism info
1094 * @param return_value default value (`ThrowException`): throw exception on error.
1095 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1096 * At least the following PKCS#11 return values may be returned:
1097 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1098 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1099 * \li HostMemory \li MechanismInvalid \li OK
1100 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1101 * \li ArgumentsBad
1102 * @return true on success, false otherwise
1103 */
1104 bool C_GetMechanismInfo(SlotId slot_id,
1105 MechanismType type,
1106 MechanismInfo* info_ptr,
1107 ReturnValue* return_value = ThrowException) const;
1108
1109 /**
1110 * C_InitToken initializes a token.
1111 * @param slot_id ID of the token's slot
1112 * @param so_pin_ptr the SO's initial PIN
1113 * @param so_pin_len length in bytes of the SO_PIN
1114 * @param label_ptr 32-byte token label (blank padded)
1115 * @param return_value default value (`ThrowException`): throw exception on error.
1116 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1117 * At least the following PKCS#11 return values may be returned:
1118 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1119 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1120 * \li GeneralError \li HostMemory \li OK
1121 * \li PinIncorrect \li PinLocked \li SessionExists
1122 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1123 * \li TokenWriteProtected \li ArgumentsBad
1124 * @return true on success, false otherwise
1125 */
1126 bool C_InitToken(SlotId slot_id,
1127 Utf8Char* so_pin_ptr,
1128 Ulong so_pin_len,
1129 Utf8Char* label_ptr,
1130 ReturnValue* return_value = ThrowException) const;
1131
1132 /**
1133 * C_InitToken initializes a token.
1134 * @param slot_id ID of the token's slot
1135 * @param so_pin the SO's initial PIN
1136 * @param label token label (at max 32 bytes long)
1137 * @param return_value default value (`ThrowException`): throw exception on error.
1138 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1139 * At least the following PKCS#11 return values may be returned:
1140 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1141 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1142 * \li GeneralError \li HostMemory \li OK
1143 * \li PinIncorrect \li PinLocked \li SessionExists
1144 * \li SlotIdInvalid \li TokenNotPresent \li TokenNotRecognized
1145 * \li TokenWriteProtected \li ArgumentsBad
1146 * @return true on success, false otherwise
1147 */
1148 template<typename TAlloc>
1149 bool C_InitToken(SlotId slot_id,
1150 const std::vector<uint8_t, TAlloc>& so_pin,
1151 const std::string& label,
1152 ReturnValue* return_value = ThrowException) const
1153 {
1154 std::string padded_label = label;
1155 if(label.size() < 32)
1156 {
1157 padded_label.insert(padded_label.end(), 32 - label.size(), ' ');
1158 }
1159
1160 return C_InitToken(slot_id,
1161 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(so_pin.data())),
1162 static_cast<Ulong>(so_pin.size()),
1163 reinterpret_cast< Utf8Char* >(const_cast< char* >(padded_label.c_str())),
1164 return_value);
1165 }
1166
1167 /**
1168 * C_InitPIN initializes the normal user's PIN.
1169 * @param session the session's handle
1170 * @param pin_ptr the normal user's PIN
1171 * @param pin_len length in bytes of the PIN
1172 * @param return_value default value (`ThrowException`): throw exception on error.
1173 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1174 * At least the following PKCS#11 return values may be returned:
1175 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1176 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1177 * \li GeneralError \li HostMemory \li OK
1178 * \li PinInvalid \li PinLenRange \li SessionClosed
1179 * \li SessionReadOnly \li SessionHandleInvalid \li TokenWriteProtected
1180 * \li UserNotLoggedIn \li ArgumentsBad
1181 * @return true on success, false otherwise
1182 */
1183 bool C_InitPIN(SessionHandle session,
1184 Utf8Char* pin_ptr,
1185 Ulong pin_len,
1186 ReturnValue* return_value = ThrowException) const;
1187
1188 /**
1189 * C_InitPIN initializes the normal user's PIN.
1190 * @param session the session's handle
1191 * @param pin the normal user's PIN
1192 * @param return_value default value (`ThrowException`): throw exception on error.
1193 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1194 * At least the following PKCS#11 return values may be returned:
1195 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1196 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1197 * \li GeneralError \li HostMemory \li OK
1198 * \li PinInvalid \li PinLenRange \li SessionClosed
1199 * \li SessionReadOnly \li SessionHandleInvalid \li TokenWriteProtected
1200 * \li UserNotLoggedIn \li ArgumentsBad
1201 * @return true on success, false otherwise
1202 */
1203 template<typename TAlloc>
1204 bool C_InitPIN(SessionHandle session,
1205 const std::vector<uint8_t, TAlloc>& pin,
1206 ReturnValue* return_value = ThrowException) const
1207 {
1208 return C_InitPIN(session,
1209 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(pin.data())),
1210 static_cast<Ulong>(pin.size()),
1211 return_value);
1212 }
1213
1214 /**
1215 * C_SetPIN modifies the PIN of the user who is logged in.
1216 * @param session the session's handle
1217 * @param old_pin_ptr the old PIN
1218 * @param old_len length of the old PIN
1219 * @param new_pin_ptr the new PIN
1220 * @param new_len length of the new PIN
1221 * @param return_value default value (`ThrowException`): throw exception on error.
1222 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1223 * At least the following PKCS#11 return values may be returned:
1224 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1225 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1226 * \li GeneralError \li HostMemory \li OK
1227 * \li PinIncorrect \li PinInvalid \li PinLenRange
1228 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1229 * \li SessionReadOnly \li TokenWriteProtected \li ArgumentsBad
1230 * @return true on success, false otherwise
1231 */
1232 bool C_SetPIN(SessionHandle session,
1233 Utf8Char* old_pin_ptr,
1234 Ulong old_len,
1235 Utf8Char* new_pin_ptr,
1236 Ulong new_len,
1237 ReturnValue* return_value = ThrowException) const;
1238
1239 /**
1240 * C_SetPIN modifies the PIN of the user who is logged in.
1241 * @param session the session's handle
1242 * @param old_pin the old PIN
1243 * @param new_pin the new PIN
1244 * @param return_value default value (`ThrowException`): throw exception on error.
1245 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1246 * At least the following PKCS#11 return values may be returned:
1247 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1248 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1249 * \li GeneralError \li HostMemory \li OK
1250 * \li PinIncorrect \li PinInvalid \li PinLenRange
1251 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1252 * \li SessionReadOnly \li TokenWriteProtected \li ArgumentsBad
1253 * @return true on success, false otherwise
1254 */
1255 template<typename TAlloc>
1256 bool C_SetPIN(SessionHandle session,
1257 const std::vector<uint8_t, TAlloc>& old_pin,
1258 const std::vector<uint8_t, TAlloc>& new_pin,
1259 ReturnValue* return_value = ThrowException) const
1260 {
1261 return C_SetPIN(session,
1262 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(old_pin.data())),
1263 static_cast<Ulong>(old_pin.size()),
1264 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(new_pin.data())),
1265 static_cast<Ulong>(new_pin.size()),
1266 return_value);
1267 }
1268
1269
1270 /****************************** Session management ******************************/
1271
1272 /**
1273 * C_OpenSession opens a session between an application and a token.
1274 * @param slot_id the slot's ID
1275 * @param flags from CK_SESSION_INFO
1276 * @param application passed to callback
1277 * @param notify callback function
1278 * @param session_ptr gets session handle
1279 * @param return_value default value (`ThrowException`): throw exception on error.
1280 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1281 * At least the following PKCS#11 return values may be returned:
1282 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1283 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1284 * \li HostMemory \li OK \li SessionCount
1285 * \li SessionParallelNotSupported \li SessionReadWriteSoExists \li SlotIdInvalid
1286 * \li TokenNotPresent \li TokenNotRecognized \li TokenWriteProtected
1287 * \li ArgumentsBad
1288 * @return true on success, false otherwise
1289 */
1290 bool C_OpenSession(SlotId slot_id,
1291 Flags flags,
1292 VoidPtr application,
1293 Notify notify,
1294 SessionHandle* session_ptr,
1295 ReturnValue* return_value = ThrowException) const;
1296
1297 /**
1298 * C_CloseSession closes a session between an application and a token.
1299 * @param session the session's handle
1300 * @param return_value default value (`ThrowException`): throw exception on error.
1301 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1302 * At least the following PKCS#11 return values may be returned:
1303 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1304 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1305 * \li HostMemory \li OK \li SessionClosed
1306 * \li SessionHandleInvalid
1307 * @return true on success, false otherwise
1308 */
1309 bool C_CloseSession(SessionHandle session,
1310 ReturnValue* return_value = ThrowException) const;
1311
1312 /**
1313 * C_CloseAllSessions closes all sessions with a token.
1314 * @param slot_id the token's slot
1315 * @param return_value default value (`ThrowException`): throw exception on error.
1316 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1317 * At least the following PKCS#11 return values may be returned:
1318 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1319 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1320 * \li HostMemory \li OK \li SlotIdInvalid
1321 * \li TokenNotPresent
1322 * @return true on success, false otherwise
1323 */
1324 bool C_CloseAllSessions(SlotId slot_id,
1325 ReturnValue* return_value = ThrowException) const;
1326
1327 /**
1328 * C_GetSessionInfo obtains information about the session.
1329 * @param session the session's handle
1330 * @param info_ptr receives session info
1331 * @param return_value default value (`ThrowException`): throw exception on error.
1332 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1333 * At least the following PKCS#11 return values may be returned:
1334 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1335 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1336 * \li HostMemory \li OK \li SessionClosed
1337 * \li SessionHandleInvalid \li ArgumentsBad
1338 * @return true on success, false otherwise
1339 */
1340 bool C_GetSessionInfo(SessionHandle session,
1341 SessionInfo* info_ptr,
1342 ReturnValue* return_value = ThrowException) const;
1343
1344 /**
1345 * C_GetOperationState obtains the state of the cryptographic operation in a session.
1346 * @param session session's handle
1347 * @param operation_state_ptr gets state
1348 * @param operation_state_len_ptr gets state length
1349 * @param return_value default value (`ThrowException`): throw exception on error.
1350 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1351 * At least the following PKCS#11 return values may be returned:
1352 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1353 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1354 * \li GeneralError \li HostMemory \li OK
1355 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1356 * \li StateUnsaveable \li ArgumentsBad
1357 * @return true on success, false otherwise
1358 */
1359 bool C_GetOperationState(SessionHandle session,
1360 Byte* operation_state_ptr,
1361 Ulong* operation_state_len_ptr,
1362 ReturnValue* return_value = ThrowException) const;
1363
1364 /**
1365 * C_SetOperationState restores the state of the cryptographic operation in a session.
1366 * @param session session's handle
1367 * @param operation_state_ptr holds state
1368 * @param operation_state_len holds state length
1369 * @param encryption_key en/decryption key
1370 * @param authentication_key sign/verify key
1371 * @param return_value default value (`ThrowException`): throw exception on error.
1372 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1373 * At least the following PKCS#11 return values may be returned:
1374 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1375 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1376 * \li HostMemory \li KeyChanged \li KeyNeeded
1377 * \li KeyNotNeeded \li OK \li SavedStateInvalid
1378 * \li SessionClosed \li SessionHandleInvalid \li ArgumentsBad
1379 * @return true on success, false otherwise
1380 */
1381 bool C_SetOperationState(SessionHandle session,
1382 Byte* operation_state_ptr,
1383 Ulong operation_state_len,
1384 ObjectHandle encryption_key,
1385 ObjectHandle authentication_key,
1386 ReturnValue* return_value = ThrowException) const;
1387
1388 /**
1389 * C_Login logs a user into a token.
1390 * @param session the session's handle
1391 * @param user_type the user type
1392 * @param pin_ptr the user's PIN
1393 * @param pin_len the length of the PIN
1394 * @param return_value default value (`ThrowException`): throw exception on error.
1395 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1396 * At least the following PKCS#11 return values may be returned:
1397 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1398 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1399 * \li FunctionFailed \li GeneralError \li HostMemory
1400 * \li OK \li OperationNotInitialized \li PinIncorrect
1401 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1402 * \li SessionReadOnlyExists \li UserAlreadyLoggedIn \li UserAnotherAlreadyLoggedIn
1403 * \li UserPinNotInitialized \li UserTooManyTypes \li UserTypeInvalid
1404 * @return true on success, false otherwise
1405 */
1406 bool C_Login(SessionHandle session,
1407 UserType user_type,
1408 Utf8Char* pin_ptr,
1409 Ulong pin_len,
1410 ReturnValue* return_value = ThrowException) const;
1411
1412 /**
1413 * C_Login logs a user into a token.
1414 * @param session the session's handle
1415 * @param user_type the user type
1416 * @param pin the user or security officer's PIN
1417 * @param return_value default value (`ThrowException`): throw exception on error.
1418 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1419 * At least the following PKCS#11 return values may be returned:
1420 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1421 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1422 * \li FunctionFailed \li GeneralError \li HostMemory
1423 * \li OK \li OperationNotInitialized \li PinIncorrect
1424 * \li PinLocked \li SessionClosed \li SessionHandleInvalid
1425 * \li SessionReadOnlyExists \li UserAlreadyLoggedIn \li UserAnotherAlreadyLoggedIn
1426 * \li UserPinNotInitialized \li UserTooManyTypes \li UserTypeInvalid
1427 * @return true on success, false otherwise
1428 */
1429 template<typename TAlloc>
1430 bool C_Login(SessionHandle session,
1431 UserType user_type,
1432 const std::vector<uint8_t, TAlloc>& pin,
1433 ReturnValue* return_value = ThrowException) const
1434 {
1435 return C_Login(session, user_type,
1436 reinterpret_cast< Utf8Char* >(const_cast< uint8_t* >(pin.data())),
1437 static_cast<Ulong>(pin.size()),
1438 return_value);
1439 }
1440
1441 /**
1442 * C_Logout logs a user out from a token.
1443 * @param session the session's handle
1444 * @param return_value default value (`ThrowException`): throw exception on error.
1445 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1446 * At least the following PKCS#11 return values may be returned:
1447 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1448 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1449 * \li HostMemory \li OK \li SessionClosed
1450 * \li SessionHandleInvalid \li UserNotLoggedIn
1451 * @return true on success, false otherwise
1452 */
1453 bool C_Logout(SessionHandle session,
1454 ReturnValue* return_value = ThrowException) const;
1455
1456 /****************************** Object management functions ******************************/
1457
1458 /**
1459 * C_CreateObject creates a new object.
1460 * @param session the session's handle
1461 * @param attribute_template_ptr the object's template
1462 * @param count attributes in template
1463 * @param object_ptr gets new object's handle.
1464 * @param return_value default value (`ThrowException`): throw exception on error.
1465 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1466 * At least the following PKCS#11 return values may be returned:
1467 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
1468 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
1469 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1470 * \li DomainParamsInvalid \li FunctionFailed \li GeneralError
1471 * \li HostMemory \li OK \li PinExpired
1472 * \li SessionClosed \li SessionHandleInvalid \li SessionReadOnly
1473 * \li TemplateIncomplete \li TemplateInconsistent \li TokenWriteProtected
1474 * \li UserNotLoggedIn
1475 * @return true on success, false otherwise
1476 */
1477 bool C_CreateObject(SessionHandle session,
1478 Attribute* attribute_template_ptr,
1479 Ulong count,
1480 ObjectHandle* object_ptr,
1481 ReturnValue* return_value = ThrowException) const;
1482
1483 /**
1484 * C_CopyObject copies an object, creating a new object for the copy.
1485 * @param session the session's handle
1486 * @param object the object's handle
1487 * @param attribute_template_ptr template for new object
1488 * @param count attributes in template
1489 * @param new_object_ptr receives handle of copy
1490 * @param return_value default value (`ThrowException`): throw exception on error.
1491 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1492 * At least the following PKCS#11 return values may be returned:
1493 * \li ActionProhibited \li ArgumentsBad \li AttributeReadOnly
1494 * \li AttributeTypeInvalid \li AttributeValueInvalid \li CryptokiNotInitialized
1495 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1496 * \li FunctionFailed \li GeneralError \li HostMemory
1497 * \li ObjectHandleInvalid \li OK \li PinExpired
1498 * \li SessionClosed \li SessionHandleInvalid \li SessionReadOnly
1499 * \li TemplateInconsistent \li TokenWriteProtected \li UserNotLoggedIn
1500 * @return true on success, false otherwise
1501 */
1502 bool C_CopyObject(SessionHandle session,
1503 ObjectHandle object,
1504 Attribute* attribute_template_ptr,
1505 Ulong count,
1506 ObjectHandle* new_object_ptr,
1507 ReturnValue* return_value = ThrowException) const;
1508
1509 /**
1510 * C_DestroyObject destroys an object.
1511 * @param session the session's handle
1512 * @param object the object's handle
1513 * @param return_value default value (`ThrowException`): throw exception on error.
1514 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1515 * At least the following PKCS#11 return values may be returned:
1516 * \li ActionProhibited \li CryptokiNotInitialized \li DeviceError
1517 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1518 * \li GeneralError \li HostMemory \li ObjectHandleInvalid
1519 * \li OK \li PinExpired \li SessionClosed
1520 * \li SessionHandleInvalid \li SessionReadOnly \li TokenWriteProtected
1521 * @return true on success, false otherwise
1522 */
1523 bool C_DestroyObject(SessionHandle session,
1524 ObjectHandle object,
1525 ReturnValue* return_value = ThrowException) const;
1526
1527 /**
1528 * C_GetObjectSize gets the size of an object in bytes.
1529 * @param session the session's handle
1530 * @param object the object's handle
1531 * @param size_ptr receives size of object
1532 * @param return_value default value (`ThrowException`): throw exception on error.
1533 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1534 * At least the following PKCS#11 return values may be returned:
1535 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1536 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1537 * \li GeneralError \li HostMemory \li InformationSensitive
1538 * \li ObjectHandleInvalid \li OK \li SessionClosed
1539 * \li SessionHandleInvalid
1540 * @return true on success, false otherwise
1541 */
1542 bool C_GetObjectSize(SessionHandle session,
1543 ObjectHandle object,
1544 Ulong* size_ptr,
1545 ReturnValue* return_value = ThrowException) const;
1546
1547 /**
1548 * C_GetAttributeValue obtains the value of one or more object attributes.
1549 * @param session the session's handle
1550 * @param object the object's handle
1551 * @param attribute_template_ptr specifies attrs; gets vals
1552 * @param count attributes in template
1553 * @param return_value default value (`ThrowException`): throw exception on error.
1554 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1555 * At least the following PKCS#11 return values may be returned:
1556 * \li ArgumentsBad \li AttributeSensitive \li AttributeTypeInvalid
1557 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1558 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1559 * \li GeneralError \li HostMemory \li ObjectHandleInvalid
1560 * \li OK \li SessionClosed \li SessionHandleInvalid
1561 * @return true on success, false otherwise
1562 */
1563 bool C_GetAttributeValue(SessionHandle session,
1564 ObjectHandle object,
1565 Attribute* attribute_template_ptr,
1566 Ulong count,
1567 ReturnValue* return_value = ThrowException) const;
1568
1569 /**
1570 * C_GetAttributeValue obtains the value of one or more object attributes.
1571 * @param session the session's handle
1572 * @param object the object's handle
1573 * @param attribute_values specifies attrs; gets vals
1574 * @param return_value default value (`ThrowException`): throw exception on error.
1575 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1576 * At least the following PKCS#11 return values may be returned:
1577 * \li ArgumentsBad \li AttributeSensitive \li AttributeTypeInvalid
1578 * \li BufferTooSmall \li CryptokiNotInitialized \li DeviceError
1579 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1580 * \li GeneralError \li HostMemory \li ObjectHandleInvalid
1581 * \li OK \li SessionClosed \li SessionHandleInvalid
1582 * @return true on success, false otherwise
1583 */
1584 template<typename TAlloc>
1585 bool C_GetAttributeValue(SessionHandle session,
1586 ObjectHandle object,
1587 std::map<AttributeType, std::vector<uint8_t, TAlloc>>& attribute_values,
1588 ReturnValue* return_value = ThrowException) const
1589 {
1590 std::vector<Attribute> getter_template;
1591
1592 for(const auto& entry : attribute_values)
1593 {
1594 getter_template.emplace_back(Attribute{ static_cast< CK_ATTRIBUTE_TYPE >(entry.first), nullptr, 0 });
1595 }
1596
1597 bool success = C_GetAttributeValue(session,
1598 object,
1599 const_cast< Attribute* >(getter_template.data()),
1600 static_cast<Ulong>(getter_template.size()),
1601 return_value);
1602
1603 if(!success)
1604 {
1605 return success;
1606 }
1607
1608 size_t i = 0;
1609 for(auto& entry : attribute_values)
1610 {
1611 entry.second.clear();
1612 entry.second.resize(getter_template.at(i).ulValueLen);
1613 getter_template.at(i).pValue = const_cast< uint8_t* >(entry.second.data());
1614 i++;
1615 }
1616
1617 return C_GetAttributeValue(session, object,
1618 const_cast< Attribute* >(getter_template.data()),
1619 static_cast<Ulong>(getter_template.size()),
1620 return_value);
1621 }
1622
1623 /**
1624 * C_SetAttributeValue modifies the value of one or more object attributes.
1625 * @param session the session's handle
1626 * @param object the object's handle
1627 * @param attribute_template_ptr specifies attrs and values
1628 * @param count attributes in template
1629 * @param return_value default value (`ThrowException`): throw exception on error.
1630 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1631 * At least the following PKCS#11 return values may be returned:
1632 * \li ActionProhibited \li ArgumentsBad \li AttributeReadOnly
1633 * \li AttributeTypeInvalid \li AttributeValueInvalid \li CryptokiNotInitialized
1634 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1635 * \li FunctionFailed \li GeneralError \li HostMemory
1636 * \li ObjectHandleInvalid \li OK \li SessionClosed
1637 * \li SessionHandleInvalid \li SessionReadOnly \li TemplateInconsistent
1638 * \li TokenWriteProtected \li UserNotLoggedIn
1639 * @return true on success, false otherwise
1640 */
1641 bool C_SetAttributeValue(SessionHandle session,
1642 ObjectHandle object,
1643 Attribute* attribute_template_ptr,
1644 Ulong count,
1645 ReturnValue* return_value = ThrowException) const;
1646
1647 /**
1648 * C_SetAttributeValue modifies the value of one or more object attributes.
1649 * @param session the session's handle
1650 * @param object the object's handle
1651 * @param attribute_values specifies attrs and values
1652 * @param return_value default value (`ThrowException`): throw exception on error.
1653 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1654 * At least the following PKCS#11 return values may be returned:
1655 * \li ActionProhibited \li ArgumentsBad \li AttributeReadOnly
1656 * \li AttributeTypeInvalid \li AttributeValueInvalid \li CryptokiNotInitialized
1657 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1658 * \li FunctionFailed \li GeneralError \li HostMemory
1659 * \li ObjectHandleInvalid \li OK \li SessionClosed
1660 * \li SessionHandleInvalid \li SessionReadOnly \li TemplateInconsistent
1661 * \li TokenWriteProtected \li UserNotLoggedIn
1662 * @return true on success, false otherwise
1663 */
1664 template<typename TAlloc>
1665 bool C_SetAttributeValue(SessionHandle session,
1666 ObjectHandle object,
1667 std::map<AttributeType, std::vector<uint8_t, TAlloc>>& attribute_values,
1668 ReturnValue* return_value = ThrowException) const
1669 {
1670 std::vector<Attribute> setter_template;
1671
1672 for(auto& entry : attribute_values)
1673 {
1674 setter_template.emplace_back(Attribute{ static_cast< CK_ATTRIBUTE_TYPE >(entry.first), entry.second.data(), static_cast<CK_ULONG>(entry.second.size()) });
1675 }
1676
1677 return C_SetAttributeValue(session, object,
1678 const_cast< Attribute* >(setter_template.data()),
1679 static_cast<Ulong>(setter_template.size()),
1680 return_value);
1681 }
1682
1683 /**
1684 * C_FindObjectsInit initializes a search for token and session objects that match a template.
1685 * @param session the session's handle
1686 * @param attribute_template_ptr attribute values to match
1687 * @param count attrs in search template
1688 * @param return_value default value (`ThrowException`): throw exception on error.
1689 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1690 * At least the following PKCS#11 return values may be returned:
1691 * \li ArgumentsBad \li AttributeTypeInvalid \li AttributeValueInvalid
1692 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1693 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1694 * \li HostMemory \li OK \li OperationActive
1695 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
1696 * @return true on success, false otherwise
1697 */
1698 bool C_FindObjectsInit(SessionHandle session,
1699 Attribute* attribute_template_ptr,
1700 Ulong count,
1701 ReturnValue* return_value = ThrowException) const;
1702
1703 /**
1704 * C_FindObjects continues a search for token and session objects that match a template, obtaining additional object handles.
1705 * @param session session's handle
1706 * @param object_ptr gets obj. handles
1707 * @param max_object_count max handles to get
1708 * @param object_count_ptr actual # returned
1709 * @param return_value default value (`ThrowException`): throw exception on error.
1710 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1711 * At least the following PKCS#11 return values may be returned:
1712 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1713 * \li DeviceMemory \li DeviceRemoved \li FunctionFailed
1714 * \li GeneralError \li HostMemory \li OK
1715 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1716 * @return true on success, false otherwise
1717 */
1718 bool C_FindObjects(SessionHandle session,
1719 ObjectHandle* object_ptr,
1720 Ulong max_object_count,
1721 Ulong* object_count_ptr,
1722 ReturnValue* return_value = ThrowException) const;
1723
1724 /**
1725 * C_FindObjectsFinal finishes a search for token and session objects.
1726 * @param session the session's handle
1727 * @param return_value default value (`ThrowException`): throw exception on error.
1728 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1729 * At least the following PKCS#11 return values may be returned:
1730 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1731 * \li DeviceRemoved \li FunctionFailed \li GeneralError
1732 * \li HostMemory \li OK \li OperationNotInitialized
1733 * \li SessionClosed \li SessionHandleInvalid
1734 * @return true on success, false otherwise
1735 */
1736 bool C_FindObjectsFinal(SessionHandle session,
1737 ReturnValue* return_value = ThrowException) const;
1738
1739 /****************************** Encryption functions ******************************/
1740
1741 /**
1742 * C_EncryptInit initializes an encryption operation.
1743 * @param session the session's handle
1744 * @param mechanism_ptr the encryption mechanism
1745 * @param key handle of encryption key
1746 * @param return_value default value (`ThrowException`): throw exception on error.
1747 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1748 * At least the following PKCS#11 return values may be returned:
1749 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
1750 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1751 * \li GeneralError \li HostMemory \li KeyFunctionNotPermitted
1752 * \li KeyHandleInvalid \li KeySizeRange \li KeyTypeInconsistent
1753 * \li MechanismInvalid \li MechanismParamInvalid \li OK
1754 * \li OperationActive \li PinExpired \li SessionClosed
1755 * \li SessionHandleInvalid \li UserNotLoggedIn
1756 * @return true on success, false otherwise
1757 */
1758 bool C_EncryptInit(SessionHandle session,
1759 Mechanism* mechanism_ptr,
1760 ObjectHandle key,
1761 ReturnValue* return_value = ThrowException) const;
1762
1763 /**
1764 * C_Encrypt encrypts single-part data.
1765 * @param session session's handle
1766 * @param data_ptr the plaintext data
1767 * @param data_len size of plaintext data in bytes
1768 * @param encrypted_data gets ciphertext
1769 * @param encrypted_data_len_ptr gets c-text size
1770 * @param return_value default value (`ThrowException`): throw exception on error.
1771 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1772 * At least the following PKCS#11 return values may be returned:
1773 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1774 * \li DataInvalid \li DataLenRange \li DeviceError
1775 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1776 * \li FunctionFailed \li GeneralError \li HostMemory
1777 * \li OK \li OperationNotInitialized \li SessionClosed
1778 * \li SessionHandleInvalid
1779 * @return true on success, false otherwise
1780 */
1781 bool C_Encrypt(SessionHandle session,
1782 Byte* data_ptr,
1783 Ulong data_len,
1784 Byte* encrypted_data,
1785 Ulong* encrypted_data_len_ptr,
1786 ReturnValue* return_value = ThrowException) const;
1787
1788 /**
1789 * C_Encrypt encrypts single-part data.
1790 * @param session session's handle
1791 * @param plaintext_data the plaintext data
1792 * @param encrypted_data gets ciphertext
1793 * @param return_value default value (`ThrowException`): throw exception on error.
1794 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1795 * At least the following PKCS#11 return values may be returned:
1796 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1797 * \li DataInvalid \li DataLenRange \li DeviceError
1798 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1799 * \li FunctionFailed \li GeneralError \li HostMemory
1800 * \li OK \li OperationNotInitialized \li SessionClosed
1801 * \li SessionHandleInvalid
1802 * @return true on success, false otherwise
1803 */
1804 template<typename TAllocA, typename TAllocB>
1805 bool C_Encrypt(SessionHandle session,
1806 const std::vector<uint8_t, TAllocA>& plaintext_data,
1807 std::vector<uint8_t, TAllocB>& encrypted_data,
1808 ReturnValue* return_value = ThrowException) const
1809 {
1810 Ulong encrypted_size = 0;
1811 if(!C_Encrypt(session,
1812 const_cast<Byte*>((plaintext_data.data())),
1813 static_cast<Ulong>(plaintext_data.size()),
1814 nullptr, &encrypted_size,
1815 return_value))
1816 {
1817 return false;
1818 }
1819
1820 encrypted_data.resize(encrypted_size);
1821 if (!C_Encrypt(session,
1822 const_cast<Byte*>(plaintext_data.data()),
1823 static_cast<Ulong>(plaintext_data.size()),
1824 encrypted_data.data(),
1825 &encrypted_size, return_value))
1826 {
1827 return false;
1828 }
1829 encrypted_data.resize(encrypted_size);
1830 return true;
1831 }
1832
1833 /**
1834 * C_EncryptUpdate continues a multiple-part encryption operation.
1835 * @param session session's handle
1836 * @param part_ptr the plaintext data
1837 * @param part_len plaintext data len
1838 * @param encrypted_part_ptr gets ciphertext
1839 * @param encrypted_part_len_ptr gets c-text size
1840 * @param return_value default value (`ThrowException`): throw exception on error.
1841 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1842 * At least the following PKCS#11 return values may be returned:
1843 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1844 * \li DataLenRange \li DeviceError \li DeviceMemory
1845 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1846 * \li GeneralError \li HostMemory \li OK
1847 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1848 * @return true on success, false otherwise
1849 */
1850 bool C_EncryptUpdate(SessionHandle session,
1851 Byte* part_ptr,
1852 Ulong part_len,
1853 Byte* encrypted_part_ptr,
1854 Ulong* encrypted_part_len_ptr,
1855 ReturnValue* return_value = ThrowException) const;
1856
1857 /**
1858 * C_EncryptFinal finishes a multiple-part encryption operation.
1859 * @param session session handle
1860 * @param last_encrypted_part_ptr last c-text
1861 * @param last_encrypted_part_len_ptr gets last size
1862 * @param return_value default value (`ThrowException`): throw exception on error.
1863 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1864 * At least the following PKCS#11 return values may be returned:
1865 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1866 * \li DataLenRange \li DeviceError \li DeviceMemory
1867 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
1868 * \li GeneralError \li HostMemory \li OK
1869 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
1870 * @return true on success, false otherwise
1871 */
1872 bool C_EncryptFinal(SessionHandle session,
1873 Byte* last_encrypted_part_ptr,
1874 Ulong* last_encrypted_part_len_ptr,
1875 ReturnValue* return_value = ThrowException) const;
1876
1877 /****************************** Decryption functions ******************************/
1878
1879 /**
1880 * C_DecryptInit initializes a decryption operation.
1881 * @param session the session's handle
1882 * @param mechanism_ptr the decryption mechanism
1883 * @param key handle of decryption key
1884 * @param return_value default value (`ThrowException`): throw exception on error.
1885 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1886 * At least the following PKCS#11 return values may be returned:
1887 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
1888 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
1889 * \li FunctionFailed \li GeneralError \li HostMemory
1890 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
1891 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
1892 * \li OK \li OperationActive \li PinExpired
1893 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
1894 * @return true on success, false otherwise
1895 */
1896 bool C_DecryptInit(SessionHandle session,
1897 Mechanism* mechanism_ptr,
1898 ObjectHandle key,
1899 ReturnValue* return_value = ThrowException) const;
1900
1901 /**
1902 * C_Decrypt decrypts encrypted data in a single part.
1903 * @param session session's handle
1904 * @param encrypted_data_ptr ciphertext
1905 * @param encrypted_data_len ciphertext length
1906 * @param data_ptr gets plaintext
1907 * @param data_len_ptr gets p-text size
1908 * @param return_value default value (`ThrowException`): throw exception on error.
1909 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1910 * At least the following PKCS#11 return values may be returned:
1911 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1912 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1913 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1914 * \li FunctionFailed \li GeneralError \li HostMemory
1915 * \li OK \li OperationNotInitialized \li SessionClosed
1916 * \li SessionHandleInvalid \li UserNotLoggedIn
1917 * @return true on success, false otherwise
1918 */
1919 bool C_Decrypt(SessionHandle session,
1920 Byte* encrypted_data_ptr,
1921 Ulong encrypted_data_len,
1922 Byte* data_ptr,
1923 Ulong* data_len_ptr,
1924 ReturnValue* return_value = ThrowException) const;
1925
1926 /**
1927 * C_Decrypt decrypts encrypted data in a single part.
1928 * @param session session's handle
1929 * @param encrypted_data ciphertext
1930 * @param decrypted_data gets plaintext
1931 * @param return_value default value (`ThrowException`): throw exception on error.
1932 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1933 * At least the following PKCS#11 return values may be returned:
1934 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1935 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1936 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1937 * \li FunctionFailed \li GeneralError \li HostMemory
1938 * \li OK \li OperationNotInitialized \li SessionClosed
1939 * \li SessionHandleInvalid \li UserNotLoggedIn
1940 * @return true on success, false otherwise
1941 */
1942 template<typename TAllocA, typename TAllocB>
1943 bool C_Decrypt(SessionHandle session,
1944 const std::vector<uint8_t, TAllocA>& encrypted_data,
1945 std::vector<uint8_t, TAllocB>& decrypted_data,
1946 ReturnValue* return_value = ThrowException) const
1947 {
1948 Ulong decrypted_size = 0;
1949 if(!C_Decrypt(session,
1950 const_cast<Byte*>((encrypted_data.data())),
1951 static_cast<Ulong>(encrypted_data.size()),
1952 nullptr, &decrypted_size,
1953 return_value))
1954 {
1955 return false;
1956 }
1957
1958 decrypted_data.resize(decrypted_size);
1959 if(!C_Decrypt(session,
1960 const_cast<Byte*>(encrypted_data.data()),
1961 static_cast<Ulong>(encrypted_data.size()),
1962 decrypted_data.data(),
1963 &decrypted_size, return_value))
1964 {
1965 return false;
1966 }
1967 decrypted_data.resize(decrypted_size);
1968 return true;
1969 }
1970
1971 /**
1972 * C_DecryptUpdate continues a multiple-part decryption operation.
1973 * @param session session's handle
1974 * @param encrypted_part_ptr encrypted data
1975 * @param encrypted_part_len input length
1976 * @param part_ptr gets plaintext
1977 * @param part_len_ptr p-text size
1978 * @param return_value default value (`ThrowException`): throw exception on error.
1979 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
1980 * At least the following PKCS#11 return values may be returned:
1981 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
1982 * \li DeviceError \li DeviceMemory \li DeviceRemoved
1983 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
1984 * \li FunctionFailed \li GeneralError \li HostMemory
1985 * \li OK \li OperationNotInitialized \li SessionClosed
1986 * \li SessionHandleInvalid \li UserNotLoggedIn
1987 * @return true on success, false otherwise
1988 */
1989 bool C_DecryptUpdate(SessionHandle session,
1990 Byte* encrypted_part_ptr,
1991 Ulong encrypted_part_len,
1992 Byte* part_ptr,
1993 Ulong* part_len_ptr,
1994 ReturnValue* return_value = ThrowException) const;
1995
1996 /**
1997 * C_DecryptFinal finishes a multiple-part decryption operation.
1998 * @param session the session's handle
1999 * @param last_part_ptr gets plaintext
2000 * @param last_part_len_ptr p-text size
2001 * @param return_value default value (`ThrowException`): throw exception on error.
2002 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2003 * At least the following PKCS#11 return values may be returned:
2004 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2005 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2006 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
2007 * \li FunctionFailed \li GeneralError \li HostMemory
2008 * \li OK \li OperationNotInitialized \li SessionClosed
2009 * \li SessionHandleInvalid \li UserNotLoggedIn
2010 * @return true on success, false otherwise
2011 */
2012 bool C_DecryptFinal(SessionHandle session,
2013 Byte* last_part_ptr,
2014 Ulong* last_part_len_ptr,
2015 ReturnValue* return_value = ThrowException) const;
2016
2017 /****************************** Message digesting functions ******************************/
2018
2019 /**
2020 * C_DigestInit initializes a message-digesting operation.
2021 * @param session the session's handle
2022 * @param mechanism_ptr the digesting mechanism
2023 * @param return_value default value (`ThrowException`): throw exception on error.
2024 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2025 * At least the following PKCS#11 return values may be returned:
2026 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2027 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2028 * \li FunctionFailed \li GeneralError \li HostMemory
2029 * \li MechanismInvalid \li MechanismParamInvalid \li OK
2030 * \li OperationActive \li PinExpired \li SessionClosed
2031 * \li SessionHandleInvalid \li UserNotLoggedIn
2032 * @return true on success, false otherwise
2033 */
2034 bool C_DigestInit(SessionHandle session,
2035 Mechanism* mechanism_ptr,
2036 ReturnValue* return_value = ThrowException) const;
2037
2038 /**
2039 * C_Digest digests data in a single part.
2040 * @param session the session's handle
2041 * @param data_ptr data to be digested
2042 * @param data_len bytes of data to digest
2043 * @param digest_ptr gets the message digest
2044 * @param digest_len_ptr gets digest length
2045 * @param return_value default value (`ThrowException`): throw exception on error.
2046 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2047 * At least the following PKCS#11 return values may be returned:
2048 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2049 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2050 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2051 * \li HostMemory \li OK \li OperationNotInitialized
2052 * \li SessionClosed \li SessionHandleInvalid
2053 * @return true on success, false otherwise
2054 */
2055 bool C_Digest(SessionHandle session,
2056 Byte* data_ptr,
2057 Ulong data_len,
2058 Byte* digest_ptr,
2059 Ulong* digest_len_ptr,
2060 ReturnValue* return_value = ThrowException) const;
2061
2062 /**
2063 * C_DigestUpdate continues a multiple-part message-digesting operation.
2064 * @param session the session's handle
2065 * @param part_ptr data to be digested
2066 * @param part_len bytes of data to be digested
2067 * @param return_value default value (`ThrowException`): throw exception on error.
2068 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2069 * At least the following PKCS#11 return values may be returned:
2070 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2071 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2072 * \li FunctionFailed \li GeneralError \li HostMemory
2073 * \li OK \li OperationNotInitialized \li SessionClosed
2074 * \li SessionHandleInvalid
2075 * @return true on success, false otherwise
2076 */
2077 bool C_DigestUpdate(SessionHandle session,
2078 Byte* part_ptr,
2079 Ulong part_len,
2080 ReturnValue* return_value = ThrowException) const;
2081
2082 /**
2083 * C_DigestKey continues a multi-part message-digesting operation, by digesting the value of a secret key as part of the data already digested.
2084 * @param session the session's handle
2085 * @param key secret key to digest
2086 * @param return_value default value (`ThrowException`): throw exception on error.
2087 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2088 * At least the following PKCS#11 return values may be returned:
2089 * \li CryptokiNotInitialized \li DeviceError \li DeviceMemory
2090 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2091 * \li GeneralError \li HostMemory \li KeyHandleInvalid
2092 * \li KeyIndigestible \li KeySizeRange \li OK
2093 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2094 * @return true on success, false otherwise
2095 */
2096 bool C_DigestKey(SessionHandle session,
2097 ObjectHandle key,
2098 ReturnValue* return_value = ThrowException) const;
2099
2100 /**
2101 * C_DigestFinal finishes a multiple-part message-digesting operation.
2102 * @param session the session's handle
2103 * @param digest_ptr gets the message digest
2104 * @param digest_len_ptr gets uint8_t count of digest
2105 * @param return_value default value (`ThrowException`): throw exception on error.
2106 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2107 * At least the following PKCS#11 return values may be returned:
2108 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2109 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2110 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2111 * \li HostMemory \li OK \li OperationNotInitialized
2112 * \li SessionClosed \li SessionHandleInvalid
2113 * @return true on success, false otherwise
2114 */
2115 bool C_DigestFinal(SessionHandle session,
2116 Byte* digest_ptr,
2117 Ulong* digest_len_ptr,
2118 ReturnValue* return_value = ThrowException) const;
2119
2120 /****************************** Signing and MACing functions ******************************/
2121
2122 /**
2123 * C_SignInit initializes a signature (private key encryption) operation, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2124 * @param session the session's handle
2125 * @param mechanism_ptr the signature mechanism
2126 * @param key handle of signature key
2127 * @param return_value default value (`ThrowException`): throw exception on error.
2128 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2129 * At least the following PKCS#11 return values may be returned:
2130 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2131 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2132 * \li FunctionFailed \li GeneralError \li HostMemory
2133 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2134 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2135 * \li OK \li OperationActive \li PinExpired
2136 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2137 * @return true on success, false otherwise
2138 */
2139 bool C_SignInit(SessionHandle session,
2140 Mechanism* mechanism_ptr,
2141 ObjectHandle key,
2142 ReturnValue* return_value = ThrowException) const;
2143
2144 /**
2145 * C_Sign signs (encrypts with private key) data in a single part, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2146 * @param session the session's handle
2147 * @param data_ptr the data to sign
2148 * @param data_len count of bytes to sign
2149 * @param signature_ptr gets the signature
2150 * @param signature_len_ptr gets signature length
2151 * @param return_value default value (`ThrowException`): throw exception on error.
2152 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2153 * At least the following PKCS#11 return values may be returned:
2154 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2155 * \li DataInvalid \li DataLenRange \li DeviceError
2156 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2157 * \li FunctionFailed \li GeneralError \li HostMemory
2158 * \li OK \li OperationNotInitialized \li SessionClosed
2159 * \li SessionHandleInvalid \li UserNotLoggedIn \li FunctionRejected
2160 * @return true on success, false otherwise
2161 */
2162 bool C_Sign(SessionHandle session,
2163 Byte* data_ptr,
2164 Ulong data_len,
2165 Byte* signature_ptr,
2166 Ulong* signature_len_ptr,
2167 ReturnValue* return_value = ThrowException) const;
2168
2169 /**
2170 * C_Sign signs (encrypts with private key) data in a single part, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2171 * @param session the session's handle
2172 * @param data the data to sign
2173 * @param signature gets the signature
2174 * @param return_value default value (`ThrowException`): throw exception on error.
2175 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2176 * At least the following PKCS#11 return values may be returned:
2177 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2178 * \li DataInvalid \li DataLenRange \li DeviceError
2179 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2180 * \li FunctionFailed \li GeneralError \li HostMemory
2181 * \li OK \li OperationNotInitialized \li SessionClosed
2182 * \li SessionHandleInvalid \li UserNotLoggedIn \li FunctionRejected
2183 * @return true on success, false otherwise
2184 */
2185 template<typename TAllocA, typename TAllocB>
2186 bool C_Sign(SessionHandle session,
2187 const std::vector<uint8_t, TAllocA>& data,
2188 std::vector<uint8_t, TAllocB>& signature,
2189 ReturnValue* return_value = ThrowException) const
2190 {
2191 Ulong signature_size = 0;
2192 if(!C_Sign(session,
2193 const_cast<Byte*>((data.data())),
2194 static_cast<Ulong>(data.size()),
2195 nullptr,
2196 &signature_size,
2197 return_value))
2198 {
2199 return false;
2200 }
2201
2202 signature.resize(signature_size);
2203 if (!C_Sign(session,
2204 const_cast<Byte*>(data.data()),
2205 static_cast<Ulong>(data.size()),
2206 signature.data(),
2207 &signature_size,
2208 return_value))
2209 {
2210 return false;
2211 }
2212 signature.resize(signature_size);
2213 return true;
2214 }
2215
2216 /**
2217 * C_SignUpdate continues a multiple-part signature operation, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2218 * @param session the session's handle
2219 * @param part_ptr the data to sign
2220 * @param part_len count of bytes to sign
2221 * @param return_value default value (`ThrowException`): throw exception on error.
2222 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2223 * At least the following PKCS#11 return values may be returned:
2224 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2225 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2226 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2227 * \li HostMemory \li OK \li OperationNotInitialized
2228 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2229 * @return true on success, false otherwise
2230 */
2231 bool C_SignUpdate(SessionHandle session,
2232 Byte* part_ptr,
2233 Ulong part_len,
2234 ReturnValue* return_value = ThrowException) const;
2235
2236 /**
2237 * C_SignUpdate continues a multiple-part signature operation, where the signature is (will be) an appendix to the data, and plaintext cannot be recovered from the signature.
2238 * @param session the session's handle
2239 * @param part the data to sign
2240 * @param return_value default value (`ThrowException`): throw exception on error.
2241 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2242 * At least the following PKCS#11 return values may be returned:
2243 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2244 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2245 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2246 * \li HostMemory \li OK \li OperationNotInitialized
2247 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2248 * @return true on success, false otherwise
2249 */
2250 template<typename TAlloc>
2251 bool C_SignUpdate(SessionHandle session,
2252 const std::vector<uint8_t, TAlloc>& part,
2253 ReturnValue* return_value = ThrowException) const
2254 {
2255 return C_SignUpdate(session,
2256 const_cast<Byte*>(part.data()),
2257 static_cast<Ulong>(part.size()),
2258 return_value);
2259 }
2260
2261 /**
2262 * C_SignFinal finishes a multiple-part signature operation, returning the signature.
2263 * @param session the session's handle
2264 * @param signature_ptr gets the signature
2265 * @param signature_len_ptr gets signature length
2266 * @param return_value default value (`ThrowException`): throw exception on error.
2267 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2268 * At least the following PKCS#11 return values may be returned:
2269 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2270 * \li DataLenRange \li DeviceError \li DeviceMemory
2271 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2272 * \li GeneralError \li HostMemory \li OK
2273 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2274 * \li UserNotLoggedIn \li FunctionRejected
2275 * @return true on success, false otherwise
2276 */
2277 bool C_SignFinal(SessionHandle session,
2278 Byte* signature_ptr,
2279 Ulong* signature_len_ptr,
2280 ReturnValue* return_value = ThrowException) const;
2281
2282 /**
2283 * C_SignFinal finishes a multiple-part signature operation, returning the signature.
2284 * @param session the session's handle
2285 * @param signature gets the signature
2286 * @param return_value default value (`ThrowException`): throw exception on error.
2287 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2288 * At least the following PKCS#11 return values may be returned:
2289 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2290 * \li DataLenRange \li DeviceError \li DeviceMemory
2291 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2292 * \li GeneralError \li HostMemory \li OK
2293 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2294 * \li UserNotLoggedIn \li FunctionRejected
2295 * @return true on success, false otherwise
2296 */
2297 template<typename TAlloc>
2298 bool C_SignFinal(SessionHandle session,
2299 std::vector<uint8_t, TAlloc>& signature,
2300 ReturnValue* return_value = ThrowException) const
2301 {
2302 Ulong signature_size = 0;
2303 if(!C_SignFinal(session, nullptr, &signature_size, return_value))
2304 {
2305 return false;
2306 }
2307
2308 signature.resize(signature_size);
2309 if (!C_SignFinal(session, signature.data(), &signature_size, return_value))
2310 {
2311 return false;
2312 }
2313 signature.resize(signature_size);
2314 return true;
2315 }
2316
2317 /**
2318 * C_SignRecoverInit initializes a signature operation, where the data can be recovered from the signature.
2319 * @param session the session's handle
2320 * @param mechanism_ptr the signature mechanism
2321 * @param key handle of the signature key
2322 * @param return_value default value (`ThrowException`): throw exception on error.
2323 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2324 * At least the following PKCS#11 return values may be returned:
2325 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2326 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2327 * \li FunctionFailed \li GeneralError \li HostMemory
2328 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2329 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2330 * \li OK \li OperationActive \li PinExpired
2331 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2332 * @return true on success, false otherwise
2333 */
2334 bool C_SignRecoverInit(SessionHandle session,
2335 Mechanism* mechanism_ptr,
2336 ObjectHandle key,
2337 ReturnValue* return_value = ThrowException) const;
2338
2339 /**
2340 * C_SignRecover signs data in a single operation, where the data can be recovered from the signature.
2341 * @param session the session's handle
2342 * @param data_ptr the data to sign
2343 * @param data_len count of bytes to sign
2344 * @param signature_ptr gets the signature
2345 * @param signature_len_ptr gets signature length
2346 * @param return_value default value (`ThrowException`): throw exception on error.
2347 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2348 * At least the following PKCS#11 return values may be returned:
2349 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2350 * \li DataInvalid \li DataLenRange \li DeviceError
2351 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2352 * \li FunctionFailed \li GeneralError \li HostMemory
2353 * \li OK \li OperationNotInitialized \li SessionClosed
2354 * \li SessionHandleInvalid \li UserNotLoggedIn
2355 * @return true on success, false otherwise
2356 */
2357 bool C_SignRecover(SessionHandle session,
2358 Byte* data_ptr,
2359 Ulong data_len,
2360 Byte* signature_ptr,
2361 Ulong* signature_len_ptr,
2362 ReturnValue* return_value = ThrowException) const;
2363
2364 /****************************** Functions for verifying signatures and MACs ******************************/
2365
2366 /**
2367 * C_VerifyInit initializes a verification operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature (e.g. DSA).
2368 * @param session the session's handle
2369 * @param mechanism_ptr the verification mechanism
2370 * @param key verification key
2371 * @param return_value default value (`ThrowException`): throw exception on error.
2372 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2373 * At least the following PKCS#11 return values may be returned:
2374 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2375 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2376 * \li FunctionFailed \li GeneralError \li HostMemory
2377 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2378 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2379 * \li OK \li OperationActive \li PinExpired
2380 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2381 * @return true on success, false otherwise
2382 */
2383 bool C_VerifyInit(SessionHandle session,
2384 Mechanism* mechanism_ptr,
2385 ObjectHandle key,
2386 ReturnValue* return_value = ThrowException) const;
2387
2388 /**
2389 * C_Verify verifies a signature in a single-part operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2390 * @param session the session's handle
2391 * @param data_ptr signed data
2392 * @param data_len length of signed data
2393 * @param signature_ptr signature
2394 * @param signature_len signature length
2395 * @param return_value default value (`ThrowException`): throw exception on error.
2396 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2397 * At least the following PKCS#11 return values may be returned:
2398 * \li ArgumentsBad \li CryptokiNotInitialized \li DataInvalid
2399 * \li DataLenRange \li DeviceError \li DeviceMemory
2400 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2401 * \li GeneralError \li HostMemory \li OK
2402 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2403 * \li SignatureInvalid \li SignatureLenRange
2404 * @return true on success, false otherwise
2405 */
2406 bool C_Verify(SessionHandle session,
2407 Byte* data_ptr,
2408 Ulong data_len,
2409 Byte* signature_ptr,
2410 Ulong signature_len,
2411 ReturnValue* return_value = ThrowException) const;
2412
2413 /**
2414 * C_Verify verifies a signature in a single-part operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2415 * @param session the session's handle
2416 * @param data signed data
2417 * @param signature signature
2418 * @param return_value default value (`ThrowException`): throw exception on error.
2419 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2420 * At least the following PKCS#11 return values may be returned:
2421 * \li ArgumentsBad \li CryptokiNotInitialized \li DataInvalid
2422 * \li DataLenRange \li DeviceError \li DeviceMemory
2423 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2424 * \li GeneralError \li HostMemory \li OK
2425 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2426 * \li SignatureInvalid \li SignatureLenRange
2427 * @return true on success, false otherwise
2428 */
2429 template<typename TAllocA, typename TAllocB>
2430 bool C_Verify(SessionHandle session,
2431 const std::vector<uint8_t, TAllocA>& data,
2432 std::vector<uint8_t, TAllocB>& signature,
2433 ReturnValue* return_value = ThrowException) const
2434 {
2435 return C_Verify(session,
2436 const_cast<Byte*>(data.data()),
2437 static_cast<Ulong>(data.size()),
2438 signature.data(),
2439 static_cast<Ulong>(signature.size()),
2440 return_value);
2441 }
2442
2443 /**
2444 * C_VerifyUpdate continues a multiple-part verification operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2445 * @param session the session's handle
2446 * @param part_ptr signed data
2447 * @param part_len length of signed data
2448 * @param return_value default value (`ThrowException`): throw exception on error.
2449 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2450 * At least the following PKCS#11 return values may be returned:
2451 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2452 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2453 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2454 * \li HostMemory \li OK \li OperationNotInitialized
2455 * \li SessionClosed \li SessionHandleInvalid
2456 * @return true on success, false otherwise
2457 */
2458 bool C_VerifyUpdate(SessionHandle session,
2459 Byte* part_ptr,
2460 Ulong part_len,
2461 ReturnValue* return_value = ThrowException) const;
2462
2463 /**
2464 * C_VerifyUpdate continues a multiple-part verification operation, where the signature is an appendix to the data, and plaintext cannot be recovered from the signature.
2465 * @param session the session's handle
2466 * @param part signed data
2467 * @param return_value default value (`ThrowException`): throw exception on error.
2468 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2469 * At least the following PKCS#11 return values may be returned:
2470 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2471 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2472 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2473 * \li HostMemory \li OK \li OperationNotInitialized
2474 * \li SessionClosed \li SessionHandleInvalid
2475 * @return true on success, false otherwise
2476 */
2477 template<typename TAlloc>
2478 bool C_VerifyUpdate(SessionHandle session,
2479 std::vector<uint8_t, TAlloc> part,
2480 ReturnValue* return_value = ThrowException) const
2481 {
2482 return C_VerifyUpdate(session, part.data(), static_cast<Ulong>(part.size()), return_value);
2483 }
2484
2485 /**
2486 * C_VerifyFinal finishes a multiple-part verification operation, checking the signature.
2487 * @param session the session's handle
2488 * @param signature_ptr signature to verify
2489 * @param signature_len signature length
2490 * @param return_value default value (`ThrowException`): throw exception on error.
2491 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2492 * At least the following PKCS#11 return values may be returned:
2493 * \li ArgumentsBad \li CryptokiNotInitialized \li DataLenRange
2494 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2495 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2496 * \li HostMemory \li OK \li OperationNotInitialized
2497 * \li SessionClosed \li SessionHandleInvalid \li SignatureInvalid
2498 * \li SignatureLenRange
2499 * @return true on success, false otherwise
2500 */
2501 bool C_VerifyFinal(SessionHandle session,
2502 Byte* signature_ptr,
2503 Ulong signature_len,
2504 ReturnValue* return_value = ThrowException) const;
2505
2506 /**
2507 * C_VerifyRecoverInit initializes a signature verification operation, where the data is recovered from the signature.
2508 * @param session the session's handle
2509 * @param mechanism_ptr the verification mechanism
2510 * @param key verification key
2511 * @param return_value default value (`ThrowException`): throw exception on error.
2512 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2513 * At least the following PKCS#11 return values may be returned:
2514 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2515 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2516 * \li FunctionFailed \li GeneralError \li HostMemory
2517 * \li KeyFunctionNotPermitted \li KeyHandleInvalid \li KeySizeRange
2518 * \li KeyTypeInconsistent \li MechanismInvalid \li MechanismParamInvalid
2519 * \li OK \li OperationActive \li PinExpired
2520 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2521 * @return true on success, false otherwise
2522 */
2523 bool C_VerifyRecoverInit(SessionHandle session,
2524 Mechanism* mechanism_ptr,
2525 ObjectHandle key,
2526 ReturnValue* return_value = ThrowException) const;
2527
2528 /**
2529 * C_VerifyRecover verifies a signature in a single-part operation, where the data is recovered from the signature.
2530 * @param session the session's handle
2531 * @param signature_ptr signature to verify
2532 * @param signature_len signature length
2533 * @param data_ptr gets signed data
2534 * @param data_len_ptr gets signed data len
2535 * @param return_value default value (`ThrowException`): throw exception on error.
2536 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2537 * At least the following PKCS#11 return values may be returned:
2538 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2539 * \li DataInvalid \li DataLenRange \li DeviceError
2540 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2541 * \li FunctionFailed \li GeneralError \li HostMemory
2542 * \li OK \li OperationNotInitialized \li SessionClosed
2543 * \li SessionHandleInvalid \li SignatureLenRange \li SignatureInvalid
2544 * @return true on success, false otherwise
2545 */
2546 bool C_VerifyRecover(SessionHandle session,
2547 Byte* signature_ptr,
2548 Ulong signature_len,
2549 Byte* data_ptr,
2550 Ulong* data_len_ptr,
2551 ReturnValue* return_value = ThrowException) const;
2552
2553 /****************************** Dual-purpose cryptographic functions ******************************/
2554
2555 /**
2556 * C_DigestEncryptUpdate continues a multiple-part digesting and encryption operation.
2557 * @param session session's handle
2558 * @param part_ptr the plaintext data
2559 * @param part_len plaintext length
2560 * @param encrypted_part_ptr gets ciphertext
2561 * @param encrypted_part_len_ptr gets c-text length
2562 * @param return_value default value (`ThrowException`): throw exception on error.
2563 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2564 * At least the following PKCS#11 return values may be returned:
2565 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2566 * \li DataLenRange \li DeviceError \li DeviceMemory
2567 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2568 * \li GeneralError \li HostMemory \li OK
2569 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2570 * @return true on success, false otherwise
2571 */
2572 bool C_DigestEncryptUpdate(SessionHandle session,
2573 Byte* part_ptr,
2574 Ulong part_len,
2575 Byte* encrypted_part_ptr,
2576 Ulong* encrypted_part_len_ptr,
2577 ReturnValue* return_value = ThrowException) const ;
2578
2579 /**
2580 * C_DecryptDigestUpdate continues a multiple-part decryption and digesting operation.
2581 * @param session session's handle
2582 * @param encrypted_part_ptr ciphertext
2583 * @param encrypted_part_len ciphertext length
2584 * @param part_ptr gets plaintext
2585 * @param part_len_ptr gets plaintext len
2586 * @param return_value default value (`ThrowException`): throw exception on error.
2587 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2588 * At least the following PKCS#11 return values may be returned:
2589 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2590 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2591 * \li EncryptedDataInvalid \li EncryptedDataLenRange \li FunctionCanceled
2592 * \li FunctionFailed \li GeneralError \li HostMemory
2593 * \li OK \li OperationNotInitialized \li SessionClosed
2594 * \li SessionHandleInvalid
2595 * @return true on success, false otherwise
2596 */
2597 bool C_DecryptDigestUpdate(SessionHandle session,
2598 Byte* encrypted_part_ptr,
2599 Ulong encrypted_part_len,
2600 Byte* part_ptr,
2601 Ulong* part_len_ptr,
2602 ReturnValue* return_value = ThrowException) const;
2603
2604 /**
2605 * C_SignEncryptUpdate continues a multiple-part signing and encryption operation.
2606 * @param session session's handle
2607 * @param part_ptr the plaintext data
2608 * @param part_len plaintext length
2609 * @param encrypted_part_ptr gets ciphertext
2610 * @param encrypted_part_len_ptr gets c-text length
2611 * @param return_value default value (`ThrowException`): throw exception on error.
2612 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2613 * At least the following PKCS#11 return values may be returned:
2614 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2615 * \li DataLenRange \li DeviceError \li DeviceMemory
2616 * \li DeviceRemoved \li FunctionCanceled \li FunctionFailed
2617 * \li GeneralError \li HostMemory \li OK
2618 * \li OperationNotInitialized \li SessionClosed \li SessionHandleInvalid
2619 * \li UserNotLoggedIn
2620 * @return true on success, false otherwise
2621 */
2622 bool C_SignEncryptUpdate(SessionHandle session,
2623 Byte* part_ptr,
2624 Ulong part_len,
2625 Byte* encrypted_part_ptr,
2626 Ulong* encrypted_part_len_ptr,
2627 ReturnValue* return_value = ThrowException) const;
2628
2629 /**
2630 * C_DecryptVerifyUpdate continues a multiple-part decryption and verify operation.
2631 * @param session session's handle
2632 * @param encrypted_part_ptr ciphertext
2633 * @param encrypted_part_len ciphertext length
2634 * @param part_ptr gets plaintext
2635 * @param part_len_ptr gets p-text length
2636 * @param return_value default value (`ThrowException`): throw exception on error.
2637 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2638 * At least the following PKCS#11 return values may be returned:
2639 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2640 * \li DataLenRange \li DeviceError \li DeviceMemory
2641 * \li DeviceRemoved \li EncryptedDataInvalid \li EncryptedDataLenRange
2642 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2643 * \li HostMemory \li OK \li OperationNotInitialized
2644 * \li SessionClosed \li SessionHandleInvalid
2645 * @return true on success, false otherwise
2646 */
2647 bool C_DecryptVerifyUpdate(SessionHandle session,
2648 Byte* encrypted_part_ptr,
2649 Ulong encrypted_part_len,
2650 Byte* part_ptr,
2651 Ulong* part_len_ptr,
2652 ReturnValue* return_value = ThrowException) const;
2653
2654 /****************************** Key management functions ******************************/
2655
2656 /**
2657 * C_GenerateKey generates a secret key, creating a new key object.
2658 * @param session the session's handle
2659 * @param mechanism_ptr key generation mech.
2660 * @param attribute_template_ptr template for new key
2661 * @param count # of attrs in template
2662 * @param key_ptr gets handle of new key
2663 * @param return_value default value (`ThrowException`): throw exception on error.
2664 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2665 * At least the following PKCS#11 return values may be returned:
2666 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2667 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
2668 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2669 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2670 * \li HostMemory \li MechanismInvalid \li MechanismParamInvalid
2671 * \li OK \li OperationActive \li PinExpired
2672 * \li SessionClosed \li SessionHandleInvalid \li SessionReadOnly
2673 * \li TemplateIncomplete \li TemplateInconsistent \li TokenWriteProtected
2674 * \li UserNotLoggedIn
2675 * @return true on success, false otherwise
2676 */
2677 bool C_GenerateKey(SessionHandle session,
2678 Mechanism* mechanism_ptr,
2679 Attribute* attribute_template_ptr,
2680 Ulong count,
2681 ObjectHandle* key_ptr,
2682 ReturnValue* return_value = ThrowException) const;
2683
2684 /**
2685 * C_GenerateKeyPair generates a public-key/private-key pair, creating new key objects.
2686 * @param session session handle
2687 * @param mechanism_ptr key-gen mech.
2688 * @param public_key_template_ptr template for pub. key
2689 * @param public_key_attribute_count # pub. attrs.
2690 * @param private_key_template_ptr template for priv. key
2691 * @param private_key_attribute_count # priv. attrs.
2692 * @param public_key_ptr gets pub. key handle
2693 * @param private_key_ptr gets priv. key handle
2694 * @param return_value default value (`ThrowException`): throw exception on error.
2695 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2696 * At least the following PKCS#11 return values may be returned:
2697 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2698 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
2699 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2700 * \li DomainParamsInvalid \li FunctionCanceled \li FunctionFailed
2701 * \li GeneralError \li HostMemory \li MechanismInvalid
2702 * \li MechanismParamInvalid \li OK \li OperationActive
2703 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
2704 * \li SessionReadOnly \li TemplateIncomplete \li TemplateInconsistent
2705 * \li TokenWriteProtected \li UserNotLoggedIn
2706 * @return true on success, false otherwise
2707 */
2708 bool C_GenerateKeyPair(SessionHandle session,
2709 Mechanism* mechanism_ptr,
2710 Attribute* public_key_template_ptr,
2711 Ulong public_key_attribute_count,
2712 Attribute* private_key_template_ptr,
2713 Ulong private_key_attribute_count,
2714 ObjectHandle* public_key_ptr,
2715 ObjectHandle* private_key_ptr,
2716 ReturnValue* return_value = ThrowException) const;
2717
2718 /**
2719 * C_WrapKey wraps (i.e., encrypts) a key.
2720 * @param session the session's handle
2721 * @param mechanism_ptr the wrapping mechanism
2722 * @param wrapping_key wrapping key
2723 * @param key key to be wrapped
2724 * @param wrapped_key_ptr gets wrapped key
2725 * @param wrapped_key_len_ptr gets wrapped key size
2726 * @param return_value default value (`ThrowException`): throw exception on error.
2727 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2728 * At least the following PKCS#11 return values may be returned:
2729 * \li ArgumentsBad \li BufferTooSmall \li CryptokiNotInitialized
2730 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2731 * \li FunctionCanceled \li FunctionFailed \li GeneralError
2732 * \li HostMemory \li KeyHandleInvalid \li KeyNotWrappable
2733 * \li KeySizeRange \li KeyUnextractable \li MechanismInvalid
2734 * \li MechanismParamInvalid \li OK \li OperationActive
2735 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
2736 * \li UserNotLoggedIn \li WrappingKeyHandleInvalid \li WrappingKeySizeRange
2737 * \li WrappingKeyTypeInconsistent
2738 * @return true on success, false otherwise
2739 */
2740 bool C_WrapKey(SessionHandle session,
2741 Mechanism* mechanism_ptr,
2742 ObjectHandle wrapping_key,
2743 ObjectHandle key,
2744 Byte* wrapped_key_ptr,
2745 Ulong* wrapped_key_len_ptr,
2746 ReturnValue* return_value = ThrowException) const;
2747
2748 /**
2749 * C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new key object.
2750 * @param session session's handle
2751 * @param mechanism_ptr unwrapping mech.
2752 * @param unwrapping_key unwrapping key
2753 * @param wrapped_key_ptr the wrapped key
2754 * @param wrapped_key_len wrapped key len
2755 * @param attribute_template_ptr new key template
2756 * @param attribute_count template length
2757 * @param key_ptr gets new handle
2758 * @param return_value default value (`ThrowException`): throw exception on error.
2759 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2760 * At least the following PKCS#11 return values may be returned:
2761 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2762 * \li AttributeValueInvalid \li BufferTooSmall \li CryptokiNotInitialized
2763 * \li CurveNotSupported \li DeviceError \li DeviceMemory
2764 * \li DeviceRemoved \li DomainParamsInvalid \li FunctionCanceled
2765 * \li FunctionFailed \li GeneralError \li HostMemory
2766 * \li MechanismInvalid \li MechanismParamInvalid \li OK
2767 * \li OperationActive \li PinExpired \li SessionClosed
2768 * \li SessionHandleInvalid \li SessionReadOnly \li TemplateIncomplete
2769 * \li TemplateInconsistent \li TokenWriteProtected \li UnwrappingKeyHandleInvalid
2770 * \li UnwrappingKeySizeRange \li UnwrappingKeyTypeInconsistent \li UserNotLoggedIn
2771 * \li WrappedKeyInvalid \li WrappedKeyLenRange
2772 * @return true on success, false otherwise
2773 */
2774 bool C_UnwrapKey(SessionHandle session,
2775 Mechanism* mechanism_ptr,
2776 ObjectHandle unwrapping_key,
2777 Byte* wrapped_key_ptr,
2778 Ulong wrapped_key_len,
2779 Attribute* attribute_template_ptr,
2780 Ulong attribute_count,
2781 ObjectHandle* key_ptr,
2782 ReturnValue* return_value = ThrowException) const;
2783
2784 /**
2785 * C_DeriveKey derives a key from a base key, creating a new key object.
2786 * @param session session's handle
2787 * @param mechanism_ptr key deriv. mech.
2788 * @param base_key base key
2789 * @param attribute_template_ptr new key template
2790 * @param attribute_count template length
2791 * @param key_ptr gets new handle
2792 * @param return_value default value (`ThrowException`): throw exception on error.
2793 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2794 * At least the following PKCS#11 return values may be returned:
2795 * \li ArgumentsBad \li AttributeReadOnly \li AttributeTypeInvalid
2796 * \li AttributeValueInvalid \li CryptokiNotInitialized \li CurveNotSupported
2797 * \li DeviceError \li DeviceMemory \li DeviceRemoved
2798 * \li DomainParamsInvalid \li FunctionCanceled \li FunctionFailed
2799 * \li GeneralError \li HostMemory \li KeyHandleInvalid
2800 * \li KeySizeRange \li KeyTypeInconsistent \li MechanismInvalid
2801 * \li MechanismParamInvalid \li OK \li OperationActive
2802 * \li PinExpired \li SessionClosed \li SessionHandleInvalid
2803 * \li SessionReadOnly \li TemplateIncomplete \li TemplateInconsistent
2804 * \li TokenWriteProtected \li UserNotLoggedIn
2805 * @return true on success, false otherwise
2806 */
2807 bool C_DeriveKey(SessionHandle session,
2808 Mechanism* mechanism_ptr,
2809 ObjectHandle base_key,
2810 Attribute* attribute_template_ptr,
2811 Ulong attribute_count,
2812 ObjectHandle* key_ptr,
2813 ReturnValue* return_value = ThrowException) const;
2814
2815 /****************************** Random number generation functions ******************************/
2816
2817 /**
2818 * C_SeedRandom mixes additional seed material into the token's random number generator.
2819 * @param session the session's handle
2820 * @param seed_ptr the seed material
2821 * @param seed_len length of seed material
2822 * @param return_value default value (`ThrowException`): throw exception on error.
2823 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2824 * At least the following PKCS#11 return values may be returned:
2825 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2826 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2827 * \li FunctionFailed \li GeneralError \li HostMemory
2828 * \li OK \li OperationActive \li RandomSeedNotSupported
2829 * \li RandomNoRng \li SessionClosed \li SessionHandleInvalid
2830 * \li UserNotLoggedIn
2831 * @return true on success, false otherwise
2832 */
2833 bool C_SeedRandom(SessionHandle session,
2834 Byte* seed_ptr,
2835 Ulong seed_len,
2836 ReturnValue* return_value = ThrowException) const;
2837
2838 /**
2839 * C_GenerateRandom generates random data.
2840 * @param session the session's handle
2841 * @param random_data_ptr receives the random data
2842 * @param random_len # of bytes to generate
2843 * @param return_value default value (`ThrowException`): throw exception on error.
2844 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2845 * At least the following PKCS#11 return values may be returned:
2846 * \li ArgumentsBad \li CryptokiNotInitialized \li DeviceError
2847 * \li DeviceMemory \li DeviceRemoved \li FunctionCanceled
2848 * \li FunctionFailed \li GeneralError \li HostMemory
2849 * \li OK \li OperationActive \li RandomNoRng
2850 * \li SessionClosed \li SessionHandleInvalid \li UserNotLoggedIn
2851 * @return true on success, false otherwise
2852 */
2853 bool C_GenerateRandom(SessionHandle session,
2854 Byte* random_data_ptr,
2855 Ulong random_len,
2856 ReturnValue* return_value = ThrowException) const;
2857
2858 /****************************** Parallel function management functions ******************************/
2859
2860 /**
2861 * C_GetFunctionStatus is a legacy function; it obtains an updated status of a function running in parallel with an application.
2862 * @param session the session's handle
2863 * @param return_value default value (`ThrowException`): throw exception on error.
2864 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2865 * At least the following PKCS#11 return values may be returned:
2866 * \li CryptokiNotInitialized \li FunctionFailed \li FunctionNotParallel
2867 * \li GeneralError \li HostMemory \li SessionHandleInvalid
2868 * \li SessionClosed
2869 * @return true on success, false otherwise
2870 */
2871 bool C_GetFunctionStatus(SessionHandle session,
2872 ReturnValue* return_value = ThrowException) const;
2873
2874 /**
2875 * C_CancelFunction is a legacy function; it cancels a function running in parallel.
2876 * @param session the session's handle
2877 * @param return_value default value (`ThrowException`): throw exception on error.
2878 * if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown.
2879 * At least the following PKCS#11 return values may be returned:
2880 * \li CryptokiNotInitialized \li FunctionFailed \li FunctionNotParallel
2881 * \li GeneralError \li HostMemory \li SessionHandleInvalid
2882 * \li SessionClosed
2883 * @return true on success, false otherwise
2884 */
2885 bool C_CancelFunction(SessionHandle session,
2886 ReturnValue* return_value = ThrowException) const;
2887
2888 private:
2889 const FunctionListPtr m_func_list_ptr;
2890 };
2891
2892class BOTAN_PUBLIC_API(2,0) PKCS11_Error : public Exception
2893 {
2894 public:
2895 explicit PKCS11_Error(const std::string& what) :
2896 Exception("PKCS11 error", what)
2897 {
2898 }
2899
2900 ErrorType error_type() const noexcept override { return ErrorType::Pkcs11Error; }
2901 };
2902
2903class BOTAN_PUBLIC_API(2,0) PKCS11_ReturnError final : public PKCS11_Error
2904 {
2905 public:
2906 explicit PKCS11_ReturnError(ReturnValue return_val) :
2907 PKCS11_Error(std::to_string(static_cast< uint32_t >(return_val))),
2908 m_return_val(return_val)
2909 {}
2910
2911 inline ReturnValue get_return_value() const
2912 {
2913 return m_return_val;
2914 }
2915
2916 int error_code() const noexcept override
2917 {
2918 return static_cast<int>(m_return_val);
2919 }
2920
2921 private:
2922 const ReturnValue m_return_val;
2923 };
2924
2925}
2926
2927}
2928
2929#endif
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
std::string to_string(const BER_Object &obj)
Definition asn1_obj.cpp:213
CK_BBOOL Bbool
Definition p11.h:836
CK_RSA_PKCS_OAEP_PARAMS RsaPkcsOaepParams
Definition p11.h:850
CK_ATTRIBUTE Attribute
Definition p11.h:847
CK_FLAGS Flags
Definition p11.h:834
PublicPointEncoding
Definition p11.h:822
CK_RSA_PKCS_PSS_PARAMS RsaPkcsPssParams
Definition p11.h:851
CK_SESSION_INFO SessionInfo
Definition p11.h:846
AttributeType
Definition p11.h:66
CK_NOTIFY Notify
Definition p11.h:844
CertificateType
Definition p11.h:178
CK_FUNCTION_LIST_PTR FunctionListPtr
Definition p11.h:827
CK_INFO Info
Definition p11.h:835
CK_ECDH1_DERIVE_PARAMS Ecdh1DeriveParams
Definition p11.h:852
CK_ULONG Ulong
Definition p11.h:838
CK_C_INITIALIZE_ARGS C_InitializeArgs
Definition p11.h:829
CK_MECHANISM Mechanism
Definition p11.h:841
secure_vector< uint8_t > secure_string
Definition p11.h:63
CK_UNLOCKMUTEX UnlockMutex
Definition p11.h:833
CK_DESTROYMUTEX DestroyMutex
Definition p11.h:831
CK_VOID_PTR VoidPtr
Definition p11.h:828
CK_LOCKMUTEX LockMutex
Definition p11.h:832
CK_SESSION_HANDLE SessionHandle
Definition p11.h:845
CK_SLOT_INFO SlotInfo
Definition p11.h:839
CK_OBJECT_HANDLE ObjectHandle
Definition p11.h:848
CK_MECHANISM_INFO MechanismInfo
Definition p11.h:842
CK_DATE Date
Definition p11.h:853
CertificateCategory
Definition p11.h:188
CK_CREATEMUTEX CreateMutex
Definition p11.h:830
CK_TOKEN_INFO TokenInfo
Definition p11.h:840
CK_BYTE Byte
Definition p11.h:849
CK_SLOT_ID SlotId
Definition p11.h:837
Flags flags(Flag flags)
Definition p11.h:860
CK_UTF8CHAR Utf8Char
Definition p11.h:843
ErrorType
Definition exceptn.h:20
Definition bigint.h:1143
MechanismType type
#define CKD_NULL
Definition pkcs11t.h:1290
#define CKA_NEVER_EXTRACTABLE
Definition pkcs11t.h:496
#define CKM_SEED_KEY_GEN
Definition pkcs11t.h:856
#define CKM_TLS_MASTER_KEY_DERIVE
Definition pkcs11t.h:775
#define CKD_SHA1_KDF
Definition pkcs11t.h:1291
#define CKD_SHA256_KDF
Definition pkcs11t.h:1297
#define CKR_NEXT_OTP
Definition pkcs11t.h:1148
#define CKK_DES3
Definition pkcs11t.h:351
#define CKM_DSA_PARAMETER_GEN
Definition pkcs11t.h:957
#define CKR_SESSION_COUNT
Definition pkcs11t.h:1097
#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE
Definition pkcs11t.h:816
#define CKM_CONCATENATE_BASE_AND_DATA
Definition pkcs11t.h:765
#define CKM_PKCS5_PBKD2
Definition pkcs11t.h:807
#define CKM_AES_GMAC
Definition pkcs11t.h:928
#define CKM_KIP_DERIVE
Definition pkcs11t.h:833
#define CKR_DEVICE_MEMORY
Definition pkcs11t.h:1061
#define CKA_JAVA_MIDP_SECURITY_DOMAIN
Definition pkcs11t.h:452
#define CKM_SSL3_SHA1_MAC
Definition pkcs11t.h:782
#define CKA_OTP_TIME_INTERVAL
Definition pkcs11t.h:522
#define CKK_RC4
Definition pkcs11t.h:348
#define CKA_TOKEN
Definition pkcs11t.h:438
#define CKA_SECONDARY_AUTH
Definition pkcs11t.h:510
#define CKR_GENERAL_ERROR
Definition pkcs11t.h:1043
#define CKR_MECHANISM_INVALID
Definition pkcs11t.h:1083
#define CKR_SLOT_ID_INVALID
Definition pkcs11t.h:1041
#define CKC_VENDOR_DEFINED
Definition pkcs11t.h:410
#define CKG_MGF1_SHA256
Definition pkcs11t.h:1247
#define CKM_SSL3_MASTER_KEY_DERIVE
Definition pkcs11t.h:770
#define CKM_RSA_PKCS
Definition pkcs11t.h:587
#define CKM_ECDSA_SHA1
Definition pkcs11t.h:892
#define CKR_KEY_CHANGED
Definition pkcs11t.h:1076
#define CKK_SHA224_HMAC
Definition pkcs11t.h:378
#define CKM_IDEA_ECB
Definition pkcs11t.h:758
#define CKD_SHA512_KDF
Definition pkcs11t.h:1299
#define CKA_START_DATE
Definition pkcs11t.h:472
#define CKK_DH
Definition pkcs11t.h:341
#define CKK_RC5
Definition pkcs11t.h:356
#define CKR_ATTRIBUTE_TYPE_INVALID
Definition pkcs11t.h:1053
#define CKA_OTP_SERVICE_IDENTIFIER
Definition pkcs11t.h:531
CK_BYTE CK_UTF8CHAR
Definition pkcs11t.h:42
#define CKM_GOSTR3411_HMAC
Definition pkcs11t.h:950
#define CKM_WTLS_PRE_MASTER_KEY_GEN
Definition pkcs11t.h:811
#define CKA_AUTH_PIN_FLAGS
Definition pkcs11t.h:511
#define CKM_DES3_CMAC
Definition pkcs11t.h:672
#define CKM_RC2_MAC
Definition pkcs11t.h:648
#define CKM_SHA256_KEY_DERIVATION
Definition pkcs11t.h:787
#define CKA_SERIAL_NUMBER
Definition pkcs11t.h:446
#define CKK_DES2
Definition pkcs11t.h:350
#define CKM_CAST5_MAC_GENERAL
Definition pkcs11t.h:747
#define CKF_LOGIN_REQUIRED
Definition pkcs11t.h:157
#define CKF_HW_SLOT
Definition pkcs11t.h:124
#define CKO_PUBLIC_KEY
Definition pkcs11t.h:312
#define CKF_EC_UNCOMPRESS
Definition pkcs11t.h:1026
#define CKA_SUB_PRIME_BITS
Definition pkcs11t.h:490
#define CKM_RSA_X_509
Definition pkcs11t.h:589
#define CKF_LIBRARY_CANT_CREATE_OS_THREADS
Definition pkcs11t.h:1225
#define CKM_SEED_MAC_GENERAL
Definition pkcs11t.h:860
#define CKF_PROTECTED_AUTHENTICATION_PATH
Definition pkcs11t.h:177
#define CKA_ISSUER
Definition pkcs11t.h:445
#define CKM_ARIA_KEY_GEN
Definition pkcs11t.h:847
#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY
Definition pkcs11t.h:454
#define CKR_FUNCTION_CANCELED
Definition pkcs11t.h:1065
#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN
Definition pkcs11t.h:960
#define CKM_AES_CTR
Definition pkcs11t.h:919
#define CKM_TLS12_MAC
Definition pkcs11t.h:820
#define CKM_DES3_CBC
Definition pkcs11t.h:666
#define CKM_TWOFISH_CBC_PAD
Definition pkcs11t.h:935
#define CKM_AES_CMAC
Definition pkcs11t.h:923
#define CKM_SKIPJACK_CFB8
Definition pkcs11t.h:872
#define CKM_RSA_X9_31_KEY_PAIR_GEN
Definition pkcs11t.h:599
#define CKR_KEY_UNEXTRACTABLE
Definition pkcs11t.h:1081
#define CKR_DATA_INVALID
Definition pkcs11t.h:1058
#define CKR_UNWRAPPING_KEY_HANDLE_INVALID
Definition pkcs11t.h:1113
#define CKM_CONCATENATE_BASE_AND_KEY
Definition pkcs11t.h:764
#define CKR_NEED_TO_CREATE_THREADS
Definition pkcs11t.h:1048
#define CKK_SHA256_HMAC
Definition pkcs11t.h:375
#define CKM_SHA512_256
Definition pkcs11t.h:635
#define CKM_SEED_ECB_ENCRYPT_DATA
Definition pkcs11t.h:862
#define CKR_WRAPPING_KEY_SIZE_RANGE
Definition pkcs11t.h:1127
#define CKM_FORTEZZA_TIMESTAMP
Definition pkcs11t.h:879
#define CKS_RW_PUBLIC_SESSION
Definition pkcs11t.h:274
#define CKR_MECHANISM_PARAM_INVALID
Definition pkcs11t.h:1084
#define CKA_SUPPORTED_CMS_ATTRIBUTES
Definition pkcs11t.h:556
#define CKF_TOKEN_INITIALIZED
Definition pkcs11t.h:193
#define CKR_TOKEN_NOT_RECOGNIZED
Definition pkcs11t.h:1111
#define CKM_MD5
Definition pkcs11t.h:690
#define CKM_SHA512_HMAC_GENERAL
Definition pkcs11t.h:718
#define CKM_CAST3_ECB
Definition pkcs11t.h:733
#define CKM_SKIPJACK_CFB64
Definition pkcs11t.h:869
#define CKM_DES_CBC_ENCRYPT_DATA
Definition pkcs11t.h:938
#define CK_FALSE
Definition pkcs11t.h:24
#define CKC_WTLS
Definition pkcs11t.h:409
#define CKM_SHA_1_HMAC
Definition pkcs11t.h:697
#define CKD_SHA1_KDF_ASN1
Definition pkcs11t.h:1294
#define CKR_ATTRIBUTE_SENSITIVE
Definition pkcs11t.h:1052
#define CKG_MGF1_SHA512
Definition pkcs11t.h:1249
#define CKM_CAMELLIA_MAC
Definition pkcs11t.h:840
#define CKM_IDEA_KEY_GEN
Definition pkcs11t.h:757
#define CKM_ECDH1_COFACTOR_DERIVE
Definition pkcs11t.h:899
#define CKR_RANDOM_NO_RNG
Definition pkcs11t.h:1131
#define CKM_ARIA_CBC_ENCRYPT_DATA
Definition pkcs11t.h:854
#define CKM_CAMELLIA_KEY_GEN
Definition pkcs11t.h:837
#define CKR_PIN_LEN_RANGE
Definition pkcs11t.h:1091
#define CKC_X_509
Definition pkcs11t.h:407
#define CKF_DIGEST
Definition pkcs11t.h:1008
#define CKF_USER_PIN_FINAL_TRY
Definition pkcs11t.h:210
#define CKM_ECDSA_SHA224
Definition pkcs11t.h:893
#define CKF_DERIVE
Definition pkcs11t.h:1017
#define CKM_BATON_KEY_GEN
Definition pkcs11t.h:880
#define CKR_DEVICE_ERROR
Definition pkcs11t.h:1060
#define CKA_PRIVATE_EXPONENT
Definition pkcs11t.h:477
#define CKR_RANDOM_SEED_NOT_SUPPORTED
Definition pkcs11t.h:1129
#define CKA_RESOLUTION
Definition pkcs11t.h:545
#define CKR_SESSION_PARALLEL_NOT_SUPPORTED
Definition pkcs11t.h:1099
#define CKM_MD2
Definition pkcs11t.h:685
#define CKM_BATON_CBC128
Definition pkcs11t.h:883
#define CKM_DSA
Definition pkcs11t.h:606
#define CKA_ID
Definition pkcs11t.h:461
#define CKA_OBJECT_ID
Definition pkcs11t.h:443
#define CKM_AES_CFB8
Definition pkcs11t.h:965
#define CKM_CMS_SIG
Definition pkcs11t.h:832
#define CKA_APPLICATION
Definition pkcs11t.h:441
#define CKM_RIPEMD128
Definition pkcs11t.h:700
#define CKF_VERIFY
Definition pkcs11t.h:1011
#define CKM_AES_CBC_PAD
Definition pkcs11t.h:918
#define CKG_MGF1_SHA224
Definition pkcs11t.h:1250
#define CKM_CAST3_CBC
Definition pkcs11t.h:734
#define CKM_ECDH1_DERIVE
Definition pkcs11t.h:898
#define CKM_VENDOR_DEFINED
Definition pkcs11t.h:975
#define CKR_ATTRIBUTE_READ_ONLY
Definition pkcs11t.h:1051
#define CKR_KEY_FUNCTION_NOT_PERMITTED
Definition pkcs11t.h:1079
#define CKA_HW_FEATURE_TYPE
Definition pkcs11t.h:539
#define CKM_TWOFISH_KEY_GEN
Definition pkcs11t.h:932
#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT
Definition pkcs11t.h:1128
#define CKN_SURRENDER
Definition pkcs11t.h:101
#define CKK_CAST128
Definition pkcs11t.h:355
#define CKA_VERIFY_RECOVER
Definition pkcs11t.h:470
#define CKK_CAST5
Definition pkcs11t.h:354
#define CKM_SHA512_224_HMAC_GENERAL
Definition pkcs11t.h:633
#define CKM_SKIPJACK_RELAYX
Definition pkcs11t.h:875
CK_ULONG CK_RV
Definition pkcs11t.h:1036
#define CKM_SHA512_224_HMAC
Definition pkcs11t.h:632
#define CKR_SESSION_EXISTS
Definition pkcs11t.h:1101
#define CKM_MD5_HMAC_GENERAL
Definition pkcs11t.h:693
#define CKM_MD2_RSA_PKCS
Definition pkcs11t.h:591
#define CKR_FUNCTION_REJECTED
Definition pkcs11t.h:1156
#define CKM_SHA_1_HMAC_GENERAL
Definition pkcs11t.h:698
#define CKM_TLS10_MAC_CLIENT
Definition pkcs11t.h:819
unsigned long int CK_ULONG
Definition pkcs11t.h:48
#define CKO_SECRET_KEY
Definition pkcs11t.h:314
#define CKK_RSA
Definition pkcs11t.h:339
#define CKM_JUNIPER_ECB128
Definition pkcs11t.h:906
#define CKA_PUBLIC_EXPONENT
Definition pkcs11t.h:476
#define CKM_SKIPJACK_CBC64
Definition pkcs11t.h:867
#define CKM_DES_ECB
Definition pkcs11t.h:656
#define CKM_CAST_CBC
Definition pkcs11t.h:728
#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE
Definition pkcs11t.h:815
#define CKM_PBE_SHA1_DES2_EDE_CBC
Definition pkcs11t.h:803
#define CKM_X9_42_DH_KEY_PAIR_GEN
Definition pkcs11t.h:616
#define CKK_CAMELLIA
Definition pkcs11t.h:368
#define CKA_MODIFIABLE
Definition pkcs11t.h:500
#define CKK_SEED
Definition pkcs11t.h:380
#define CKM_RC5_MAC
Definition pkcs11t.h:754
#define CKM_RSA_PKCS_KEY_PAIR_GEN
Definition pkcs11t.h:586
#define CKR_SESSION_READ_ONLY
Definition pkcs11t.h:1100
#define CKK_KEA
Definition pkcs11t.h:345
#define CKM_RC2_CBC
Definition pkcs11t.h:647
#define CKA_OTP_TIME_REQUIREMENT
Definition pkcs11t.h:525
#define CKM_PBE_MD5_CAST5_CBC
Definition pkcs11t.h:796
#define CKM_KEA_KEY_DERIVE
Definition pkcs11t.h:877
#define CKC_X_509_ATTR_CERT
Definition pkcs11t.h:408
#define CKM_JUNIPER_KEY_GEN
Definition pkcs11t.h:905
#define CKM_RC5_CBC
Definition pkcs11t.h:753
#define CKM_ARIA_CBC_PAD
Definition pkcs11t.h:852
#define CKR_ENCRYPTED_DATA_LEN_RANGE
Definition pkcs11t.h:1064
#define CKM_SHA512_KEY_DERIVATION
Definition pkcs11t.h:789
#define CKA_BITS_PER_PIXEL
Definition pkcs11t.h:549
#define CKR_SIGNATURE_INVALID
Definition pkcs11t.h:1106
#define CKA_AC_ISSUER
Definition pkcs11t.h:447
#define CKM_TLS_KDF
Definition pkcs11t.h:827
#define CKM_AES_MAC_GENERAL
Definition pkcs11t.h:917
#define CKM_CAST128_CBC_PAD
Definition pkcs11t.h:750
#define CKM_BATON_ECB128
Definition pkcs11t.h:881
#define CKA_OTP_USER_IDENTIFIER
Definition pkcs11t.h:530
#define CKM_BLOWFISH_CBC
Definition pkcs11t.h:931
#define CKM_FASTHASH
Definition pkcs11t.h:911
#define CKR_SESSION_HANDLE_INVALID
Definition pkcs11t.h:1098
#define CKF_EC_F_2M
Definition pkcs11t.h:1023
#define CKM_ARIA_ECB
Definition pkcs11t.h:848
#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY
Definition pkcs11t.h:398
#define CKO_CERTIFICATE
Definition pkcs11t.h:311
#define CKA_CHECK_VALUE
Definition pkcs11t.h:457
#define CKM_DES_CBC
Definition pkcs11t.h:657
#define CKF_USER_PIN_INITIALIZED
Definition pkcs11t.h:158
CK_ULONG CK_NOTIFICATION
Definition pkcs11t.h:100
#define CKM_CAST5_MAC
Definition pkcs11t.h:745
#define CKA_PUBLIC_KEY_INFO
Definition pkcs11t.h:483
#define CKA_OTP_USER_FRIENDLY_MODE
Definition pkcs11t.h:523
#define CKM_SHA384_HMAC_GENERAL
Definition pkcs11t.h:715
#define CKF_RW_SESSION
Definition pkcs11t.h:289
#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN
Definition pkcs11t.h:1121
#define CKM_SECURID_KEY_GEN
Definition pkcs11t.h:719
#define CKM_IDEA_MAC_GENERAL
Definition pkcs11t.h:761
#define CKS_RO_USER_FUNCTIONS
Definition pkcs11t.h:273
#define CKM_TLS_KEY_AND_MAC_DERIVE
Definition pkcs11t.h:776
#define CKM_GOST28147_ECB
Definition pkcs11t.h:952
#define CKA_PRIME
Definition pkcs11t.h:484
#define CKR_ARGUMENTS_BAD
Definition pkcs11t.h:1046
#define CKM_SECURID
Definition pkcs11t.h:720
#define CKM_AES_CCM
Definition pkcs11t.h:921
#define CKR_CANCEL
Definition pkcs11t.h:1039
#define CKM_SHA512_224_KEY_DERIVATION
Definition pkcs11t.h:634
#define CKM_SHA256
Definition pkcs11t.h:707
#define CKM_IDEA_CBC_PAD
Definition pkcs11t.h:762
#define CKM_SHA512_T_HMAC_GENERAL
Definition pkcs11t.h:642
#define CKK_BLOWFISH
Definition pkcs11t.h:363
#define CKM_CDMF_CBC_PAD
Definition pkcs11t.h:678
#define CKU_USER
Definition pkcs11t.h:266
#define CKR_PIN_TOO_WEAK
Definition pkcs11t.h:1153
#define CKA_MODULUS
Definition pkcs11t.h:474
unsigned char CK_BYTE
Definition pkcs11t.h:36
#define CKM_AES_CFB64
Definition pkcs11t.h:964
#define CKM_TLS_MASTER_KEY_DERIVE_DH
Definition pkcs11t.h:777
#define CKA_PRIVATE
Definition pkcs11t.h:439
#define CKM_DES_KEY_GEN
Definition pkcs11t.h:655
CK_ULONG CK_SLOT_ID
Definition pkcs11t.h:104
CK_ULONG CK_FLAGS
Definition pkcs11t.h:54
#define CKR_PIN_EXPIRED
Definition pkcs11t.h:1093
#define CKM_CAST3_MAC_GENERAL
Definition pkcs11t.h:736
CK_ULONG CK_OBJECT_CLASS
Definition pkcs11t.h:307
#define CKM_CAST5_CBC_PAD
Definition pkcs11t.h:749
#define CKM_PBE_SHA1_RC2_128_CBC
Definition pkcs11t.h:804
#define CKG_MGF1_SHA384
Definition pkcs11t.h:1248
#define CKR_PIN_LOCKED
Definition pkcs11t.h:1094
#define CKA_PRIME_1
Definition pkcs11t.h:478
#define CKA_NAME_HASH_ALGORITHM
Definition pkcs11t.h:456
#define CKM_DSA_SHA512
Definition pkcs11t.h:611
#define CKM_SSL3_PRE_MASTER_KEY_GEN
Definition pkcs11t.h:769
#define CKM_SSL3_MASTER_KEY_DERIVE_DH
Definition pkcs11t.h:773
#define CKM_IDEA_MAC
Definition pkcs11t.h:760
#define CKR_LIBRARY_LOAD_FAILED
Definition pkcs11t.h:1152
#define CKM_MD5_RSA_PKCS
Definition pkcs11t.h:592
#define CKM_DSA_SHA384
Definition pkcs11t.h:610
#define CKM_RIPEMD128_HMAC_GENERAL
Definition pkcs11t.h:702
#define CKF_WRAP
Definition pkcs11t.h:1015
#define CKK_DES
Definition pkcs11t.h:349
#define CKM_PBA_SHA1_WITH_SHA1_HMAC
Definition pkcs11t.h:809
#define CKA_OTP_SERVICE_LOGO_TYPE
Definition pkcs11t.h:533
CK_ULONG CK_SESSION_HANDLE
Definition pkcs11t.h:256
#define CKA_OTP_CHALLENGE_REQUIREMENT
Definition pkcs11t.h:524
#define CKK_ACTI
Definition pkcs11t.h:367
#define CKR_CANT_LOCK
Definition pkcs11t.h:1049
#define CKM_DES_CBC_PAD
Definition pkcs11t.h:661
#define CKR_TOKEN_NOT_PRESENT
Definition pkcs11t.h:1110
#define CKA_OTP_FORMAT
Definition pkcs11t.h:520
#define CKF_EXTENSION
Definition pkcs11t.h:1029
#define CKM_SHA512_T
Definition pkcs11t.h:640
#define CKM_DES3_CBC_PAD
Definition pkcs11t.h:670
#define CKM_SHA512_T_KEY_DERIVATION
Definition pkcs11t.h:643
#define CKA_EC_POINT
Definition pkcs11t.h:508
#define CKR_CRYPTOKI_NOT_INITIALIZED
Definition pkcs11t.h:1142
#define CKM_KEA_DERIVE
Definition pkcs11t.h:878
#define CKM_DH_PKCS_DERIVE
Definition pkcs11t.h:614
#define CKM_CAMELLIA_MAC_GENERAL
Definition pkcs11t.h:841
#define CKA_SENSITIVE
Definition pkcs11t.h:462
#define CKM_MD2_HMAC_GENERAL
Definition pkcs11t.h:688
#define CKF_EC_F_P
Definition pkcs11t.h:1022
#define CKM_SEED_CBC_ENCRYPT_DATA
Definition pkcs11t.h:863
#define CKM_DES3_CMAC_GENERAL
Definition pkcs11t.h:671
#define CKR_PIN_INCORRECT
Definition pkcs11t.h:1089
#define CKM_CAST128_MAC_GENERAL
Definition pkcs11t.h:748
#define CKM_ARIA_CBC
Definition pkcs11t.h:849
#define CK_CERTIFICATE_CATEGORY_TOKEN_USER
Definition pkcs11t.h:396
#define CKM_CAMELLIA_CTR
Definition pkcs11t.h:845
#define CKM_PBE_SHA1_RC4_40
Definition pkcs11t.h:801
#define CKM_PBE_SHA1_CAST5_CBC
Definition pkcs11t.h:798
#define CKM_TLS10_MAC_SERVER
Definition pkcs11t.h:818
#define CKM_X9_42_DH_DERIVE
Definition pkcs11t.h:617
#define CKF_GENERATE_KEY_PAIR
Definition pkcs11t.h:1014
#define CKM_AES_KEY_WRAP
Definition pkcs11t.h:969
#define CKM_SKIPJACK_PRIVATE_WRAP
Definition pkcs11t.h:874
#define CKF_SIGN_RECOVER
Definition pkcs11t.h:1010
#define CKA_SIGN_RECOVER
Definition pkcs11t.h:468
#define CKM_KEY_WRAP_LYNKS
Definition pkcs11t.h:829
#define CKM_SHA512_RSA_PKCS_PSS
Definition pkcs11t.h:626
#define CKM_CAST5_KEY_GEN
Definition pkcs11t.h:739
#define CKF_REMOVABLE_DEVICE
Definition pkcs11t.h:123
#define CKP_PKCS5_PBKD2_HMAC_SHA512_256
Definition pkcs11t.h:1726
#define CKM_CAMELLIA_CBC
Definition pkcs11t.h:839
#define CKM_ECDSA_SHA512
Definition pkcs11t.h:896
#define CKM_RSA_PKCS_OAEP
Definition pkcs11t.h:597
#define CKM_DES_OFB64
Definition pkcs11t.h:680
#define CKR_WRAPPED_KEY_INVALID
Definition pkcs11t.h:1124
#define CKF_SECONDARY_AUTHENTICATION
Definition pkcs11t.h:199
#define CKO_OTP_KEY
Definition pkcs11t.h:318
#define CKM_PBE_SHA1_RC4_128
Definition pkcs11t.h:800
#define CKM_CDMF_MAC
Definition pkcs11t.h:676
#define CKM_RSA_PKCS_OAEP_TPM_1_1
Definition pkcs11t.h:973
#define CKM_SHA512_RSA_PKCS
Definition pkcs11t.h:623
#define CKA_EXPONENT_1
Definition pkcs11t.h:480
#define CKM_DES3_MAC_GENERAL
Definition pkcs11t.h:669
#define CKM_CAST_CBC_PAD
Definition pkcs11t.h:731
#define CKP_PKCS5_PBKD2_HMAC_SHA224
Definition pkcs11t.h:1721
#define CKM_SHA224_HMAC
Definition pkcs11t.h:711
#define CKM_CAST5_CBC
Definition pkcs11t.h:743
#define CKM_SSL3_MD5_MAC
Definition pkcs11t.h:781
#define CKM_EXTRACT_KEY_FROM_KEY
Definition pkcs11t.h:768
#define CKM_SKIPJACK_CFB32
Definition pkcs11t.h:870
#define CKM_ECMQV_DERIVE
Definition pkcs11t.h:900
#define CKA_SIGN
Definition pkcs11t.h:467
#define CKM_AES_KEY_GEN
Definition pkcs11t.h:913
#define CKF_USER_FRIENDLY_OTP
Definition pkcs11t.h:1814
#define CKR_WRAPPING_KEY_HANDLE_INVALID
Definition pkcs11t.h:1126
#define CKR_MUTEX_NOT_LOCKED
Definition pkcs11t.h:1145
#define CKR_USER_TOO_MANY_TYPES
Definition pkcs11t.h:1122
#define CKM_CAST_MAC_GENERAL
Definition pkcs11t.h:730
CK_ULONG CK_USER_TYPE
Definition pkcs11t.h:262
#define CKF_USER_PIN_COUNT_LOW
Definition pkcs11t.h:205
#define CKM_IDEA_CBC
Definition pkcs11t.h:759
#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC
Definition pkcs11t.h:813
#define CKR_SESSION_CLOSED
Definition pkcs11t.h:1096
#define CKA_EXPONENT_2
Definition pkcs11t.h:481
#define CKK_RIPEMD160_HMAC
Definition pkcs11t.h:374
#define CK_TRUE
Definition pkcs11t.h:23
#define CKM_DSA_KEY_PAIR_GEN
Definition pkcs11t.h:605
#define CKM_RC4_KEY_GEN
Definition pkcs11t.h:653
#define CKM_ACTI_KEY_GEN
Definition pkcs11t.h:724
#define CKM_SHA224
Definition pkcs11t.h:710
#define CKM_SHA1_RSA_X9_31
Definition pkcs11t.h:601
#define CKM_AES_CBC_ENCRYPT_DATA
Definition pkcs11t.h:942
#define CKA_VALUE
Definition pkcs11t.h:442
#define CKA_URL
Definition pkcs11t.h:453
#define CKM_GOSTR3410
Definition pkcs11t.h:945
#define CKM_CAMELLIA_CBC_PAD
Definition pkcs11t.h:842
#define CKF_EXCLUDE_COUNTER
Definition pkcs11t.h:1811
CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR
Definition pkcs11t.h:1175
#define CKM_CAMELLIA_ECB_ENCRYPT_DATA
Definition pkcs11t.h:843
#define CKM_SKIPJACK_CFB16
Definition pkcs11t.h:871
#define CKK_JUNIPER
Definition pkcs11t.h:360
#define CKM_WTLS_MASTER_KEY_DERIVE
Definition pkcs11t.h:812
#define CKM_SKIPJACK_KEY_GEN
Definition pkcs11t.h:865
#define CKH_MONOTONIC_COUNTER
Definition pkcs11t.h:330
#define CKF_ENCRYPT
Definition pkcs11t.h:1006
#define CKF_OS_LOCKING_OK
Definition pkcs11t.h:1226
#define CKM_GOST28147_KEY_WRAP
Definition pkcs11t.h:955
#define CKM_SHA224_RSA_PKCS_PSS
Definition pkcs11t.h:629
#define CKA_LOCAL
Definition pkcs11t.h:495
#define CKM_MD5_KEY_DERIVATION
Definition pkcs11t.h:783
#define CKM_BATON_ECB96
Definition pkcs11t.h:882
#define CKP_PKCS5_PBKD2_HMAC_SHA384
Definition pkcs11t.h:1723
#define CKM_CAST3_MAC
Definition pkcs11t.h:735
#define CKR_OBJECT_HANDLE_INVALID
Definition pkcs11t.h:1086
#define CKF_EC_ECPARAMETERS
Definition pkcs11t.h:1024
#define CKM_CDMF_KEY_GEN
Definition pkcs11t.h:673
#define CKA_ECDSA_PARAMS
Definition pkcs11t.h:505
#define CKM_SHA512_224
Definition pkcs11t.h:631
#define CKM_KEA_KEY_PAIR_GEN
Definition pkcs11t.h:876
#define CKM_SHA256_HMAC
Definition pkcs11t.h:708
#define CKA_RESET_ON_INIT
Definition pkcs11t.h:540
#define CKA_VERIFY
Definition pkcs11t.h:469
#define CKR_PIN_INVALID
Definition pkcs11t.h:1090
#define CKA_OTP_PIN_REQUIREMENT
Definition pkcs11t.h:527
CK_ULONG CK_RSA_PKCS_MGF_TYPE
Definition pkcs11t.h:1241
#define CKR_UNWRAPPING_KEY_SIZE_RANGE
Definition pkcs11t.h:1114
#define CKM_X9_42_MQV_DERIVE
Definition pkcs11t.h:619
#define CKM_GOST28147
Definition pkcs11t.h:953
#define CKM_CDMF_ECB
Definition pkcs11t.h:674
#define CKD_CPDIVERSIFY_KDF
Definition pkcs11t.h:1300
#define CKM_TLS12_MASTER_KEY_DERIVE
Definition pkcs11t.h:822
#define CKO_DATA
Definition pkcs11t.h:310
#define CKM_BATON_SHUFFLE
Definition pkcs11t.h:885
#define CKO_PRIVATE_KEY
Definition pkcs11t.h:313
#define CKM_SHA512_256_HMAC_GENERAL
Definition pkcs11t.h:637
#define CKK_IDEA
Definition pkcs11t.h:357
#define CKM_RC5_MAC_GENERAL
Definition pkcs11t.h:755
#define CKD_SHA384_KDF
Definition pkcs11t.h:1298
#define CKR_ENCRYPTED_DATA_INVALID
Definition pkcs11t.h:1063
#define CKM_RC2_CBC_PAD
Definition pkcs11t.h:651
#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411
Definition pkcs11t.h:1720
#define CKM_SEED_CBC_PAD
Definition pkcs11t.h:861
#define CKR_CRYPTOKI_ALREADY_INITIALIZED
Definition pkcs11t.h:1143
#define CKM_GENERIC_SECRET_KEY_GEN
Definition pkcs11t.h:763
#define CKM_DH_PKCS_KEY_PAIR_GEN
Definition pkcs11t.h:613
#define CKM_DES3_ECB_ENCRYPT_DATA
Definition pkcs11t.h:939
#define CKA_ALLOWED_MECHANISMS
Definition pkcs11t.h:557
#define CKF_SERIAL_SESSION
Definition pkcs11t.h:290
#define CKR_FUNCTION_FAILED
Definition pkcs11t.h:1044
#define CKM_CDMF_MAC_GENERAL
Definition pkcs11t.h:677
#define CKH_CLOCK
Definition pkcs11t.h:331
#define CKA_OTP_COUNTER_REQUIREMENT
Definition pkcs11t.h:526
#define CKM_SHA384
Definition pkcs11t.h:713
#define CKA_COPYABLE
Definition pkcs11t.h:501
#define CKF_DUAL_CRYPTO_OPERATIONS
Definition pkcs11t.h:185
#define CKA_PRIME_2
Definition pkcs11t.h:479
#define CKR_OPERATION_NOT_INITIALIZED
Definition pkcs11t.h:1088
#define CKR_ACTION_PROHIBITED
Definition pkcs11t.h:1056
#define CKF_SO_PIN_TO_BE_CHANGED
Definition pkcs11t.h:246
#define CKR_SESSION_READ_ONLY_EXISTS
Definition pkcs11t.h:1103
#define CKM_TLS_PRE_MASTER_KEY_GEN
Definition pkcs11t.h:774
#define CKM_EC_KEY_PAIR_GEN
Definition pkcs11t.h:889
#define CKK_DSA
Definition pkcs11t.h:340
#define CKR_SESSION_READ_WRITE_SO_EXISTS
Definition pkcs11t.h:1104
#define CKM_RC5_KEY_GEN
Definition pkcs11t.h:751
#define CKK_BATON
Definition pkcs11t.h:359
#define CKR_KEY_SIZE_RANGE
Definition pkcs11t.h:1072
#define CKM_AES_GCM
Definition pkcs11t.h:920
#define CKM_DH_PKCS_PARAMETER_GEN
Definition pkcs11t.h:958
#define CKM_PBE_MD5_CAST128_CBC
Definition pkcs11t.h:797
#define CKM_SHA384_HMAC
Definition pkcs11t.h:714
#define CKR_TEMPLATE_INCONSISTENT
Definition pkcs11t.h:1109
#define CKM_CDMF_CBC
Definition pkcs11t.h:675
#define CKA_COLOR
Definition pkcs11t.h:548
#define CKM_RC5_CBC_PAD
Definition pkcs11t.h:756
#define CKR_OPERATION_ACTIVE
Definition pkcs11t.h:1087
#define CKR_DATA_LEN_RANGE
Definition pkcs11t.h:1059
#define CKO_MECHANISM
Definition pkcs11t.h:317
#define CKA_UNWRAP
Definition pkcs11t.h:466
#define CKM_SHA1_RSA_PKCS
Definition pkcs11t.h:593
#define CKF_ARRAY_ATTRIBUTE
Definition pkcs11t.h:421
#define CKK_GOSTR3410
Definition pkcs11t.h:381
#define CKM_SHA512
Definition pkcs11t.h:716
#define CKM_MD2_KEY_DERIVATION
Definition pkcs11t.h:784
CK_ULONG CK_KEY_TYPE
Definition pkcs11t.h:336
#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN
Definition pkcs11t.h:961
#define CKA_TRUSTED
Definition pkcs11t.h:450
#define CKA_WRAP_WITH_TRUSTED
Definition pkcs11t.h:515
#define CKK_GOSTR3411
Definition pkcs11t.h:382
CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE
Definition pkcs11t.h:1714
#define CKR_BUFFER_TOO_SMALL
Definition pkcs11t.h:1137
#define CKM_ARIA_MAC_GENERAL
Definition pkcs11t.h:851
#define CKU_SO
Definition pkcs11t.h:264
#define CKM_CAMELLIA_CBC_ENCRYPT_DATA
Definition pkcs11t.h:844
#define CKM_AES_CFB128
Definition pkcs11t.h:966
#define CKS_RW_USER_FUNCTIONS
Definition pkcs11t.h:275
#define CKM_AES_CMAC_GENERAL
Definition pkcs11t.h:924
#define CKS_RO_PUBLIC_SESSION
Definition pkcs11t.h:272
#define CKO_HW_FEATURE
Definition pkcs11t.h:315
#define CKA_DECRYPT
Definition pkcs11t.h:464
#define CKM_PBE_MD5_CAST_CBC
Definition pkcs11t.h:794
#define CKM_SHA1_KEY_DERIVATION
Definition pkcs11t.h:785
#define CKA_OTP_LENGTH
Definition pkcs11t.h:521
#define CKF_EXCLUDE_CHALLENGE
Definition pkcs11t.h:1812
#define CKO_VENDOR_DEFINED
Definition pkcs11t.h:320
#define CKP_PKCS5_PBKD2_HMAC_SHA512
Definition pkcs11t.h:1724
#define CKA_KEY_TYPE
Definition pkcs11t.h:459
#define CKR_USER_PIN_NOT_INITIALIZED
Definition pkcs11t.h:1118
#define CKN_OTP_CHANGED
Definition pkcs11t.h:102
#define CKM_RIPEMD160
Definition pkcs11t.h:703
#define CKA_ALWAYS_AUTHENTICATE
Definition pkcs11t.h:513
#define CKM_RSA_9796
Definition pkcs11t.h:588
#define CKK_CAST
Definition pkcs11t.h:352
#define CKM_JUNIPER_WRAP
Definition pkcs11t.h:910
#define CKA_VALUE_LEN
Definition pkcs11t.h:493
#define CKA_CHAR_ROWS
Definition pkcs11t.h:546
#define CKM_CAST_ECB
Definition pkcs11t.h:727
#define CKM_BATON_COUNTER
Definition pkcs11t.h:884
#define CKM_CAST3_KEY_GEN
Definition pkcs11t.h:732
#define CKM_TLS_PRF
Definition pkcs11t.h:779
#define CKM_JUNIPER_CBC128
Definition pkcs11t.h:907
#define CKK_RC2
Definition pkcs11t.h:347
#define CKM_SHA224_RSA_PKCS
Definition pkcs11t.h:628
#define CKM_PBE_SHA1_DES3_EDE_CBC
Definition pkcs11t.h:802
#define CKR_USER_ALREADY_LOGGED_IN
Definition pkcs11t.h:1116
#define CKK_SHA384_HMAC
Definition pkcs11t.h:376
#define CKR_STATE_UNSAVEABLE
Definition pkcs11t.h:1140
#define CKM_RIPEMD160_RSA_PKCS
Definition pkcs11t.h:596
#define CKF_RNG
Definition pkcs11t.h:155
#define CKP_PKCS5_PBKD2_HMAC_SHA1
Definition pkcs11t.h:1719
#define CKM_AES_CTS
Definition pkcs11t.h:922
#define CKA_GOST28147_PARAMS
Definition pkcs11t.h:537
#define CKM_X9_42_DH_PARAMETER_GEN
Definition pkcs11t.h:959
#define CKK_RIPEMD128_HMAC
Definition pkcs11t.h:373
#define CKF_SIGN
Definition pkcs11t.h:1009
#define CKM_JUNIPER_COUNTER
Definition pkcs11t.h:908
#define CKD_SHA1_KDF_CONCATENATE
Definition pkcs11t.h:1295
#define CKF_GENERATE
Definition pkcs11t.h:1013
#define CKM_SHA512_256_HMAC
Definition pkcs11t.h:636
#define CKM_KIP_WRAP
Definition pkcs11t.h:834
CK_ULONG CK_MECHANISM_TYPE
Definition pkcs11t.h:583
#define CKK_GENERIC_SECRET
Definition pkcs11t.h:346
#define CKM_TLS12_KEY_SAFE_DERIVE
Definition pkcs11t.h:825
#define CKM_PBE_SHA1_CAST128_CBC
Definition pkcs11t.h:799
#define CKU_CONTEXT_SPECIFIC
Definition pkcs11t.h:268
#define CKP_PKCS5_PBKD2_HMAC_SHA512_224
Definition pkcs11t.h:1725
#define CKA_VALUE_BITS
Definition pkcs11t.h:492
#define CKM_TLS12_KDF
Definition pkcs11t.h:821
#define CKF_SO_PIN_FINAL_TRY
Definition pkcs11t.h:234
#define CKF_EXCLUDE_PIN
Definition pkcs11t.h:1813
#define CKA_COEFFICIENT
Definition pkcs11t.h:482
#define CKR_INFORMATION_SENSITIVE
Definition pkcs11t.h:1139
#define CKR_NEW_PIN_MODE
Definition pkcs11t.h:1147
#define CKM_AES_KEY_WRAP_PAD
Definition pkcs11t.h:970
#define CKR_OK
Definition pkcs11t.h:1038
#define CKM_CONCATENATE_DATA_AND_BASE
Definition pkcs11t.h:766
#define CKM_GOSTR3410_KEY_WRAP
Definition pkcs11t.h:947
#define CKA_OWNER
Definition pkcs11t.h:448
#define CKM_XOR_BASE_AND_DATA
Definition pkcs11t.h:767
#define CKA_DESTROYABLE
Definition pkcs11t.h:503
#define CKM_ECDSA
Definition pkcs11t.h:891
#define CKM_ECDSA_SHA384
Definition pkcs11t.h:895
#define CKM_RSA_X9_31
Definition pkcs11t.h:600
#define CKM_GOST28147_KEY_GEN
Definition pkcs11t.h:951
#define CKK_CAST3
Definition pkcs11t.h:353
#define CKA_SUBPRIME
Definition pkcs11t.h:485
#define CKA_DERIVE
Definition pkcs11t.h:471
#define CKK_SKIPJACK
Definition pkcs11t.h:358
#define CKR_ATTRIBUTE_VALUE_INVALID
Definition pkcs11t.h:1054
#define CKA_REQUIRED_CMS_ATTRIBUTES
Definition pkcs11t.h:554
#define CKM_GOSTR3411
Definition pkcs11t.h:949
#define CK_CERTIFICATE_CATEGORY_AUTHORITY
Definition pkcs11t.h:397
#define CKM_PBE_MD2_DES_CBC
Definition pkcs11t.h:792
#define CKM_DES_OFB8
Definition pkcs11t.h:681
#define CKM_RIPEMD160_HMAC
Definition pkcs11t.h:704
#define CKM_HOTP
Definition pkcs11t.h:722
#define CKM_KEY_WRAP_SET_OAEP
Definition pkcs11t.h:830
#define CKM_KIP_MAC
Definition pkcs11t.h:835
#define CKA_MIME_TYPES
Definition pkcs11t.h:552
#define CKM_CAST3_CBC_PAD
Definition pkcs11t.h:737
#define CKA_CERTIFICATE_CATEGORY
Definition pkcs11t.h:451
#define CKK_VENDOR_DEFINED
Definition pkcs11t.h:387
#define CKM_DSA_SHA224
Definition pkcs11t.h:608
#define CKM_TLS_MAC
Definition pkcs11t.h:826
CK_BYTE CK_BBOOL
Definition pkcs11t.h:45
#define CKR_FUNCTION_NOT_SUPPORTED
Definition pkcs11t.h:1068
#define CKF_RESTORE_KEY_NOT_NEEDED
Definition pkcs11t.h:165
#define CKM_CAST5_ECB
Definition pkcs11t.h:741
#define CKA_GOSTR3410_PARAMS
Definition pkcs11t.h:535
#define CKR_USER_NOT_LOGGED_IN
Definition pkcs11t.h:1117
#define CKA_ALWAYS_SENSITIVE
Definition pkcs11t.h:497
#define CKM_DES_CFB64
Definition pkcs11t.h:682
#define CKK_HOTP
Definition pkcs11t.h:366
#define CKM_AES_CFB1
Definition pkcs11t.h:968
#define CKM_DES_ECB_ENCRYPT_DATA
Definition pkcs11t.h:937
#define CKR_DEVICE_REMOVED
Definition pkcs11t.h:1062
#define CKF_UNWRAP
Definition pkcs11t.h:1016
#define CKA_VENDOR_DEFINED
Definition pkcs11t.h:559
#define CKA_OTP_TIME
Definition pkcs11t.h:529
#define CKM_PBE_SHA1_RC2_40_CBC
Definition pkcs11t.h:805
#define CKM_GOSTR3410_DERIVE
Definition pkcs11t.h:948
#define CKA_END_DATE
Definition pkcs11t.h:473
#define CKG_MGF1_SHA1
Definition pkcs11t.h:1246
#define CKK_SECURID
Definition pkcs11t.h:365
#define CKP_PKCS5_PBKD2_HMAC_SHA256
Definition pkcs11t.h:1722
#define CKM_SHA256_HMAC_GENERAL
Definition pkcs11t.h:709
#define CKA_ATTR_TYPES
Definition pkcs11t.h:449
#define CKF_USER_PIN_TO_BE_CHANGED
Definition pkcs11t.h:223
#define CKM_AES_ECB_ENCRYPT_DATA
Definition pkcs11t.h:941
#define CKM_RIPEMD128_RSA_PKCS
Definition pkcs11t.h:595
#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED
Definition pkcs11t.h:395
#define CKR_DOMAIN_PARAMS_INVALID
Definition pkcs11t.h:1133
#define CKA_CERTIFICATE_TYPE
Definition pkcs11t.h:444
#define CKM_ECDSA_SHA256
Definition pkcs11t.h:894
#define CKM_BATON_WRAP
Definition pkcs11t.h:886
#define CKF_SO_PIN_LOCKED
Definition pkcs11t.h:239
CK_ULONG CK_CERTIFICATE_TYPE
Definition pkcs11t.h:393
#define CKM_AES_OFB
Definition pkcs11t.h:963
#define CKR_TOKEN_WRITE_PROTECTED
Definition pkcs11t.h:1112
#define CKA_HASH_OF_ISSUER_PUBLIC_KEY
Definition pkcs11t.h:455
#define CKM_HOTP_KEY_GEN
Definition pkcs11t.h:721
#define CKF_DECRYPT
Definition pkcs11t.h:1007
#define CKH_VENDOR_DEFINED
Definition pkcs11t.h:333
#define CKM_TWOFISH_CBC
Definition pkcs11t.h:933
#define CKK_CDMF
Definition pkcs11t.h:361
#define CKA_MODULUS_BITS
Definition pkcs11t.h:475
void CK_PTR CK_VOID_PTR
Definition pkcs11t.h:66
#define CKM_RIPEMD128_HMAC
Definition pkcs11t.h:701
#define CKA_LABEL
Definition pkcs11t.h:440
#define CKA_EXTRACTABLE
Definition pkcs11t.h:494
#define CKM_ACTI
Definition pkcs11t.h:723
#define CKM_CAST_KEY_GEN
Definition pkcs11t.h:726
#define CKR_TEMPLATE_INCOMPLETE
Definition pkcs11t.h:1108
#define CKM_DES3_KEY_GEN
Definition pkcs11t.h:664
#define CKF_EC_COMPRESS
Definition pkcs11t.h:1027
#define CKM_DES3_CBC_ENCRYPT_DATA
Definition pkcs11t.h:940
#define CKM_CAST128_MAC
Definition pkcs11t.h:746
#define CKM_MD5_HMAC
Definition pkcs11t.h:692
#define CKF_SO_PIN_COUNT_LOW
Definition pkcs11t.h:229
CK_ULONG CK_OBJECT_HANDLE
Definition pkcs11t.h:298
#define CKA_ENCODING_METHODS
Definition pkcs11t.h:551
CK_ULONG CK_HW_FEATURE_TYPE
Definition pkcs11t.h:327
#define CKM_DES3_ECB
Definition pkcs11t.h:665
#define CKM_AES_CBC
Definition pkcs11t.h:915
#define CKM_SEED_MAC
Definition pkcs11t.h:859
#define CKM_AES_MAC
Definition pkcs11t.h:916
#define CKM_SHA256_RSA_PKCS_PSS
Definition pkcs11t.h:624
#define CKR_KEY_NOT_NEEDED
Definition pkcs11t.h:1075
#define CKM_SKIPJACK_WRAP
Definition pkcs11t.h:873
#define CKR_NO_EVENT
Definition pkcs11t.h:1047
#define CKR_VENDOR_DEFINED
Definition pkcs11t.h:1158
#define CKM_SKIPJACK_ECB64
Definition pkcs11t.h:866
#define CKA_ENCRYPT
Definition pkcs11t.h:463
#define CKM_SHA384_KEY_DERIVATION
Definition pkcs11t.h:788
#define CKA_SUBPRIME_BITS
Definition pkcs11t.h:489
#define CKM_RSA_PKCS_PSS
Definition pkcs11t.h:602
#define CKM_SKIPJACK_OFB64
Definition pkcs11t.h:868
#define CKM_GOSTR3410_WITH_GOSTR3411
Definition pkcs11t.h:946
#define CKM_SHA1_RSA_PKCS_PSS
Definition pkcs11t.h:603
#define CKK_ECDSA
Definition pkcs11t.h:342
#define CKM_DES2_KEY_GEN
Definition pkcs11t.h:663
#define CKM_GOSTR3410_KEY_PAIR_GEN
Definition pkcs11t.h:944
#define CKA_PIXEL_X
Definition pkcs11t.h:543
#define CKA_DEFAULT_CMS_ATTRIBUTES
Definition pkcs11t.h:555
#define CKR_HOST_MEMORY
Definition pkcs11t.h:1040
#define CKM_SHA512_256_KEY_DERIVATION
Definition pkcs11t.h:638
#define CKA_GOSTR3411_PARAMS
Definition pkcs11t.h:536
#define CKM_SHA384_RSA_PKCS
Definition pkcs11t.h:622
CK_ULONG CK_ATTRIBUTE_TYPE
Definition pkcs11t.h:416
#define CKR_FUNCTION_NOT_PARALLEL
Definition pkcs11t.h:1066
#define CKK_GOST28147
Definition pkcs11t.h:383
#define CKA_CHAR_COLUMNS
Definition pkcs11t.h:547
#define CKA_UNWRAP_TEMPLATE
Definition pkcs11t.h:517
#define CKR_SIGNATURE_LEN_RANGE
Definition pkcs11t.h:1107
#define CKM_ARIA_MAC
Definition pkcs11t.h:850
#define CKR_CURVE_NOT_SUPPORTED
Definition pkcs11t.h:1135
#define CKM_SHA224_KEY_DERIVATION
Definition pkcs11t.h:790
#define CKA_KEY_GEN_MECHANISM
Definition pkcs11t.h:498
#define CKR_FIPS_SELF_TEST_FAILED
Definition pkcs11t.h:1151
#define CKM_JUNIPER_SHUFFLE
Definition pkcs11t.h:909
#define CKK_TWOFISH
Definition pkcs11t.h:364
#define CKR_USER_TYPE_INVALID
Definition pkcs11t.h:1119
#define CKM_SEED_ECB
Definition pkcs11t.h:857
#define CKM_CAMELLIA_ECB
Definition pkcs11t.h:838
#define CKM_ECDH_AES_KEY_WRAP
Definition pkcs11t.h:902
#define CKO_DOMAIN_PARAMETERS
Definition pkcs11t.h:316
#define CKM_PBE_MD5_CAST3_CBC
Definition pkcs11t.h:795
#define CKM_RC4
Definition pkcs11t.h:654
#define CKM_RSA_AES_KEY_WRAP
Definition pkcs11t.h:903
#define CKF_USER_PIN_LOCKED
Definition pkcs11t.h:216
#define CKM_PBE_MD5_DES_CBC
Definition pkcs11t.h:793
#define CKM_SHA512_T_HMAC
Definition pkcs11t.h:641
#define CKM_SHA512_HMAC
Definition pkcs11t.h:717
#define CKM_RIPEMD160_HMAC_GENERAL
Definition pkcs11t.h:705
#define CKM_SHA256_RSA_PKCS
Definition pkcs11t.h:621
#define CKR_KEY_HANDLE_INVALID
Definition pkcs11t.h:1070
#define CKM_CAST_MAC
Definition pkcs11t.h:729
#define CKM_RC2_MAC_GENERAL
Definition pkcs11t.h:650
#define CKM_RC2_KEY_GEN
Definition pkcs11t.h:645
#define CKR_MUTEX_BAD
Definition pkcs11t.h:1144
#define CKM_CAST128_KEY_GEN
Definition pkcs11t.h:740
#define CKF_TOKEN_PRESENT
Definition pkcs11t.h:122
#define CKM_AES_XCBC_MAC
Definition pkcs11t.h:926
#define CKD_SHA224_KDF
Definition pkcs11t.h:1296
#define CKM_SHA384_RSA_PKCS_PSS
Definition pkcs11t.h:625
#define CKM_RSA_PKCS_TPM_1_1
Definition pkcs11t.h:972
#define CKM_SSL3_KEY_AND_MAC_DERIVE
Definition pkcs11t.h:771
#define CKM_DES_MAC_GENERAL
Definition pkcs11t.h:660
#define CKA_PIXEL_Y
Definition pkcs11t.h:544
#define CKR_SAVED_STATE_INVALID
Definition pkcs11t.h:1138
#define CKM_CAST128_CBC
Definition pkcs11t.h:744
#define CKM_AES_ECB
Definition pkcs11t.h:914
#define CKM_ARIA_ECB_ENCRYPT_DATA
Definition pkcs11t.h:853
#define CKK_EC
Definition pkcs11t.h:343
#define CKA_WRAP_TEMPLATE
Definition pkcs11t.h:516
#define CKR_WRAPPED_KEY_LEN_RANGE
Definition pkcs11t.h:1125
#define CKK_ARIA
Definition pkcs11t.h:369
#define CKF_HW
Definition pkcs11t.h:1003
#define CKM_X9_42_DH_HYBRID_DERIVE
Definition pkcs11t.h:618
#define CKA_PRIME_BITS
Definition pkcs11t.h:488
#define CKF_EXCLUDE_TIME
Definition pkcs11t.h:1810
#define CKR_EXCEEDED_MAX_ITERATIONS
Definition pkcs11t.h:1150
#define CKM_BLOWFISH_KEY_GEN
Definition pkcs11t.h:930
#define CKM_GOST28147_MAC
Definition pkcs11t.h:954
#define CKM_CAST128_ECB
Definition pkcs11t.h:742
#define CKR_KEY_INDIGESTIBLE
Definition pkcs11t.h:1078
#define CKK_MD5_HMAC
Definition pkcs11t.h:371
#define CKH_USER_INTERFACE
Definition pkcs11t.h:332
#define CKK_SHA_1_HMAC
Definition pkcs11t.h:372
#define CKA_OTP_COUNTER
Definition pkcs11t.h:528
#define CKA_CHAR_SETS
Definition pkcs11t.h:550
#define CKF_VERIFY_RECOVER
Definition pkcs11t.h:1012
#define CKA_MECHANISM_TYPE
Definition pkcs11t.h:553
CK_ULONG CK_STATE
Definition pkcs11t.h:271
#define CKK_AES
Definition pkcs11t.h:362
#define CKM_SEED_CBC
Definition pkcs11t.h:858
#define CKA_BASE
Definition pkcs11t.h:486
#define CKM_DSA_SHA256
Definition pkcs11t.h:609
#define CKF_CLOCK_ON_TOKEN
Definition pkcs11t.h:171
#define CKS_RW_SO_FUNCTIONS
Definition pkcs11t.h:276
#define CKM_DES_CFB8
Definition pkcs11t.h:683
#define CKR_KEY_NEEDED
Definition pkcs11t.h:1077
#define CKM_BLOWFISH_CBC_PAD
Definition pkcs11t.h:934
#define CKR_PUBLIC_KEY_INVALID
Definition pkcs11t.h:1154
#define CKR_KEY_TYPE_INCONSISTENT
Definition pkcs11t.h:1073
#define CKM_SHA_1
Definition pkcs11t.h:695
#define CKM_DSA_SHA1
Definition pkcs11t.h:607
#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT
Definition pkcs11t.h:1115
#define CKM_AES_XCBC_MAC_96
Definition pkcs11t.h:927
#define CKM_ECDSA_KEY_PAIR_GEN
Definition pkcs11t.h:888
#define CKK_X9_42_DH
Definition pkcs11t.h:344
#define CKM_WTLS_PRF
Definition pkcs11t.h:814
#define CKF_ERROR_STATE
Definition pkcs11t.h:248
#define CKF_WRITE_PROTECTED
Definition pkcs11t.h:156
#define CKA_EC_PARAMS
Definition pkcs11t.h:506
#define CKM_DES_MAC
Definition pkcs11t.h:658
#define CKM_RC2_ECB
Definition pkcs11t.h:646
#define CKM_TLS12_KEY_AND_MAC_DERIVE
Definition pkcs11t.h:823
#define CKA_WRAP
Definition pkcs11t.h:465
#define CKA_CLASS
Definition pkcs11t.h:437
#define CKK_SHA512_HMAC
Definition pkcs11t.h:377
#define CKR_KEY_NOT_WRAPPABLE
Definition pkcs11t.h:1080
#define CKM_MD2_HMAC
Definition pkcs11t.h:687
#define CKA_DERIVE_TEMPLATE
Definition pkcs11t.h:518
#define CKF_EC_NAMEDCURVE
Definition pkcs11t.h:1025
#define CKF_NEXT_OTP
Definition pkcs11t.h:1809
#define CKM_TLS12_MASTER_KEY_DERIVE_DH
Definition pkcs11t.h:824
#define CKM_RC5_ECB
Definition pkcs11t.h:752
#define CKF_DONT_BLOCK
Definition pkcs11t.h:1234
#define CKM_SHA224_HMAC_GENERAL
Definition pkcs11t.h:712
#define CKA_HAS_RESET
Definition pkcs11t.h:541
#define CKA_OTP_SERVICE_LOGO
Definition pkcs11t.h:532
#define CKA_SUBJECT
Definition pkcs11t.h:460
#define CKM_DES3_MAC
Definition pkcs11t.h:667

◆ CK_DECLARE_FUNCTION

#define CK_DECLARE_FUNCTION (   returnType,
  name 
)     returnType name

Definition at line 25 of file p11.h.

◆ CK_DECLARE_FUNCTION_POINTER

#define CK_DECLARE_FUNCTION_POINTER (   returnType,
  name 
)     returnType (* name)

Definition at line 33 of file p11.h.

◆ CK_PTR

#define CK_PTR   *

Definition at line 19 of file p11.h.

◆ NULL_PTR

#define NULL_PTR   nullptr

Definition at line 41 of file p11.h.