C# Class Net.Pkcs11Interop.LowLevelAPI81.Pkcs11

Low level PKCS#11 wrapper
Inheritance: IDisposable
Afficher le fichier Open project: Pkcs11Interop/Pkcs11Interop Class Usage Examples

Méthodes publiques

Méthode Description
C_CancelFunction ( ulong session ) : CKR

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL

C_CloseAllSessions ( ulong slotId ) : CKR

Closes all sessions an application has with a token

C_CloseSession ( ulong session ) : CKR

Closes a session between an application and a token

C_CopyObject ( ulong session, ulong objectId, CK_ATTRIBUTE template, ulong count, ulong &newObjectId ) : CKR

Copies an object, creating a new object for the copy

C_CreateObject ( ulong session, CK_ATTRIBUTE template, ulong count, ulong &objectId ) : CKR

Creates a new object

C_Decrypt ( ulong session, byte encryptedData, ulong encryptedDataLen, byte data, ulong &dataLen ) : CKR

Decrypts encrypted data in a single part

C_DecryptDigestUpdate ( ulong session, byte encryptedPart, ulong encryptedPartLen, byte part, ulong &partLen ) : CKR

Continues a multi-part combined decryption and digest operation, processing another data part

C_DecryptFinal ( ulong session, byte lastPart, ulong &lastPartLen ) : CKR

Finishes a multi-part decryption operation

C_DecryptInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR

Initializes a decryption operation

C_DecryptUpdate ( ulong session, byte encryptedPart, ulong encryptedPartLen, byte part, ulong &partLen ) : CKR

Continues a multi-part decryption operation, processing another encrypted data part

C_DecryptVerifyUpdate ( ulong session, byte encryptedPart, ulong encryptedPartLen, byte part, ulong &partLen ) : CKR

Continues a multi-part combined decryption and verification operation, processing another data part

C_DeriveKey ( ulong session, CK_MECHANISM &mechanism, ulong baseKey, CK_ATTRIBUTE template, ulong attributeCount, ulong &key ) : CKR

Derives a key from a base key, creating a new key object

C_DestroyObject ( ulong session, ulong objectId ) : CKR

Destroys an object

C_Digest ( ulong session, byte data, ulong dataLen, byte digest, ulong &digestLen ) : CKR

Digests data in a single part

C_DigestEncryptUpdate ( ulong session, byte part, ulong partLen, byte encryptedPart, ulong &encryptedPartLen ) : CKR

Continues multi-part digest and encryption operations, processing another data part

C_DigestFinal ( ulong session, byte digest, ulong &digestLen ) : CKR

Finishes a multi-part message-digesting operation, returning the message digest

C_DigestInit ( ulong session, CK_MECHANISM &mechanism ) : CKR

Initializes a message-digesting operation

C_DigestKey ( ulong session, ulong key ) : CKR

Continues a multi-part message-digesting operation by digesting the value of a secret key

C_DigestUpdate ( ulong session, byte part, ulong partLen ) : CKR

Continues a multi-part message-digesting operation, processing another data part

C_Encrypt ( ulong session, byte data, ulong dataLen, byte encryptedData, ulong &encryptedDataLen ) : CKR

Encrypts single-part data

C_EncryptFinal ( ulong session, byte lastEncryptedPart, ulong &lastEncryptedPartLen ) : CKR

Finishes a multi-part encryption operation

C_EncryptInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR

Initializes an encryption operation

C_EncryptUpdate ( ulong session, byte part, ulong partLen, byte encryptedPart, ulong &encryptedPartLen ) : CKR

Continues a multi-part encryption operation, processing another data part

C_Finalize ( IntPtr reserved ) : CKR

Called to indicate that an application is finished with the Cryptoki library. It should be the last Cryptoki call made by an application.

C_FindObjects ( ulong session, ulong objectId, ulong maxObjectCount, ulong &objectCount ) : CKR

Continues a search for token and session objects that match a template, obtaining additional object handles

C_FindObjectsFinal ( ulong session ) : CKR

Terminates a search for token and session objects

C_FindObjectsInit ( ulong session, CK_ATTRIBUTE template, ulong count ) : CKR

Initializes a search for token and session objects that match a template

C_GenerateKey ( ulong session, CK_MECHANISM &mechanism, CK_ATTRIBUTE template, ulong count, ulong &key ) : CKR

Generates a secret key or set of domain parameters, creating a new object

C_GenerateKeyPair ( ulong session, CK_MECHANISM &mechanism, CK_ATTRIBUTE publicKeyTemplate, ulong publicKeyAttributeCount, CK_ATTRIBUTE privateKeyTemplate, ulong privateKeyAttributeCount, ulong &publicKey, ulong &privateKey ) : CKR

Generates a public/private key pair, creating new key objects

C_GenerateRandom ( ulong session, byte randomData, ulong randomLen ) : CKR

Generates random or pseudo-random data

