Botan 3.5.0
Crypto and TLS for C&
|
Provides access to all PKCS#11 functions. More...
#include <p11.h>
Public Member Functions | |
bool | C_CancelFunction (SessionHandle session, ReturnValue *return_value=ThrowException) const |
bool | C_CloseAllSessions (SlotId slot_id, ReturnValue *return_value=ThrowException) const |
bool | C_CloseSession (SessionHandle session, ReturnValue *return_value=ThrowException) const |
bool | C_CopyObject (SessionHandle session, ObjectHandle object, Attribute *attribute_template_ptr, Ulong count, ObjectHandle *new_object_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_CreateObject (SessionHandle session, Attribute *attribute_template_ptr, Ulong count, ObjectHandle *object_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_Decrypt (SessionHandle session, Byte *encrypted_data_ptr, Ulong encrypted_data_len, Byte *data_ptr, Ulong *data_len_ptr, ReturnValue *return_value=ThrowException) const |
template<typename TAllocA , typename TAllocB > | |
bool | C_Decrypt (SessionHandle session, const std::vector< uint8_t, TAllocA > &encrypted_data, std::vector< uint8_t, TAllocB > &decrypted_data, ReturnValue *return_value=ThrowException) const |
bool | C_DecryptDigestUpdate (SessionHandle session, Byte *encrypted_part_ptr, Ulong encrypted_part_len, Byte *part_ptr, Ulong *part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DecryptFinal (SessionHandle session, Byte *last_part_ptr, Ulong *last_part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DecryptInit (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_DecryptUpdate (SessionHandle session, Byte *encrypted_part_ptr, Ulong encrypted_part_len, Byte *part_ptr, Ulong *part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DecryptVerifyUpdate (SessionHandle session, Byte *encrypted_part_ptr, Ulong encrypted_part_len, Byte *part_ptr, Ulong *part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DeriveKey (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle base_key, Attribute *attribute_template_ptr, Ulong attribute_count, ObjectHandle *key_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DestroyObject (SessionHandle session, ObjectHandle object, ReturnValue *return_value=ThrowException) const |
bool | C_Digest (SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *digest_ptr, Ulong *digest_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DigestEncryptUpdate (SessionHandle session, Byte *part_ptr, Ulong part_len, Byte *encrypted_part_ptr, Ulong *encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DigestFinal (SessionHandle session, Byte *digest_ptr, Ulong *digest_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DigestInit (SessionHandle session, Mechanism *mechanism_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_DigestKey (SessionHandle session, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_DigestUpdate (SessionHandle session, Byte *part_ptr, Ulong part_len, ReturnValue *return_value=ThrowException) const |
bool | C_Encrypt (SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *encrypted_data, Ulong *encrypted_data_len_ptr, ReturnValue *return_value=ThrowException) const |
template<typename TAllocA , typename TAllocB > | |
bool | C_Encrypt (SessionHandle session, const std::vector< uint8_t, TAllocA > &plaintext_data, std::vector< uint8_t, TAllocB > &encrypted_data, ReturnValue *return_value=ThrowException) const |
bool | C_EncryptFinal (SessionHandle session, Byte *last_encrypted_part_ptr, Ulong *last_encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_EncryptInit (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_EncryptUpdate (SessionHandle session, Byte *part_ptr, Ulong part_len, Byte *encrypted_part_ptr, Ulong *encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_Finalize (VoidPtr reserved, ReturnValue *return_value=ThrowException) const |
bool | C_FindObjects (SessionHandle session, ObjectHandle *object_ptr, Ulong max_object_count, Ulong *object_count_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_FindObjectsFinal (SessionHandle session, ReturnValue *return_value=ThrowException) const |
bool | C_FindObjectsInit (SessionHandle session, Attribute *attribute_template_ptr, Ulong count, ReturnValue *return_value=ThrowException) const |
bool | C_GenerateKey (SessionHandle session, Mechanism *mechanism_ptr, Attribute *attribute_template_ptr, Ulong count, ObjectHandle *key_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GenerateKeyPair (SessionHandle session, Mechanism *mechanism_ptr, Attribute *public_key_template_ptr, Ulong public_key_attribute_count, Attribute *private_key_template_ptr, Ulong private_key_attribute_count, ObjectHandle *public_key_ptr, ObjectHandle *private_key_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GenerateRandom (SessionHandle session, Byte *random_data_ptr, Ulong random_len, ReturnValue *return_value=ThrowException) const |
bool | C_GetAttributeValue (SessionHandle session, ObjectHandle object, Attribute *attribute_template_ptr, Ulong count, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_GetAttributeValue (SessionHandle session, ObjectHandle object, std::map< AttributeType, std::vector< uint8_t, TAlloc > > &attribute_values, ReturnValue *return_value=ThrowException) const |
bool | C_GetFunctionStatus (SessionHandle session, ReturnValue *return_value=ThrowException) const |
bool | C_GetInfo (Info *info_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetMechanismInfo (SlotId slot_id, MechanismType type, MechanismInfo *info_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetMechanismList (SlotId slot_id, MechanismType *mechanism_list_ptr, Ulong *count_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetMechanismList (SlotId slot_id, std::vector< MechanismType > &mechanisms, ReturnValue *return_value=ThrowException) const |
bool | C_GetObjectSize (SessionHandle session, ObjectHandle object, Ulong *size_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetOperationState (SessionHandle session, Byte *operation_state_ptr, Ulong *operation_state_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetSessionInfo (SessionHandle session, SessionInfo *info_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetSlotInfo (SlotId slot_id, SlotInfo *info_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetSlotList (Bbool token_present, SlotId *slot_list_ptr, Ulong *count_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_GetSlotList (bool token_present, std::vector< SlotId > &slot_ids, ReturnValue *return_value=ThrowException) const |
bool | C_GetTokenInfo (SlotId slot_id, TokenInfo *info_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_Initialize (VoidPtr init_args, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_InitPIN (SessionHandle session, const std::vector< uint8_t, TAlloc > &pin, ReturnValue *return_value=ThrowException) const |
bool | C_InitPIN (SessionHandle session, Utf8Char *pin_ptr, Ulong pin_len, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_InitToken (SlotId slot_id, const std::vector< uint8_t, TAlloc > &so_pin, std::string_view label, ReturnValue *return_value=ThrowException) const |
bool | C_InitToken (SlotId slot_id, Utf8Char *so_pin_ptr, Ulong so_pin_len, Utf8Char *label_ptr, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_Login (SessionHandle session, UserType user_type, const std::vector< uint8_t, TAlloc > &pin, ReturnValue *return_value=ThrowException) const |
bool | C_Login (SessionHandle session, UserType user_type, Utf8Char *pin_ptr, Ulong pin_len, ReturnValue *return_value=ThrowException) const |
bool | C_Logout (SessionHandle session, ReturnValue *return_value=ThrowException) const |
bool | C_OpenSession (SlotId slot_id, Flags flags, VoidPtr application, Notify notify, SessionHandle *session_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_SeedRandom (SessionHandle session, const Byte *seed_ptr, Ulong seed_len, ReturnValue *return_value=ThrowException) const |
bool | C_SetAttributeValue (SessionHandle session, ObjectHandle object, Attribute *attribute_template_ptr, Ulong count, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_SetAttributeValue (SessionHandle session, ObjectHandle object, std::map< AttributeType, std::vector< uint8_t, TAlloc > > &attribute_values, ReturnValue *return_value=ThrowException) const |
bool | C_SetOperationState (SessionHandle session, Byte *operation_state_ptr, Ulong operation_state_len, ObjectHandle encryption_key, ObjectHandle authentication_key, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_SetPIN (SessionHandle session, const std::vector< uint8_t, TAlloc > &old_pin, const std::vector< uint8_t, TAlloc > &new_pin, ReturnValue *return_value=ThrowException) const |
bool | C_SetPIN (SessionHandle session, Utf8Char *old_pin_ptr, Ulong old_len, Utf8Char *new_pin_ptr, Ulong new_len, ReturnValue *return_value=ThrowException) const |
bool | C_Sign (SessionHandle session, const Byte *data_ptr, Ulong data_len, Byte *signature_ptr, Ulong *signature_len_ptr, ReturnValue *return_value=ThrowException) const |
template<typename TAllocA , typename TAllocB > | |
bool | C_Sign (SessionHandle session, const std::vector< uint8_t, TAllocA > &data, std::vector< uint8_t, TAllocB > &signature, ReturnValue *return_value=ThrowException) const |
bool | C_SignEncryptUpdate (SessionHandle session, Byte *part_ptr, Ulong part_len, Byte *encrypted_part_ptr, Ulong *encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_SignFinal (SessionHandle session, Byte *signature_ptr, Ulong *signature_len_ptr, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_SignFinal (SessionHandle session, std::vector< uint8_t, TAlloc > &signature, ReturnValue *return_value=ThrowException) const |
bool | C_SignInit (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_SignRecover (SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *signature_ptr, Ulong *signature_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_SignRecoverInit (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_SignUpdate (SessionHandle session, const Byte *part_ptr, Ulong part_len, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_SignUpdate (SessionHandle session, const std::vector< uint8_t, TAlloc > &part, ReturnValue *return_value=ThrowException) const |
bool | C_UnwrapKey (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle unwrapping_key, Byte *wrapped_key_ptr, Ulong wrapped_key_len, Attribute *attribute_template_ptr, Ulong attribute_count, ObjectHandle *key_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_Verify (SessionHandle session, const Byte *data_ptr, Ulong data_len, const Byte *signature_ptr, Ulong signature_len, ReturnValue *return_value=ThrowException) const |
template<typename TAllocA , typename TAllocB > | |
bool | C_Verify (SessionHandle session, const std::vector< uint8_t, TAllocA > &data, std::vector< uint8_t, TAllocB > &signature, ReturnValue *return_value=ThrowException) const |
bool | C_VerifyFinal (SessionHandle session, const Byte *signature_ptr, Ulong signature_len, ReturnValue *return_value=ThrowException) const |
bool | C_VerifyInit (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_VerifyRecover (SessionHandle session, Byte *signature_ptr, Ulong signature_len, Byte *data_ptr, Ulong *data_len_ptr, ReturnValue *return_value=ThrowException) const |
bool | C_VerifyRecoverInit (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const |
bool | C_VerifyUpdate (SessionHandle session, const Byte *part_ptr, Ulong part_len, ReturnValue *return_value=ThrowException) const |
template<typename TAlloc > | |
bool | C_VerifyUpdate (SessionHandle session, std::vector< uint8_t, TAlloc > part, ReturnValue *return_value=ThrowException) const |
bool | C_WaitForSlotEvent (Flags flags, SlotId *slot_ptr, VoidPtr reserved, ReturnValue *return_value=ThrowException) const |
bool | C_WrapKey (SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle wrapping_key, ObjectHandle key, Byte *wrapped_key_ptr, Ulong *wrapped_key_len_ptr, ReturnValue *return_value=ThrowException) const |
FunctionListPtr | get_functions () const |
LowLevel (FunctionListPtr ptr) | |
Static Public Member Functions | |
static bool | C_GetFunctionList (Dynamically_Loaded_Library &pkcs11_module, FunctionListPtr *function_list_ptr_ptr, ReturnValue *return_value=ThrowException) |
Static Protected Member Functions | |
static bool | handle_return_value (CK_RV function_result, ReturnValue *return_value) |
|
explicit |
ptr | the functon list pointer to use. Can be retrieved via LowLevel::C_GetFunctionList |
Definition at line 64 of file p11.cpp.
bool Botan::PKCS11::LowLevel::C_CancelFunction | ( | SessionHandle | session, |
ReturnValue * | return_value = ThrowException ) const |
C_CancelFunction is a legacy function; it cancels a function running in parallel.
session | the session's handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 670 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_CloseAllSessions | ( | SlotId | slot_id, |
ReturnValue * | return_value = ThrowException ) const |
C_CloseAllSessions closes all sessions with a token.
slot_id | the token's slot |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 204 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_CloseSession | ( | SessionHandle | session, |
ReturnValue * | return_value = ThrowException ) const |
C_CloseSession closes a session between an application and a token.
session | the session's handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 200 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Session::~Session().
bool Botan::PKCS11::LowLevel::C_CopyObject | ( | SessionHandle | session, |
ObjectHandle | object, | ||
Attribute * | attribute_template_ptr, | ||
Ulong | count, | ||
ObjectHandle * | new_object_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_CopyObject copies an object, creating a new object for the copy.
session | the session's handle |
object | the object's handle |
attribute_template_ptr | template for new object |
count | attributes in template |
new_object_ptr | receives handle of copy |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 252 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Object::copy().
bool Botan::PKCS11::LowLevel::C_CreateObject | ( | SessionHandle | session, |
Attribute * | attribute_template_ptr, | ||
Ulong | count, | ||
ObjectHandle * | object_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_CreateObject creates a new object.
session | the session's handle |
attribute_template_ptr | the object's template |
count | attributes in template |
object_ptr | gets new object's handle. |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 243 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_Decrypt | ( | SessionHandle | session, |
Byte * | encrypted_data_ptr, | ||
Ulong | encrypted_data_len, | ||
Byte * | data_ptr, | ||
Ulong * | data_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_Decrypt decrypts encrypted data in a single part.
session | session's handle |
encrypted_data_ptr | ciphertext |
encrypted_data_len | ciphertext length |
data_ptr | gets plaintext |
data_len_ptr | gets p-text size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 359 of file p11.cpp.
References handle_return_value().
|
inline |
C_Decrypt decrypts encrypted data in a single part.
session | session's handle |
encrypted_data | ciphertext |
decrypted_data | gets plaintext |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1902 of file p11.h.
bool Botan::PKCS11::LowLevel::C_DecryptDigestUpdate | ( | SessionHandle | session, |
Byte * | encrypted_part_ptr, | ||
Ulong | encrypted_part_len, | ||
Byte * | part_ptr, | ||
Ulong * | part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DecryptDigestUpdate continues a multiple-part decryption and digesting operation.
session | session's handle |
encrypted_part_ptr | ciphertext |
encrypted_part_len | ciphertext length |
part_ptr | gets plaintext |
part_len_ptr | gets plaintext len |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 538 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DecryptFinal | ( | SessionHandle | session, |
Byte * | last_part_ptr, | ||
Ulong * | last_part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DecryptFinal finishes a multiple-part decryption operation.
session | the session's handle |
last_part_ptr | gets plaintext |
last_part_len_ptr | p-text size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 381 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DecryptInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DecryptInit initializes a decryption operation.
session | the session's handle |
mechanism_ptr | the decryption mechanism |
key | handle of decryption key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 352 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DecryptUpdate | ( | SessionHandle | session, |
Byte * | encrypted_part_ptr, | ||
Ulong | encrypted_part_len, | ||
Byte * | part_ptr, | ||
Ulong * | part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DecryptUpdate continues a multiple-part decryption operation.
session | session's handle |
encrypted_part_ptr | encrypted data |
encrypted_part_len | input length |
part_ptr | gets plaintext |
part_len_ptr | p-text size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 370 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DecryptVerifyUpdate | ( | SessionHandle | session, |
Byte * | encrypted_part_ptr, | ||
Ulong | encrypted_part_len, | ||
Byte * | part_ptr, | ||
Ulong * | part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DecryptVerifyUpdate continues a multiple-part decryption and verify operation.
session | session's handle |
encrypted_part_ptr | ciphertext |
encrypted_part_len | ciphertext length |
part_ptr | gets plaintext |
part_len_ptr | gets p-text length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 560 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DeriveKey | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | base_key, | ||
Attribute * | attribute_template_ptr, | ||
Ulong | attribute_count, | ||
ObjectHandle * | key_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DeriveKey derives a key from a base key, creating a new key object.
session | session's handle |
mechanism_ptr | key deriv. mech. |
base_key | base key |
attribute_template_ptr | new key template |
attribute_count | template length |
key_ptr | gets new handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 635 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DestroyObject | ( | SessionHandle | session, |
ObjectHandle | object, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DestroyObject destroys an object.
session | the session's handle |
object | the object's handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 262 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Object::destroy().
bool Botan::PKCS11::LowLevel::C_Digest | ( | SessionHandle | session, |
Byte * | data_ptr, | ||
Ulong | data_len, | ||
Byte * | digest_ptr, | ||
Ulong * | digest_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_Digest digests data in a single part.
session | the session's handle |
data_ptr | data to be digested |
data_len | bytes of data to digest |
digest_ptr | gets the message digest |
digest_len_ptr | gets digest length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 394 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DigestEncryptUpdate | ( | SessionHandle | session, |
Byte * | part_ptr, | ||
Ulong | part_len, | ||
Byte * | encrypted_part_ptr, | ||
Ulong * | encrypted_part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DigestEncryptUpdate continues a multiple-part digesting and encryption operation.
session | session's handle |
part_ptr | the plaintext data |
part_len | plaintext length |
encrypted_part_ptr | gets ciphertext |
encrypted_part_len_ptr | gets c-text length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 527 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DigestFinal | ( | SessionHandle | session, |
Byte * | digest_ptr, | ||
Ulong * | digest_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DigestFinal finishes a multiple-part message-digesting operation.
session | the session's handle |
digest_ptr | gets the message digest |
digest_len_ptr | gets uint8_t count of digest |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 412 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DigestInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DigestInit initializes a message-digesting operation.
session | the session's handle |
mechanism_ptr | the digesting mechanism |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 390 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DigestKey | ( | SessionHandle | session, |
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DigestKey continues a multi-part message-digesting operation, by digesting the value of a secret key as part of the data already digested.
session | the session's handle |
key | secret key to digest |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 408 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_DigestUpdate | ( | SessionHandle | session, |
Byte * | part_ptr, | ||
Ulong | part_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_DigestUpdate continues a multiple-part message-digesting operation.
session | the session's handle |
part_ptr | data to be digested |
part_len | bytes of data to be digested |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 404 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_Encrypt | ( | SessionHandle | session, |
Byte * | data_ptr, | ||
Ulong | data_len, | ||
Byte * | encrypted_data, | ||
Ulong * | encrypted_data_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_Encrypt encrypts single-part data.
session | session's handle |
data_ptr | the plaintext data |
data_len | size of plaintext data in bytes |
encrypted_data | gets ciphertext |
encrypted_data_len_ptr | gets c-text size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 320 of file p11.cpp.
References handle_return_value().
|
inline |
C_Encrypt encrypts single-part data.
session | session's handle |
plaintext_data | the plaintext data |
encrypted_data | gets ciphertext |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1765 of file p11.h.
bool Botan::PKCS11::LowLevel::C_EncryptFinal | ( | SessionHandle | session, |
Byte * | last_encrypted_part_ptr, | ||
Ulong * | last_encrypted_part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_EncryptFinal finishes a multiple-part encryption operation.
session | session handle |
last_encrypted_part_ptr | last c-text |
last_encrypted_part_len_ptr | gets last size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 342 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_EncryptInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
C_EncryptInit initializes an encryption operation.
session | the session's handle |
mechanism_ptr | the encryption mechanism |
key | handle of encryption key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 313 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_EncryptUpdate | ( | SessionHandle | session, |
Byte * | part_ptr, | ||
Ulong | part_len, | ||
Byte * | encrypted_part_ptr, | ||
Ulong * | encrypted_part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_EncryptUpdate continues a multiple-part encryption operation.
session | session's handle |
part_ptr | the plaintext data |
part_len | plaintext data len |
encrypted_part_ptr | gets ciphertext |
encrypted_part_len_ptr | gets c-text size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 331 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_Finalize | ( | VoidPtr | reserved, |
ReturnValue * | return_value = ThrowException ) const |
C_Finalize indicates that an application is done with the Cryptoki library.
reserved | reserved. Should be nullptr |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 76 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_FindObjects | ( | SessionHandle | session, |
ObjectHandle * | object_ptr, | ||
Ulong | max_object_count, | ||
Ulong * | object_count_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_FindObjects continues a search for token and session objects that match a template, obtaining additional object handles.
session | session's handle |
object_ptr | gets obj. handles |
max_object_count | max handles to get |
object_count_ptr | actual # returned |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 298 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::ObjectFinder::find().
bool Botan::PKCS11::LowLevel::C_FindObjectsFinal | ( | SessionHandle | session, |
ReturnValue * | return_value = ThrowException ) const |
C_FindObjectsFinal finishes a search for token and session objects.
session | the session's handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 307 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::ObjectFinder::finish(), and Botan::PKCS11::ObjectFinder::~ObjectFinder().
bool Botan::PKCS11::LowLevel::C_FindObjectsInit | ( | SessionHandle | session, |
Attribute * | attribute_template_ptr, | ||
Ulong | count, | ||
ReturnValue * | return_value = ThrowException ) const |
C_FindObjectsInit initializes a search for token and session objects that match a template.
session | the session's handle |
attribute_template_ptr | attribute values to match |
count | attrs in search template |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 291 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::ObjectFinder::ObjectFinder().
bool Botan::PKCS11::LowLevel::C_GenerateKey | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
Attribute * | attribute_template_ptr, | ||
Ulong | count, | ||
ObjectHandle * | key_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GenerateKey generates a secret key, creating a new key object.
session | the session's handle |
mechanism_ptr | key generation mech. |
attribute_template_ptr | template for new key |
count | # of attrs in template |
key_ptr | gets handle of new key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 573 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GenerateKeyPair | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
Attribute * | public_key_template_ptr, | ||
Ulong | public_key_attribute_count, | ||
Attribute * | private_key_template_ptr, | ||
Ulong | private_key_attribute_count, | ||
ObjectHandle * | public_key_ptr, | ||
ObjectHandle * | private_key_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GenerateKeyPair generates a public-key/private-key pair, creating new key objects.
session | session handle |
mechanism_ptr | key-gen mech. |
public_key_template_ptr | template for pub. key |
public_key_attribute_count | # pub. attrs. |
private_key_template_ptr | template for priv. key |
private_key_attribute_count | # priv. attrs. |
public_key_ptr | gets pub. key handle |
private_key_ptr | gets priv. key handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 583 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GenerateRandom | ( | SessionHandle | session, |
Byte * | random_data_ptr, | ||
Ulong | random_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GenerateRandom generates random data.
session | the session's handle |
random_data_ptr | receives the random data |
random_len | # of bytes to generate |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 657 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetAttributeValue | ( | SessionHandle | session, |
ObjectHandle | object, | ||
Attribute * | attribute_template_ptr, | ||
Ulong | count, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetAttributeValue obtains the value of one or more object attributes.
session | the session's handle |
object | the object's handle |
attribute_template_ptr | specifies attrs; gets vals |
count | attributes in template |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 273 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Object::get_attribute_value().
|
inline |
C_GetAttributeValue obtains the value of one or more object attributes.
session | the session's handle |
object | the object's handle |
attribute_values | specifies attrs; gets vals |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1548 of file p11.h.
|
static |
C_GetFunctionList returns the function list.
pkcs11_module | The PKCS#11 module |
function_list_ptr_ptr | receives pointer to function list |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 84 of file p11.cpp.
References handle_return_value(), and Botan::Dynamically_Loaded_Library::resolve().
Referenced by Botan::PKCS11::Module::reload().
bool Botan::PKCS11::LowLevel::C_GetFunctionStatus | ( | SessionHandle | session, |
ReturnValue * | return_value = ThrowException ) const |
C_GetFunctionStatus is a legacy function; it obtains an updated status of a function running in parallel with an application.
session | the session's handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 666 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetInfo | ( | Info * | info_ptr, |
ReturnValue * | return_value = ThrowException ) const |
C_GetInfo returns general information about Cryptoki.
info_ptr | location that receives information |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 80 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetMechanismInfo | ( | SlotId | slot_id, |
MechanismType | type, | ||
MechanismInfo * | info_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetMechanismInfo obtains information about a particular mechanism possibly supported by a token.
slot_id | ID of the token's slot |
type | type of mechanism |
info_ptr | receives mechanism info |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 161 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetMechanismList | ( | SlotId | slot_id, |
MechanismType * | mechanism_list_ptr, | ||
Ulong * | count_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetMechanismList obtains a list of mechanism types supported by a token.
slot_id | ID of token's slot |
mechanism_list_ptr | gets mech. array |
count_ptr | gets # of mechs. |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 132 of file p11.cpp.
References handle_return_value().
Referenced by C_GetMechanismList().
bool Botan::PKCS11::LowLevel::C_GetMechanismList | ( | SlotId | slot_id, |
std::vector< MechanismType > & | mechanisms, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetMechanismList obtains a list of mechanism types supported by a token.
slot_id | ID of token's slot |
mechanisms | receives vector of supported mechanisms |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 141 of file p11.cpp.
References C_GetMechanismList().
bool Botan::PKCS11::LowLevel::C_GetObjectSize | ( | SessionHandle | session, |
ObjectHandle | object, | ||
Ulong * | size_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetObjectSize gets the size of an object in bytes.
session | the session's handle |
object | the object's handle |
size_ptr | receives size of object |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 266 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetOperationState | ( | SessionHandle | session, |
Byte * | operation_state_ptr, | ||
Ulong * | operation_state_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetOperationState obtains the state of the cryptographic operation in a session.
session | session's handle |
operation_state_ptr | gets state |
operation_state_len_ptr | gets state length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 212 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetSessionInfo | ( | SessionHandle | session, |
SessionInfo * | info_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetSessionInfo obtains information about the session.
session | the session's handle |
info_ptr | receives session info |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 208 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Session::get_info().
bool Botan::PKCS11::LowLevel::C_GetSlotInfo | ( | SlotId | slot_id, |
SlotInfo * | info_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetSlotInfo obtains information about a particular slot in the system.
slot_id | the ID of the slot |
info_ptr | receives the slot information |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 120 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_GetSlotList | ( | Bbool | token_present, |
SlotId * | slot_list_ptr, | ||
Ulong * | count_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetSlotList obtains a list of slots in the system.
token_present | only slots with tokens |
slot_list_ptr | receives array of slot IDs |
count_ptr | receives number of slots |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 96 of file p11.cpp.
References handle_return_value().
Referenced by C_GetSlotList().
bool Botan::PKCS11::LowLevel::C_GetSlotList | ( | bool | token_present, |
std::vector< SlotId > & | slot_ids, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetSlotList obtains a list of slots in the system.
token_present | only slots with tokens |
slot_ids | receives vector of slot IDs |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 103 of file p11.cpp.
References C_GetSlotList().
bool Botan::PKCS11::LowLevel::C_GetTokenInfo | ( | SlotId | slot_id, |
TokenInfo * | info_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_GetTokenInfo obtains information about a particular token in the system.
slot_id | ID of the token's slot |
info_ptr | receives the token information |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 124 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_Initialize | ( | VoidPtr | init_args, |
ReturnValue * | return_value = ThrowException ) const |
C_Initialize initializes the Cryptoki library.
init_args | if this is not nullptr, it gets cast to (C_InitializeArgs ) and dereferenced |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 72 of file p11.cpp.
References handle_return_value().
|
inline |
C_InitPIN initializes the normal user's PIN.
session | the session's handle |
pin | the normal user's PIN |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1173 of file p11.h.
bool Botan::PKCS11::LowLevel::C_InitPIN | ( | SessionHandle | session, |
Utf8Char * | pin_ptr, | ||
Ulong | pin_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_InitPIN initializes the normal user's PIN.
session | the session's handle |
pin_ptr | the normal user's PIN |
pin_len | length in bytes of the PIN |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 174 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Session::init_pin().
|
inline |
C_InitToken initializes a token.
slot_id | ID of the token's slot |
so_pin | the SO's initial PIN |
label | token label (at max 32 bytes long) |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1120 of file p11.h.
bool Botan::PKCS11::LowLevel::C_InitToken | ( | SlotId | slot_id, |
Utf8Char * | so_pin_ptr, | ||
Ulong | so_pin_len, | ||
Utf8Char * | label_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_InitToken initializes a token.
slot_id | ID of the token's slot |
so_pin_ptr | the SO's initial PIN |
so_pin_len | length in bytes of the SO_PIN |
label_ptr | 32-byte token label (blank padded) |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 169 of file p11.cpp.
References handle_return_value().
|
inline |
C_Login logs a user into a token.
session | the session's handle |
user_type | the user type |
pin | the user or security officer's PIN |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1394 of file p11.h.
bool Botan::PKCS11::LowLevel::C_Login | ( | SessionHandle | session, |
UserType | user_type, | ||
Utf8Char * | pin_ptr, | ||
Ulong | pin_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_Login logs a user into a token.
session | the session's handle |
user_type | the user type |
pin_ptr | the user's PIN |
pin_len | the length of the PIN |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 231 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Session::login().
bool Botan::PKCS11::LowLevel::C_Logout | ( | SessionHandle | session, |
ReturnValue * | return_value = ThrowException ) const |
C_Logout logs a user out from a token.
session | the session's handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 237 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Session::logoff(), and Botan::PKCS11::Session::~Session().
bool Botan::PKCS11::LowLevel::C_OpenSession | ( | SlotId | slot_id, |
Flags | flags, | ||
VoidPtr | application, | ||
Notify | notify, | ||
SessionHandle * | session_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_OpenSession opens a session between an application and a token.
slot_id | the slot's ID |
flags | from CK_SESSION_INFO |
application | passed to callback |
notify | callback function |
session_ptr | gets session handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 190 of file p11.cpp.
References Botan::PKCS11::flags(), and handle_return_value().
Referenced by Botan::PKCS11::Session::Session().
bool Botan::PKCS11::LowLevel::C_SeedRandom | ( | SessionHandle | session, |
const Byte * | seed_ptr, | ||
Ulong | seed_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SeedRandom mixes additional seed material into the token's random number generator.
session | the session's handle |
seed_ptr | the seed material |
seed_len | length of seed material |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 649 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_SetAttributeValue | ( | SessionHandle | session, |
ObjectHandle | object, | ||
Attribute * | attribute_template_ptr, | ||
Ulong | count, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SetAttributeValue modifies the value of one or more object attributes.
session | the session's handle |
object | the object's handle |
attribute_template_ptr | specifies attrs and values |
count | attributes in template |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 282 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Object::set_attribute_value().
|
inline |
C_SetAttributeValue modifies the value of one or more object attributes.
session | the session's handle |
object | the object's handle |
attribute_values | specifies attrs and values |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1625 of file p11.h.
bool Botan::PKCS11::LowLevel::C_SetOperationState | ( | SessionHandle | session, |
Byte * | operation_state_ptr, | ||
Ulong | operation_state_len, | ||
ObjectHandle | encryption_key, | ||
ObjectHandle | authentication_key, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SetOperationState restores the state of the cryptographic operation in a session.
session | session's handle |
operation_state_ptr | holds state |
operation_state_len | holds state length |
encryption_key | en/decryption key |
authentication_key | sign/verify key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 220 of file p11.cpp.
References handle_return_value().
|
inline |
C_SetPIN modifies the PIN of the user who is logged in.
session | the session's handle |
old_pin | the old PIN |
new_pin | the new PIN |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 1224 of file p11.h.
bool Botan::PKCS11::LowLevel::C_SetPIN | ( | SessionHandle | session, |
Utf8Char * | old_pin_ptr, | ||
Ulong | old_len, | ||
Utf8Char * | new_pin_ptr, | ||
Ulong | new_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SetPIN modifies the PIN of the user who is logged in.
session | the session's handle |
old_pin_ptr | the old PIN |
old_len | length of the old PIN |
new_pin_ptr | the new PIN |
new_len | length of the new PIN |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 178 of file p11.cpp.
References handle_return_value().
Referenced by Botan::PKCS11::Session::set_pin().
bool Botan::PKCS11::LowLevel::C_Sign | ( | SessionHandle | session, |
const Byte * | data_ptr, | ||
Ulong | data_len, | ||
Byte * | signature_ptr, | ||
Ulong * | signature_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
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.
session | the session's handle |
data_ptr | the data to sign |
data_len | count of bytes to sign |
signature_ptr | gets the signature |
signature_len_ptr | gets signature length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 428 of file p11.cpp.
References handle_return_value().
|
inline |
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.
session | the session's handle |
data | the data to sign |
signature | gets the signature |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 2142 of file p11.h.
bool Botan::PKCS11::LowLevel::C_SignEncryptUpdate | ( | SessionHandle | session, |
Byte * | part_ptr, | ||
Ulong | part_len, | ||
Byte * | encrypted_part_ptr, | ||
Ulong * | encrypted_part_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SignEncryptUpdate continues a multiple-part signing and encryption operation.
session | session's handle |
part_ptr | the plaintext data |
part_len | plaintext length |
encrypted_part_ptr | gets ciphertext |
encrypted_part_len_ptr | gets c-text length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 549 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_SignFinal | ( | SessionHandle | session, |
Byte * | signature_ptr, | ||
Ulong * | signature_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SignFinal finishes a multiple-part signature operation, returning the signature.
session | the session's handle |
signature_ptr | gets the signature |
signature_len_ptr | gets signature length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 447 of file p11.cpp.
References handle_return_value().
|
inline |
C_SignFinal finishes a multiple-part signature operation, returning the signature.
session | the session's handle |
signature | gets the signature |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 2242 of file p11.h.
bool Botan::PKCS11::LowLevel::C_SignInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
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.
session | the session's handle |
mechanism_ptr | the signature mechanism |
key | handle of signature key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 421 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_SignRecover | ( | SessionHandle | session, |
Byte * | data_ptr, | ||
Ulong | data_len, | ||
Byte * | signature_ptr, | ||
Ulong * | signature_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SignRecover signs data in a single operation, where the data can be recovered from the signature.
session | the session's handle |
data_ptr | the data to sign |
data_len | count of bytes to sign |
signature_ptr | gets the signature |
signature_len_ptr | gets signature length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 461 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_SignRecoverInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
C_SignRecoverInit initializes a signature operation, where the data can be recovered from the signature.
session | the session's handle |
mechanism_ptr | the signature mechanism |
key | handle of the signature key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 454 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_SignUpdate | ( | SessionHandle | session, |
const Byte * | part_ptr, | ||
Ulong | part_len, | ||
ReturnValue * | return_value = ThrowException ) const |
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.
session | the session's handle |
part_ptr | the data to sign |
part_len | count of bytes to sign |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 439 of file p11.cpp.
References handle_return_value().
|
inline |
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.
session | the session's handle |
part | the data to sign |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 2199 of file p11.h.
bool Botan::PKCS11::LowLevel::C_UnwrapKey | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | unwrapping_key, | ||
Byte * | wrapped_key_ptr, | ||
Ulong | wrapped_key_len, | ||
Attribute * | attribute_template_ptr, | ||
Ulong | attribute_count, | ||
ObjectHandle * | key_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new key object.
session | session's handle |
mechanism_ptr | unwrapping mech. |
unwrapping_key | unwrapping key |
wrapped_key_ptr | the wrapped key |
wrapped_key_len | wrapped key len |
attribute_template_ptr | new key template |
attribute_count | template length |
key_ptr | gets new handle |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 615 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_Verify | ( | SessionHandle | session, |
const Byte * | data_ptr, | ||
Ulong | data_len, | ||
const Byte * | signature_ptr, | ||
Ulong | signature_len, | ||
ReturnValue * | return_value = ThrowException ) const |
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.
session | the session's handle |
data_ptr | signed data |
data_len | length of signed data |
signature_ptr | signature |
signature_len | signature length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 480 of file p11.cpp.
References handle_return_value().
|
inline |
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.
session | the session's handle |
data | signed data |
signature | signature |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 2371 of file p11.h.
bool Botan::PKCS11::LowLevel::C_VerifyFinal | ( | SessionHandle | session, |
const Byte * | signature_ptr, | ||
Ulong | signature_len, | ||
ReturnValue * | return_value = ThrowException ) const |
C_VerifyFinal finishes a multiple-part verification operation, checking the signature.
session | the session's handle |
signature_ptr | signature to verify |
signature_len | signature length |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 500 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_VerifyInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
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).
session | the session's handle |
mechanism_ptr | the verification mechanism |
key | verification key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 473 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_VerifyRecover | ( | SessionHandle | session, |
Byte * | signature_ptr, | ||
Ulong | signature_len, | ||
Byte * | data_ptr, | ||
Ulong * | data_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_VerifyRecover verifies a signature in a single-part operation, where the data is recovered from the signature.
session | the session's handle |
signature_ptr | signature to verify |
signature_len | signature length |
data_ptr | gets signed data |
data_len_ptr | gets signed data len |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 515 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_VerifyRecoverInit | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | key, | ||
ReturnValue * | return_value = ThrowException ) const |
C_VerifyRecoverInit initializes a signature verification operation, where the data is recovered from the signature.
session | the session's handle |
mechanism_ptr | the verification mechanism |
key | verification key |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 508 of file p11.cpp.
References handle_return_value().
bool Botan::PKCS11::LowLevel::C_VerifyUpdate | ( | SessionHandle | session, |
const Byte * | part_ptr, | ||
Ulong | part_len, | ||
ReturnValue * | return_value = ThrowException ) const |
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.
session | the session's handle |
part_ptr | signed data |
part_len | length of signed data |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 492 of file p11.cpp.
References handle_return_value().
|
inline |
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.
session | the session's handle |
part | signed data |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 2418 of file p11.h.
bool Botan::PKCS11::LowLevel::C_WaitForSlotEvent | ( | Flags | flags, |
SlotId * | slot_ptr, | ||
VoidPtr | reserved, | ||
ReturnValue * | return_value = ThrowException ) const |
C_WaitForSlotEvent waits for a slot event (token insertion, removal, etc.) to occur.
flags | blocking/nonblocking flag |
slot_ptr | location that receives the slot ID |
reserved | reserved. Should be NULL_PTR |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 128 of file p11.cpp.
References Botan::PKCS11::flags(), and handle_return_value().
bool Botan::PKCS11::LowLevel::C_WrapKey | ( | SessionHandle | session, |
Mechanism * | mechanism_ptr, | ||
ObjectHandle | wrapping_key, | ||
ObjectHandle | key, | ||
Byte * | wrapped_key_ptr, | ||
Ulong * | wrapped_key_len_ptr, | ||
ReturnValue * | return_value = ThrowException ) const |
C_WrapKey wraps (i.e., encrypts) a key.
session | the session's handle |
mechanism_ptr | the wrapping mechanism |
wrapping_key | wrapping key |
key | key to be wrapped |
wrapped_key_ptr | gets wrapped key |
wrapped_key_len_ptr | gets wrapped key size |
return_value | default value (ThrowException ): throw exception on error. if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. At least the following PKCS#11 return values may be returned:
|
Definition at line 603 of file p11.cpp.
References handle_return_value().
|
inline |
|
staticprotected |
A helper for error handling. This is exposed as a protected member so that it is possible for an application to inherit from LowLevel in order to implement wrappers for vendor specific extensions using the same error handling mechanisms as the rest of the library.
function_result | Return value of the PKCS11 module function |
return_value | if (ThrowException ) is passed the function throws an exception, otherwise if a non-NULL pointer is passed: return_value receives the return value of the PKCS#11 function and no exception is thrown. |
Definition at line 27 of file p11.cpp.
References Botan::PKCS11::OK, and Botan::PKCS11::ThrowException.
Referenced by C_CancelFunction(), C_CloseAllSessions(), C_CloseSession(), C_CopyObject(), C_CreateObject(), C_Decrypt(), C_DecryptDigestUpdate(), C_DecryptFinal(), C_DecryptInit(), C_DecryptUpdate(), C_DecryptVerifyUpdate(), C_DeriveKey(), C_DestroyObject(), C_Digest(), C_DigestEncryptUpdate(), C_DigestFinal(), C_DigestInit(), C_DigestKey(), C_DigestUpdate(), C_Encrypt(), C_EncryptFinal(), C_EncryptInit(), C_EncryptUpdate(), C_Finalize(), C_FindObjects(), C_FindObjectsFinal(), C_FindObjectsInit(), C_GenerateKey(), C_GenerateKeyPair(), C_GenerateRandom(), C_GetAttributeValue(), C_GetFunctionList(), C_GetFunctionStatus(), C_GetInfo(), C_GetMechanismInfo(), C_GetMechanismList(), C_GetObjectSize(), C_GetOperationState(), C_GetSessionInfo(), C_GetSlotInfo(), C_GetSlotList(), C_GetTokenInfo(), C_Initialize(), C_InitPIN(), C_InitToken(), C_Login(), C_Logout(), C_OpenSession(), C_SeedRandom(), C_SetAttributeValue(), C_SetOperationState(), C_SetPIN(), C_Sign(), C_SignEncryptUpdate(), C_SignFinal(), C_SignInit(), C_SignRecover(), C_SignRecoverInit(), C_SignUpdate(), C_UnwrapKey(), C_Verify(), C_VerifyFinal(), C_VerifyInit(), C_VerifyRecover(), C_VerifyRecoverInit(), C_VerifyUpdate(), C_WaitForSlotEvent(), and C_WrapKey().