C_GetAttributeValue ( ulong session, ulong objectId, CK_ATTRIBUTE template, ulong count ) : CKR

Obtains the value of one or more attributes of an object

C_GetFunctionList ( IntPtr &functionList ) : CKR

Returns a pointer to the Cryptoki library's list of function pointers

C_GetFunctionStatus ( ulong session ) : CKR

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL

C_GetInfo ( CK_INFO &info ) : CKR

Returns general information about Cryptoki

C_GetMechanismInfo ( ulong slotId, CKM type, CK_MECHANISM_INFO &info ) : CKR

Obtains information about a particular mechanism possibly supported by a token

C_GetMechanismList ( ulong slotId, CKM mechanismList, ulong &count ) : CKR

Obtains a list of mechanism types supported by a token

C_GetObjectSize ( ulong session, ulong objectId, ulong &size ) : CKR

Gets the size of an object in bytes

C_GetOperationState ( ulong session, byte operationState, ulong &operationStateLen ) : CKR

Obtains a copy of the cryptographic operations state of a session encoded as byte array

C_GetSessionInfo ( ulong session, CK_SESSION_INFO &info ) : CKR

Obtains information about a session

C_GetSlotInfo ( ulong slotId, CK_SLOT_INFO &info ) : CKR

Obtains information about a particular slot in the system

C_GetSlotList ( bool tokenPresent, ulong slotList, ulong &count ) : CKR

Obtains a list of slots in the system

C_GetTokenInfo ( ulong slotId, CK_TOKEN_INFO &info ) : CKR

Obtains information about a particular token in the system

C_InitPIN ( ulong session, byte pin, ulong pinLen ) : CKR

Initializes the normal user's PIN

C_InitToken ( ulong slotId, byte pin, ulong pinLen, byte label ) : CKR

Initializes a token

C_Initialize ( CK_C_INITIALIZE_ARGS initArgs ) : CKR

Initializes the Cryptoki library

C_Login ( ulong session, CKU userType, byte pin, ulong pinLen ) : CKR

Logs a user into a token

C_Logout ( ulong session ) : CKR

Logs a user out from a token

C_OpenSession ( ulong slotId, ulong flags, IntPtr application, IntPtr notify, ulong &session ) : CKR

Opens a session between an application and a token in a particular slot

C_SeedRandom ( ulong session, byte seed, ulong seedLen ) : CKR

Mixes additional seed material into the token's random number generator

C_SetAttributeValue ( ulong session, ulong objectId, CK_ATTRIBUTE template, ulong count ) : CKR

Modifies the value of one or more attributes of an object

C_SetOperationState ( ulong session, byte operationState, ulong operationStateLen, ulong encryptionKey, ulong authenticationKey ) : CKR

Restores the cryptographic operations state of a session from bytes obtained with C_GetOperationState

C_SetPIN ( ulong session, byte oldPin, ulong oldPinLen, byte newPin, ulong newPinLen ) : CKR

Modifies the PIN of the user that is currently logged in, or the CKU_USER PIN if the session is not logged in

C_Sign ( ulong session, byte data, ulong dataLen, byte signature, ulong &signatureLen ) : CKR

Signs data in a single part, where the signature is an appendix to the data

C_SignEncryptUpdate ( ulong session, byte part, ulong partLen, byte encryptedPart, ulong &encryptedPartLen ) : CKR

Continues a multi-part combined signature and encryption operation, processing another data part

C_SignFinal ( ulong session, byte signature, ulong &signatureLen ) : CKR

Finishes a multi-part signature operation, returning the signature

C_SignInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR

Initializes a signature operation, where the signature is an appendix to the data

C_SignRecover ( ulong session, byte data, ulong dataLen, byte signature, ulong &signatureLen ) : CKR

Signs data in a single operation, where the data can be recovered from the signature

C_SignRecoverInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR

Initializes a signature operation, where the data can be recovered from the signature

C_SignUpdate ( ulong session, byte part, ulong partLen ) : CKR

Continues a multi-part signature operation, processing another data part

C_UnwrapKey ( ulong session, CK_MECHANISM &mechanism, ulong unwrappingKey, byte wrappedKey, ulong wrappedKeyLen, CK_ATTRIBUTE template, ulong attributeCount, ulong &key ) : CKR

Unwraps (i.e. decrypts) a wrapped key, creating a new private key or secret key object

C_Verify ( ulong session, byte data, ulong dataLen, byte signature, ulong signatureLen ) : CKR

Verifies a signature in a single-part operation, where the signature is an appendix to the data

C_VerifyFinal ( ulong session, byte signature, ulong signatureLen ) : CKR

Finishes a multi-part verification operation, checking the signature

C_VerifyInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR

Initializes a verification operation, where the signature is an appendix to the data

C_VerifyRecover ( ulong session, byte signature, ulong signatureLen, byte data, ulong &dataLen ) : CKR

Verifies a signature in a single-part operation, where the data is recovered from the signature

C_VerifyRecoverInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR

Initializes a signature verification operation, where the data is recovered from the signature

C_VerifyUpdate ( ulong session, byte part, ulong partLen ) : CKR

Continues a multi-part verification operation, processing another data part

C_WaitForSlotEvent ( ulong flags, ulong &slot, IntPtr reserved ) : CKR

Waits for a slot event, such as token insertion or token removal, to occur

C_WrapKey ( ulong session, CK_MECHANISM &mechanism, ulong wrappingKey, ulong key, byte wrappedKey, ulong &wrappedKeyLen ) : CKR

Wraps (i.e., encrypts) a private or secret key

Dispose ( ) : void

Disposes object

Pkcs11 ( string libraryPath ) : System

Loads PCKS#11 library

Pkcs11 ( string libraryPath, bool useGetFunctionList ) : System

Loads PCKS#11 library

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Disposes object

Private Methods

Méthode Description
Release ( ) : void

Unloads PKCS#11 library. Called automaticaly when object is being disposed.

Method Details

C_CancelFunction() public méthode

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL
public C_CancelFunction ( ulong session ) : CKR
session ulong The session's handle
Résultat CKR

C_CloseAllSessions() public méthode

Closes all sessions an application has with a token
public C_CloseAllSessions ( ulong slotId ) : CKR
slotId ulong The ID of the token's slot
Résultat CKR

C_CloseSession() public méthode

Closes a session between an application and a token
public C_CloseSession ( ulong session ) : CKR
session ulong The session's handle
Résultat CKR

C_CopyObject() public méthode

Copies an object, creating a new object for the copy
public C_CopyObject ( ulong session, ulong objectId, CK_ATTRIBUTE template, ulong count, ulong &newObjectId ) : CKR
session ulong The session's handle
objectId ulong The object's handle
template CK_ATTRIBUTE Template for the new object
count ulong The number of attributes in the template
newObjectId ulong Location that receives the handle for the copy of the object
Résultat CKR

C_CreateObject() public méthode

Creates a new object
public C_CreateObject ( ulong session, CK_ATTRIBUTE template, ulong count, ulong &objectId ) : CKR
session ulong The session's handle
template CK_ATTRIBUTE Object's template
count ulong The number of attributes in the template
objectId ulong Location that receives the new object's handle
Résultat CKR

C_Decrypt() public méthode

Decrypts encrypted data in a single part
public C_Decrypt ( ulong session, byte encryptedData, ulong encryptedDataLen, byte data, ulong &dataLen ) : CKR
session ulong The session's handle
encryptedData byte Encrypted data
encryptedDataLen ulong The length of the encrypted data
data byte /// If set to null then the length of decrypted data is returned in "dataLen" parameter, without actually returning decrypted data. /// If not set to null then "dataLen" parameter must contain the lenght of data array and decrypted data is returned in "data" parameter. ///
dataLen ulong Location that holds the length of the decrypted data
Résultat CKR

C_DecryptDigestUpdate() public méthode

Continues a multi-part combined decryption and digest operation, processing another data part
public C_DecryptDigestUpdate ( ulong session, byte encryptedPart, ulong encryptedPartLen, byte part, ulong &partLen ) : CKR
session ulong The session's handle
encryptedPart byte Encrypted data part
encryptedPartLen ulong Length of the encrypted data part
part byte /// If set to null then the length of decrypted data part is returned in "partLen" parameter, without actually returning decrypted data part. /// If not set to null then "partLen" parameter must contain the lenght of part array and decrypted data part is returned in "part" parameter. ///
partLen ulong Location that holds the length of the decrypted data part
Résultat CKR

C_DecryptFinal() public méthode

Finishes a multi-part decryption operation
public C_DecryptFinal ( ulong session, byte lastPart, ulong &lastPartLen ) : CKR
session ulong The session's handle
lastPart byte /// If set to null then the length of last decrypted data part is returned in "lastPartLen" parameter, without actually returning last decrypted data part. /// If not set to null then "lastPartLen" parameter must contain the lenght of lastPart array and last decrypted data part is returned in "lastPart" parameter. ///
lastPartLen ulong Location that holds the length of the last decrypted data part
Résultat CKR

C_DecryptInit() public méthode

Initializes a decryption operation
public C_DecryptInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM The decryption mechanism
key ulong The handle of the decryption key
Résultat CKR

C_DecryptUpdate() public méthode

Continues a multi-part decryption operation, processing another encrypted data part
public C_DecryptUpdate ( ulong session, byte encryptedPart, ulong encryptedPartLen, byte part, ulong &partLen ) : CKR
session ulong The session's handle
encryptedPart byte Encrypted data part
encryptedPartLen ulong Length of the encrypted data part
part byte /// If set to null then the length of decrypted data part is returned in "partLen" parameter, without actually returning decrypted data part. /// If not set to null then "partLen" parameter must contain the lenght of part array and decrypted data part is returned in "part" parameter. ///
partLen ulong Location that holds the length of the decrypted data part
Résultat CKR

C_DecryptVerifyUpdate() public méthode

Continues a multi-part combined decryption and verification operation, processing another data part
public C_DecryptVerifyUpdate ( ulong session, byte encryptedPart, ulong encryptedPartLen, byte part, ulong &partLen ) : CKR
session ulong The session's handle
encryptedPart byte Encrypted data part
encryptedPartLen ulong Length of the encrypted data part
part byte /// If set to null then the length of decrypted data part is returned in "partLen" parameter, without actually returning decrypted data part. /// If not set to null then "partLen" parameter must contain the lenght of part array and decrypted data part is returned in "part" parameter. ///
partLen ulong Location that holds the length of the decrypted data part
Résultat CKR

C_DeriveKey() public méthode

Derives a key from a base key, creating a new key object
public C_DeriveKey ( ulong session, CK_MECHANISM &mechanism, ulong baseKey, CK_ATTRIBUTE template, ulong attributeCount, ulong &key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Key derivation mechanism
baseKey ulong The handle of the base key
template CK_ATTRIBUTE The template for the new key
attributeCount ulong The number of attributes in the template
key ulong Location that receives the handle of the derived key
Résultat CKR

C_DestroyObject() public méthode

Destroys an object
public C_DestroyObject ( ulong session, ulong objectId ) : CKR
session ulong The session's handle
objectId ulong The object's handle
Résultat CKR

C_Digest() public méthode

Digests data in a single part
public C_Digest ( ulong session, byte data, ulong dataLen, byte digest, ulong &digestLen ) : CKR
session ulong The session's handle
data byte Data to be digested
dataLen ulong The length of the data to be digested
digest byte /// If set to null then the length of digest is returned in "digestLen" parameter, without actually returning digest. /// If not set to null then "digestLen" parameter must contain the lenght of digest array and digest is returned in "digest" parameter. ///
digestLen ulong Location that holds the length of the message digest
Résultat CKR

C_DigestEncryptUpdate() public méthode

Continues multi-part digest and encryption operations, processing another data part
public C_DigestEncryptUpdate ( ulong session, byte part, ulong partLen, byte encryptedPart, ulong &encryptedPartLen ) : CKR
session ulong The session's handle
part byte The data part to be digested and encrypted
partLen ulong Length of data part in bytes
encryptedPart byte /// If set to null then the length of encrypted data part is returned in "encryptedPartLen" parameter, without actually returning encrypted data part. /// If not set to null then "encryptedPartLen" parameter must contain the lenght of encryptedPart array and encrypted data part is returned in "encryptedPart" parameter. ///
encryptedPartLen ulong Location that holds the length in bytes of the encrypted data part
Résultat CKR

C_DigestFinal() public méthode

Finishes a multi-part message-digesting operation, returning the message digest
public C_DigestFinal ( ulong session, byte digest, ulong &digestLen ) : CKR
session ulong The session's handle
digest byte /// If set to null then the length of digest is returned in "digestLen" parameter, without actually returning digest. /// If not set to null then "digestLen" parameter must contain the lenght of digest array and digest is returned in "digest" parameter. ///
digestLen ulong Location that holds the length of the message digest
Résultat CKR

C_DigestInit() public méthode

Initializes a message-digesting operation
public C_DigestInit ( ulong session, CK_MECHANISM &mechanism ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM The digesting mechanism
Résultat CKR

C_DigestKey() public méthode

Continues a multi-part message-digesting operation by digesting the value of a secret key
public C_DigestKey ( ulong session, ulong key ) : CKR
session ulong The session's handle
key ulong The handle of the secret key to be digested
Résultat CKR

C_DigestUpdate() public méthode

Continues a multi-part message-digesting operation, processing another data part
public C_DigestUpdate ( ulong session, byte part, ulong partLen ) : CKR
session ulong The session's handle
part byte Data part
partLen ulong The length of the data part
Résultat CKR

C_Encrypt() public méthode

Encrypts single-part data
public C_Encrypt ( ulong session, byte data, ulong dataLen, byte encryptedData, ulong &encryptedDataLen ) : CKR
session ulong The session's handle
data byte Data to be encrypted
dataLen ulong Length of data in bytes
encryptedData byte /// If set to null then the length of encrypted data is returned in "encryptedDataLen" parameter, without actually returning encrypted data. /// If not set to null then "encryptedDataLen" parameter must contain the lenght of encryptedData array and encrypted data is returned in "encryptedData" parameter. ///
encryptedDataLen ulong Location that holds the length in bytes of the encrypted data
Résultat CKR

C_EncryptFinal() public méthode

Finishes a multi-part encryption operation
public C_EncryptFinal ( ulong session, byte lastEncryptedPart, ulong &lastEncryptedPartLen ) : CKR
session ulong The session's handle
lastEncryptedPart byte /// If set to null then the length of last encrypted data part is returned in "lastEncryptedPartLen" parameter, without actually returning last encrypted data part. /// If not set to null then "lastEncryptedPartLen" parameter must contain the lenght of lastEncryptedPart array and last encrypted data part is returned in "lastEncryptedPart" parameter. ///
lastEncryptedPartLen ulong Location that holds the length of the last encrypted data part
Résultat CKR

C_EncryptInit() public méthode

Initializes an encryption operation
public C_EncryptInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM The encryption mechanism
key ulong The handle of the encryption key
Résultat CKR

C_EncryptUpdate() public méthode

Continues a multi-part encryption operation, processing another data part
public C_EncryptUpdate ( ulong session, byte part, ulong partLen, byte encryptedPart, ulong &encryptedPartLen ) : CKR
session ulong The session's handle
part byte The data part to be encrypted
partLen ulong Length of data part in bytes
encryptedPart byte /// If set to null then the length of encrypted data part is returned in "encryptedPartLen" parameter, without actually returning encrypted data part. /// If not set to null then "encryptedPartLen" parameter must contain the lenght of encryptedPart array and encrypted data part is returned in "encryptedPart" parameter. ///
encryptedPartLen ulong Location that holds the length in bytes of the encrypted data part
Résultat CKR

C_Finalize() public méthode

Called to indicate that an application is finished with the Cryptoki library. It should be the last Cryptoki call made by an application.
public C_Finalize ( IntPtr reserved ) : CKR
reserved System.IntPtr Reserved for future versions. For this version, it should be set to null.
Résultat CKR

C_FindObjects() public méthode

Continues a search for token and session objects that match a template, obtaining additional object handles
public C_FindObjects ( ulong session, ulong objectId, ulong maxObjectCount, ulong &objectCount ) : CKR
session ulong The session's handle
objectId ulong Location that receives the list (array) of additional object handles
maxObjectCount ulong The maximum number of object handles to be returned
objectCount ulong Location that receives the actual number of object handles returned
Résultat CKR

C_FindObjectsFinal() public méthode

Terminates a search for token and session objects
public C_FindObjectsFinal ( ulong session ) : CKR
session ulong The session's handle
Résultat CKR

C_FindObjectsInit() public méthode

Initializes a search for token and session objects that match a template
public C_FindObjectsInit ( ulong session, CK_ATTRIBUTE template, ulong count ) : CKR
session ulong The session's handle
template CK_ATTRIBUTE Search template that specifies the attribute values to match
count ulong The number of attributes in the search template
Résultat CKR

C_GenerateKey() public méthode

Generates a secret key or set of domain parameters, creating a new object
public C_GenerateKey ( ulong session, CK_MECHANISM &mechanism, CK_ATTRIBUTE template, ulong count, ulong &key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Key generation mechanism
template CK_ATTRIBUTE The template for the new key or set of domain parameters
count ulong The number of attributes in the template
key ulong Location that receives the handle of the new key or set of domain parameters
Résultat CKR

C_GenerateKeyPair() public méthode

Generates a public/private key pair, creating new key objects
public C_GenerateKeyPair ( ulong session, CK_MECHANISM &mechanism, CK_ATTRIBUTE publicKeyTemplate, ulong publicKeyAttributeCount, CK_ATTRIBUTE privateKeyTemplate, ulong privateKeyAttributeCount, ulong &publicKey, ulong &privateKey ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Key generation mechanism
publicKeyTemplate CK_ATTRIBUTE The template for the public key
publicKeyAttributeCount ulong The number of attributes in the public-key template
privateKeyTemplate CK_ATTRIBUTE The template for the private key
privateKeyAttributeCount ulong The number of attributes in the private-key template
publicKey ulong Location that receives the handle of the new public key
privateKey ulong Location that receives the handle of the new private key
Résultat CKR

C_GenerateRandom() public méthode

Generates random or pseudo-random data
public C_GenerateRandom ( ulong session, byte randomData, ulong randomLen ) : CKR
session ulong The session's handle
randomData byte Location that receives the random data
randomLen ulong The length in bytes of the random or pseudo-random data to be generated
Résultat CKR

C_GetAttributeValue() public méthode

Obtains the value of one or more attributes of an object
public C_GetAttributeValue ( ulong session, ulong objectId, CK_ATTRIBUTE template, ulong count ) : CKR
session ulong The session's handle
objectId ulong The object's handle
template CK_ATTRIBUTE Template that specifies which attribute values are to be obtained, and receives the attribute values
count ulong The number of attributes in the template
Résultat CKR

C_GetFunctionList() public méthode

Returns a pointer to the Cryptoki library's list of function pointers
public C_GetFunctionList ( IntPtr &functionList ) : CKR
functionList System.IntPtr Pointer to a value which will receive a pointer to the library's CK_FUNCTION_LIST structure
Résultat CKR

C_GetFunctionStatus() public méthode

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL
public C_GetFunctionStatus ( ulong session ) : CKR
session ulong The session's handle
Résultat CKR

C_GetInfo() public méthode

Returns general information about Cryptoki
public C_GetInfo ( CK_INFO &info ) : CKR
info CK_INFO Structure that receives the information
Résultat CKR

C_GetMechanismInfo() public méthode

Obtains information about a particular mechanism possibly supported by a token
public C_GetMechanismInfo ( ulong slotId, CKM type, CK_MECHANISM_INFO &info ) : CKR
slotId ulong The ID of the token's slot
type CKM The type of mechanism
info CK_MECHANISM_INFO Structure that receives the mechanism information
Résultat CKR

C_GetMechanismList() public méthode

Obtains a list of mechanism types supported by a token
public C_GetMechanismList ( ulong slotId, CKM mechanismList, ulong &count ) : CKR
slotId ulong The ID of the token's slot
mechanismList CKM /// If set to null then the number of mechanisms is returned in "count" parameter, without actually returning a list of mechanisms. /// If not set to null then "count" parameter must contain the lenght of mechanismList array and mechanism list is returned in "mechanismList" parameter. ///
count ulong Location that receives the number of mechanisms
Résultat CKR

C_GetObjectSize() public méthode

Gets the size of an object in bytes
public C_GetObjectSize ( ulong session, ulong objectId, ulong &size ) : CKR
session ulong The session's handle
objectId ulong The object's handle
size ulong Location that receives the size in bytes of the object
Résultat CKR

C_GetOperationState() public méthode

Obtains a copy of the cryptographic operations state of a session encoded as byte array
public C_GetOperationState ( ulong session, byte operationState, ulong &operationStateLen ) : CKR
session ulong The session's handle
operationState byte /// If set to null then the length of state is returned in "operationStateLen" parameter, without actually returning a state. /// If not set to null then "operationStateLen" parameter must contain the lenght of operationState array and state is returned in "operationState" parameter. ///
operationStateLen ulong Location that receives the length in bytes of the state
Résultat CKR

C_GetSessionInfo() public méthode

Obtains information about a session
public C_GetSessionInfo ( ulong session, CK_SESSION_INFO &info ) : CKR
session ulong The session's handle
info CK_SESSION_INFO Structure that receives the session information
Résultat CKR

C_GetSlotInfo() public méthode

Obtains information about a particular slot in the system
public C_GetSlotInfo ( ulong slotId, CK_SLOT_INFO &info ) : CKR
slotId ulong The ID of the slot
info CK_SLOT_INFO Structure that receives the slot information
Résultat CKR

C_GetSlotList() public méthode

Obtains a list of slots in the system
public C_GetSlotList ( bool tokenPresent, ulong slotList, ulong &count ) : CKR
tokenPresent bool Indicates whether the list obtained includes only those slots with a token present (true) or all slots (false)
slotList ulong /// If set to null then the number of slots is returned in "count" parameter, without actually returning a list of slots. /// If not set to null then "count" parameter must contain the lenght of slotList array and slot list is returned in "slotList" parameter. ///
count ulong Location that receives the number of slots
Résultat CKR

C_GetTokenInfo() public méthode

Obtains information about a particular token in the system
public C_GetTokenInfo ( ulong slotId, CK_TOKEN_INFO &info ) : CKR
slotId ulong The ID of the token's slot
info CK_TOKEN_INFO Structure that receives the token information
Résultat CKR

C_InitPIN() public méthode

Initializes the normal user's PIN
public C_InitPIN ( ulong session, byte pin, ulong pinLen ) : CKR
session ulong The session's handle
pin byte Normal user's PIN or null to use protected authentication path (pinpad)
pinLen ulong The length of the PIN in bytes
Résultat CKR

C_InitToken() public méthode

Initializes a token
public C_InitToken ( ulong slotId, byte pin, ulong pinLen, byte label ) : CKR
slotId ulong The ID of the token's slot
pin byte SO's initial PIN or null to use protected authentication path (pinpad)
pinLen ulong The length of the PIN in bytes
label byte 32-byte long label of the token which must be padded with blank characters
Résultat CKR

C_Initialize() public méthode

Initializes the Cryptoki library
public C_Initialize ( CK_C_INITIALIZE_ARGS initArgs ) : CKR
initArgs CK_C_INITIALIZE_ARGS CK_C_INITIALIZE_ARGS structure containing information on how the library should deal with multi-threaded access or null if an application will not be accessing Cryptoki through multiple threads simultaneously
Résultat CKR

C_Login() public méthode

Logs a user into a token
public C_Login ( ulong session, CKU userType, byte pin, ulong pinLen ) : CKR
session ulong The session's handle
userType CKU The user type
pin byte User's PIN or null to use protected authentication path (pinpad)
pinLen ulong Length of user's PIN
Résultat CKR

C_Logout() public méthode

Logs a user out from a token
public C_Logout ( ulong session ) : CKR
session ulong The session's handle
Résultat CKR

C_OpenSession() public méthode

Opens a session between an application and a token in a particular slot
public C_OpenSession ( ulong slotId, ulong flags, IntPtr application, IntPtr notify, ulong &session ) : CKR
slotId ulong The ID of the token's slot
flags ulong Flags indicating the type of session
application System.IntPtr An application defined pointer to be passed to the notification callback
notify System.IntPtr The address of the notification callback function
session ulong Location that receives the handle for the new session
Résultat CKR

C_SeedRandom() public méthode

Mixes additional seed material into the token's random number generator
public C_SeedRandom ( ulong session, byte seed, ulong seedLen ) : CKR
session ulong The session's handle
seed byte The seed material
seedLen ulong The length of the seed material
Résultat CKR

C_SetAttributeValue() public méthode

Modifies the value of one or more attributes of an object
public C_SetAttributeValue ( ulong session, ulong objectId, CK_ATTRIBUTE template, ulong count ) : CKR
session ulong The session's handle
objectId ulong The object's handle
template CK_ATTRIBUTE Template that specifies which attribute values are to be modified and their new values
count ulong The number of attributes in the template
Résultat CKR

C_SetOperationState() public méthode

Restores the cryptographic operations state of a session from bytes obtained with C_GetOperationState
public C_SetOperationState ( ulong session, byte operationState, ulong operationStateLen, ulong encryptionKey, ulong authenticationKey ) : CKR
session ulong The session's handle
operationState byte Saved session state
operationStateLen ulong Length of saved session state
encryptionKey ulong Handle to the key which will be used for an ongoing encryption or decryption operation in the restored session or CK_INVALID_HANDLE if not needed
authenticationKey ulong Handle to the key which will be used for an ongoing operation in the restored session or CK_INVALID_HANDLE if not needed
Résultat CKR

C_SetPIN() public méthode

Modifies the PIN of the user that is currently logged in, or the CKU_USER PIN if the session is not logged in
public C_SetPIN ( ulong session, byte oldPin, ulong oldPinLen, byte newPin, ulong newPinLen ) : CKR
session ulong The session's handle
oldPin byte Old PIN or null to use protected authentication path (pinpad)
oldPinLen ulong The length of the old PIN in bytes
newPin byte New PIN or null to use protected authentication path (pinpad)
newPinLen ulong The length of the new PIN in bytes
Résultat CKR

C_Sign() public méthode

Signs data in a single part, where the signature is an appendix to the data
public C_Sign ( ulong session, byte data, ulong dataLen, byte signature, ulong &signatureLen ) : CKR
session ulong The session's handle
data byte Data to be signed
dataLen ulong The length of the data
signature byte /// If set to null then the length of signature is returned in "signatureLen" parameter, without actually returning signature. /// If not set to null then "signatureLen" parameter must contain the lenght of signature array and signature is returned in "signature" parameter. ///
signatureLen ulong Location that holds the length of the signature
Résultat CKR

C_SignEncryptUpdate() public méthode

Continues a multi-part combined signature and encryption operation, processing another data part
public C_SignEncryptUpdate ( ulong session, byte part, ulong partLen, byte encryptedPart, ulong &encryptedPartLen ) : CKR
session ulong The session's handle
part byte The data part to be signed and encrypted
partLen ulong Length of data part in bytes
encryptedPart byte /// If set to null then the length of encrypted data part is returned in "encryptedPartLen" parameter, without actually returning encrypted data part. /// If not set to null then "encryptedPartLen" parameter must contain the lenght of encryptedPart array and encrypted data part is returned in "encryptedPart" parameter. ///
encryptedPartLen ulong Location that holds the length in bytes of the encrypted data part
Résultat CKR

C_SignFinal() public méthode

Finishes a multi-part signature operation, returning the signature
public C_SignFinal ( ulong session, byte signature, ulong &signatureLen ) : CKR
session ulong The session's handle
signature byte /// If set to null then the length of signature is returned in "signatureLen" parameter, without actually returning signature. /// If not set to null then "signatureLen" parameter must contain the lenght of signature array and signature is returned in "signature" parameter. ///
signatureLen ulong Location that holds the length of the signature
Résultat CKR

C_SignInit() public méthode

Initializes a signature operation, where the signature is an appendix to the data
public C_SignInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Signature mechanism
key ulong Handle of the signature key
Résultat CKR

C_SignRecover() public méthode

Signs data in a single operation, where the data can be recovered from the signature
public C_SignRecover ( ulong session, byte data, ulong dataLen, byte signature, ulong &signatureLen ) : CKR
session ulong The session's handle
data byte Data to be signed
dataLen ulong The length of data to be signed
signature byte /// If set to null then the length of signature is returned in "signatureLen" parameter, without actually returning signature. /// If not set to null then "signatureLen" parameter must contain the lenght of signature array and signature is returned in "signature" parameter. ///
signatureLen ulong Location that holds the length of the signature
Résultat CKR

C_SignRecoverInit() public méthode

Initializes a signature operation, where the data can be recovered from the signature
public C_SignRecoverInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Signature mechanism
key ulong Handle of the signature key
Résultat CKR

C_SignUpdate() public méthode

Continues a multi-part signature operation, processing another data part
public C_SignUpdate ( ulong session, byte part, ulong partLen ) : CKR
session ulong The session's handle
part byte Data part
partLen ulong The length of the data part
Résultat CKR

C_UnwrapKey() public méthode

Unwraps (i.e. decrypts) a wrapped key, creating a new private key or secret key object
public C_UnwrapKey ( ulong session, CK_MECHANISM &mechanism, ulong unwrappingKey, byte wrappedKey, ulong wrappedKeyLen, CK_ATTRIBUTE template, ulong attributeCount, ulong &key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Unwrapping mechanism
unwrappingKey ulong The handle of the unwrapping key
wrappedKey byte Wrapped key
wrappedKeyLen ulong The length of the wrapped key
template CK_ATTRIBUTE The template for the new key
attributeCount ulong The number of attributes in the template
key ulong Location that receives the handle of the unwrapped key
Résultat CKR

C_Verify() public méthode

Verifies a signature in a single-part operation, where the signature is an appendix to the data
public C_Verify ( ulong session, byte data, ulong dataLen, byte signature, ulong signatureLen ) : CKR
session ulong The session's handle
data byte Data that were signed
dataLen ulong The length of the data
signature byte Signature of data
signatureLen ulong The length of signature
Résultat CKR

C_VerifyFinal() public méthode

Finishes a multi-part verification operation, checking the signature
public C_VerifyFinal ( ulong session, byte signature, ulong signatureLen ) : CKR
session ulong The session's handle
signature byte Signature
signatureLen ulong The length of signature
Résultat CKR

C_VerifyInit() public méthode

Initializes a verification operation, where the signature is an appendix to the data
public C_VerifyInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM The verification mechanism
key ulong The handle of the verification key
Résultat CKR

C_VerifyRecover() public méthode

Verifies a signature in a single-part operation, where the data is recovered from the signature
public C_VerifyRecover ( ulong session, byte signature, ulong signatureLen, byte data, ulong &dataLen ) : CKR
session ulong The session's handle
signature byte Signature
signatureLen ulong The length of signature
data byte /// If set to null then the length of recovered data is returned in "dataLen" parameter, without actually returning recovered data. /// If not set to null then "dataLen" parameter must contain the lenght of data array and recovered data is returned in "data" parameter. ///
dataLen ulong Location that holds the length of the decrypted data
Résultat CKR

C_VerifyRecoverInit() public méthode

Initializes a signature verification operation, where the data is recovered from the signature
public C_VerifyRecoverInit ( ulong session, CK_MECHANISM &mechanism, ulong key ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Verification mechanism
key ulong The handle of the verification key
Résultat CKR

C_VerifyUpdate() public méthode

Continues a multi-part verification operation, processing another data part
public C_VerifyUpdate ( ulong session, byte part, ulong partLen ) : CKR
session ulong The session's handle
part byte Data part
partLen ulong The length of the data part
Résultat CKR

C_WaitForSlotEvent() public méthode

Waits for a slot event, such as token insertion or token removal, to occur
public C_WaitForSlotEvent ( ulong flags, ulong &slot, IntPtr reserved ) : CKR
flags ulong Determines whether or not the C_WaitForSlotEvent call blocks (i.e., waits for a slot event to occur)
slot ulong Location which will receive the ID of the slot that the event occurred in
reserved System.IntPtr Reserved for future versions (should be null)
Résultat CKR

C_WrapKey() public méthode

Wraps (i.e., encrypts) a private or secret key
public C_WrapKey ( ulong session, CK_MECHANISM &mechanism, ulong wrappingKey, ulong key, byte wrappedKey, ulong &wrappedKeyLen ) : CKR
session ulong The session's handle
mechanism CK_MECHANISM Wrapping mechanism
wrappingKey ulong The handle of the wrapping key
key ulong The handle of the key to be wrapped
wrappedKey byte /// If set to null then the length of wrapped key is returned in "wrappedKeyLen" parameter, without actually returning wrapped key. /// If not set to null then "wrappedKeyLen" parameter must contain the lenght of wrappedKey array and wrapped key is returned in "wrappedKey" parameter. ///
wrappedKeyLen ulong Location that receives the length of the wrapped key
Résultat CKR

Dispose() public méthode

Disposes object
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Disposes object
protected Dispose ( bool disposing ) : void
disposing bool Flag indicating whether managed resources should be disposed
Résultat void

Pkcs11() public méthode

Loads PCKS#11 library
public Pkcs11 ( string libraryPath ) : System
libraryPath string Library name or path
Résultat System

Pkcs11() public méthode

Loads PCKS#11 library
public Pkcs11 ( string libraryPath, bool useGetFunctionList ) : System
libraryPath string Library name or path
useGetFunctionList bool Flag indicating whether cryptoki function pointers should be acquired via C_GetFunctionList (true) or via platform native function (false)
Résultat System