C# 클래스 Net.Pkcs11Interop.LowLevelAPI40.Pkcs11

Low level PKCS#11 wrapper
상속: IDisposable
파일 보기 프로젝트 열기: Pkcs11Interop/Pkcs11Interop 1 사용 예제들

공개 메소드들

메소드 설명
C_CancelFunction ( uint session ) : CKR

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL

C_CloseAllSessions ( uint slotId ) : CKR

Closes all sessions an application has with a token

C_CloseSession ( uint session ) : CKR

Closes a session between an application and a token

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

Copies an object, creating a new object for the copy

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

Creates a new object

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

Decrypts encrypted data in a single part

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

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

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

Finishes a multi-part decryption operation

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

Initializes a decryption operation

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

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

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

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

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

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

C_DestroyObject ( uint session, uint objectId ) : CKR

Destroys an object

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

Digests data in a single part

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

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

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

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

C_DigestInit ( uint session, CK_MECHANISM &mechanism ) : CKR

Initializes a message-digesting operation

C_DigestKey ( uint session, uint key ) : CKR

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

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

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

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

Encrypts single-part data

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

Finishes a multi-part encryption operation

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

Initializes an encryption operation

C_EncryptUpdate ( uint session, byte part, uint partLen, byte encryptedPart, uint &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 ( uint session, uint objectId, uint maxObjectCount, uint &objectCount ) : CKR

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

C_FindObjectsFinal ( uint session ) : CKR

Terminates a search for token and session objects

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

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

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

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

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

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

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

Generates random or pseudo-random data

C_GetAttributeValue ( uint session, uint objectId, CK_ATTRIBUTE template, uint 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 ( uint 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 ( uint slotId, CKM type, CK_MECHANISM_INFO &info ) : CKR

Obtains information about a particular mechanism possibly supported by a token

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

Obtains a list of mechanism types supported by a token

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

Gets the size of an object in bytes

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

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

C_GetSessionInfo ( uint session, CK_SESSION_INFO &info ) : CKR

Obtains information about a session

C_GetSlotInfo ( uint slotId, CK_SLOT_INFO &info ) : CKR

Obtains information about a particular slot in the system

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

Obtains a list of slots in the system

C_GetTokenInfo ( uint slotId, CK_TOKEN_INFO &info ) : CKR

Obtains information about a particular token in the system

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

Initializes the normal user's PIN

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

Initializes a token

C_Initialize ( CK_C_INITIALIZE_ARGS initArgs ) : CKR

Initializes the Cryptoki library

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

Logs a user into a token

C_Logout ( uint session ) : CKR

Logs a user out from a token

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

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

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

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

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

Modifies the value of one or more attributes of an object

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

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

C_SetPIN ( uint session, byte oldPin, uint oldPinLen, byte newPin, uint 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 ( uint session, byte data, uint dataLen, byte signature, uint &signatureLen ) : CKR

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

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

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

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

Finishes a multi-part signature operation, returning the signature

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

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

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

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

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

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

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

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

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

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

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

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

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

Finishes a multi-part verification operation, checking the signature

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

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

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

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

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

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

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

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

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

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

C_WrapKey ( uint session, CK_MECHANISM &mechanism, uint wrappingKey, uint key, byte wrappedKey, uint &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

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Disposes object

비공개 메소드들

메소드 설명
Release ( ) : void

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

메소드 상세

C_CancelFunction() 공개 메소드

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL
public C_CancelFunction ( uint session ) : CKR
session uint The session's handle
리턴 CKR

C_CloseAllSessions() 공개 메소드

Closes all sessions an application has with a token
public C_CloseAllSessions ( uint slotId ) : CKR
slotId uint The ID of the token's slot
리턴 CKR

C_CloseSession() 공개 메소드

Closes a session between an application and a token
public C_CloseSession ( uint session ) : CKR
session uint The session's handle
리턴 CKR

C_CopyObject() 공개 메소드

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

C_CreateObject() 공개 메소드

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

C_Decrypt() 공개 메소드

Decrypts encrypted data in a single part
public C_Decrypt ( uint session, byte encryptedData, uint encryptedDataLen, byte data, uint &dataLen ) : CKR
session uint The session's handle
encryptedData byte Encrypted data
encryptedDataLen uint 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 uint Location that holds the length of the decrypted data
리턴 CKR

C_DecryptDigestUpdate() 공개 메소드

Continues a multi-part combined decryption and digest operation, processing another data part
public C_DecryptDigestUpdate ( uint session, byte encryptedPart, uint encryptedPartLen, byte part, uint &partLen ) : CKR
session uint The session's handle
encryptedPart byte Encrypted data part
encryptedPartLen uint 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 uint Location that holds the length of the decrypted data part
리턴 CKR

C_DecryptFinal() 공개 메소드

Finishes a multi-part decryption operation
public C_DecryptFinal ( uint session, byte lastPart, uint &lastPartLen ) : CKR
session uint 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 uint Location that holds the length of the last decrypted data part
리턴 CKR

C_DecryptInit() 공개 메소드

Initializes a decryption operation
public C_DecryptInit ( uint session, CK_MECHANISM &mechanism, uint key ) : CKR
session uint The session's handle
mechanism CK_MECHANISM The decryption mechanism
key uint The handle of the decryption key
리턴 CKR

C_DecryptUpdate() 공개 메소드

Continues a multi-part decryption operation, processing another encrypted data part
public C_DecryptUpdate ( uint session, byte encryptedPart, uint encryptedPartLen, byte part, uint &partLen ) : CKR
session uint The session's handle
encryptedPart byte Encrypted data part
encryptedPartLen uint 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 uint Location that holds the length of the decrypted data part
리턴 CKR

C_DecryptVerifyUpdate() 공개 메소드

Continues a multi-part combined decryption and verification operation, processing another data part
public C_DecryptVerifyUpdate ( uint session, byte encryptedPart, uint encryptedPartLen, byte part, uint &partLen ) : CKR
session uint The session's handle
encryptedPart byte Encrypted data part
encryptedPartLen uint 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 uint Location that holds the length of the decrypted data part
리턴 CKR

C_DeriveKey() 공개 메소드

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

C_DestroyObject() 공개 메소드

Destroys an object
public C_DestroyObject ( uint session, uint objectId ) : CKR
session uint The session's handle
objectId uint The object's handle
리턴 CKR

C_Digest() 공개 메소드

Digests data in a single part
public C_Digest ( uint session, byte data, uint dataLen, byte digest, uint &digestLen ) : CKR
session uint The session's handle
data byte Data to be digested
dataLen uint 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 uint Location that holds the length of the message digest
리턴 CKR

C_DigestEncryptUpdate() 공개 메소드

Continues multi-part digest and encryption operations, processing another data part
public C_DigestEncryptUpdate ( uint session, byte part, uint partLen, byte encryptedPart, uint &encryptedPartLen ) : CKR
session uint The session's handle
part byte The data part to be digested and encrypted
partLen uint 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 uint Location that holds the length in bytes of the encrypted data part
리턴 CKR

C_DigestFinal() 공개 메소드

Finishes a multi-part message-digesting operation, returning the message digest
public C_DigestFinal ( uint session, byte digest, uint &digestLen ) : CKR
session uint 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 uint Location that holds the length of the message digest
리턴 CKR

C_DigestInit() 공개 메소드

Initializes a message-digesting operation
public C_DigestInit ( uint session, CK_MECHANISM &mechanism ) : CKR
session uint The session's handle
mechanism CK_MECHANISM The digesting mechanism
리턴 CKR

C_DigestKey() 공개 메소드

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

C_DigestUpdate() 공개 메소드

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

C_Encrypt() 공개 메소드

Encrypts single-part data
public C_Encrypt ( uint session, byte data, uint dataLen, byte encryptedData, uint &encryptedDataLen ) : CKR
session uint The session's handle
data byte Data to be encrypted
dataLen uint 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 uint Location that holds the length in bytes of the encrypted data
리턴 CKR

C_EncryptFinal() 공개 메소드

Finishes a multi-part encryption operation
public C_EncryptFinal ( uint session, byte lastEncryptedPart, uint &lastEncryptedPartLen ) : CKR
session uint 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 uint Location that holds the length of the last encrypted data part
리턴 CKR

C_EncryptInit() 공개 메소드

Initializes an encryption operation
public C_EncryptInit ( uint session, CK_MECHANISM &mechanism, uint key ) : CKR
session uint The session's handle
mechanism CK_MECHANISM The encryption mechanism
key uint The handle of the encryption key
리턴 CKR

C_EncryptUpdate() 공개 메소드

Continues a multi-part encryption operation, processing another data part
public C_EncryptUpdate ( uint session, byte part, uint partLen, byte encryptedPart, uint &encryptedPartLen ) : CKR
session uint The session's handle
part byte The data part to be encrypted
partLen uint 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 uint Location that holds the length in bytes of the encrypted data part
리턴 CKR

C_Finalize() 공개 메소드

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.
리턴 CKR

C_FindObjects() 공개 메소드

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

C_FindObjectsFinal() 공개 메소드

Terminates a search for token and session objects
public C_FindObjectsFinal ( uint session ) : CKR
session uint The session's handle
리턴 CKR

C_FindObjectsInit() 공개 메소드

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

C_GenerateKey() 공개 메소드

Generates a secret key or set of domain parameters, creating a new object
public C_GenerateKey ( uint session, CK_MECHANISM &mechanism, CK_ATTRIBUTE template, uint count, uint &key ) : CKR
session uint 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 uint The number of attributes in the template
key uint Location that receives the handle of the new key or set of domain parameters
리턴 CKR

C_GenerateKeyPair() 공개 메소드

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

C_GenerateRandom() 공개 메소드

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

C_GetAttributeValue() 공개 메소드

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

C_GetFunctionList() 공개 메소드

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
리턴 CKR

C_GetFunctionStatus() 공개 메소드

Legacy function which should simply return the value CKR_FUNCTION_NOT_PARALLEL
public C_GetFunctionStatus ( uint session ) : CKR
session uint The session's handle
리턴 CKR

C_GetInfo() 공개 메소드

Returns general information about Cryptoki
public C_GetInfo ( CK_INFO &info ) : CKR
info CK_INFO Structure that receives the information
리턴 CKR

C_GetMechanismInfo() 공개 메소드

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

C_GetMechanismList() 공개 메소드

Obtains a list of mechanism types supported by a token
public C_GetMechanismList ( uint slotId, CKM mechanismList, uint &count ) : CKR
slotId uint 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 uint Location that receives the number of mechanisms
리턴 CKR

C_GetObjectSize() 공개 메소드

Gets the size of an object in bytes
public C_GetObjectSize ( uint session, uint objectId, uint &size ) : CKR
session uint The session's handle
objectId uint The object's handle
size uint Location that receives the size in bytes of the object
리턴 CKR

C_GetOperationState() 공개 메소드

Obtains a copy of the cryptographic operations state of a session encoded as byte array
public C_GetOperationState ( uint session, byte operationState, uint &operationStateLen ) : CKR
session uint 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 uint Location that receives the length in bytes of the state
리턴 CKR

C_GetSessionInfo() 공개 메소드

Obtains information about a session
public C_GetSessionInfo ( uint session, CK_SESSION_INFO &info ) : CKR
session uint The session's handle
info CK_SESSION_INFO Structure that receives the session information
리턴 CKR

C_GetSlotInfo() 공개 메소드

Obtains information about a particular slot in the system
public C_GetSlotInfo ( uint slotId, CK_SLOT_INFO &info ) : CKR
slotId uint The ID of the slot
info CK_SLOT_INFO Structure that receives the slot information
리턴 CKR

C_GetSlotList() 공개 메소드

Obtains a list of slots in the system
public C_GetSlotList ( bool tokenPresent, uint slotList, uint &count ) : CKR
tokenPresent bool Indicates whether the list obtained includes only those slots with a token present (true) or all slots (false)
slotList uint /// 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 uint Location that receives the number of slots
리턴 CKR

C_GetTokenInfo() 공개 메소드

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

C_InitPIN() 공개 메소드

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

C_InitToken() 공개 메소드

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

C_Initialize() 공개 메소드

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
리턴 CKR

C_Login() 공개 메소드

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

C_Logout() 공개 메소드

Logs a user out from a token
public C_Logout ( uint session ) : CKR
session uint The session's handle
리턴 CKR

C_OpenSession() 공개 메소드

Opens a session between an application and a token in a particular slot
public C_OpenSession ( uint slotId, uint flags, IntPtr application, IntPtr notify, uint &session ) : CKR
slotId uint The ID of the token's slot
flags uint 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 uint Location that receives the handle for the new session
리턴 CKR

C_SeedRandom() 공개 메소드

Mixes additional seed material into the token's random number generator
public C_SeedRandom ( uint session, byte seed, uint seedLen ) : CKR
session uint The session's handle
seed byte The seed material
seedLen uint The length of the seed material
리턴 CKR

C_SetAttributeValue() 공개 메소드

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

C_SetOperationState() 공개 메소드

Restores the cryptographic operations state of a session from bytes obtained with C_GetOperationState
public C_SetOperationState ( uint session, byte operationState, uint operationStateLen, uint encryptionKey, uint authenticationKey ) : CKR
session uint The session's handle
operationState byte Saved session state
operationStateLen uint Length of saved session state
encryptionKey uint 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 uint Handle to the key which will be used for an ongoing operation in the restored session or CK_INVALID_HANDLE if not needed
리턴 CKR

C_SetPIN() 공개 메소드

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 ( uint session, byte oldPin, uint oldPinLen, byte newPin, uint newPinLen ) : CKR
session uint The session's handle
oldPin byte Old PIN or null to use protected authentication path (pinpad)
oldPinLen uint The length of the old PIN in bytes
newPin byte New PIN or null to use protected authentication path (pinpad)
newPinLen uint The length of the new PIN in bytes
리턴 CKR

C_Sign() 공개 메소드

Signs data in a single part, where the signature is an appendix to the data
public C_Sign ( uint session, byte data, uint dataLen, byte signature, uint &signatureLen ) : CKR
session uint The session's handle
data byte Data to be signed
dataLen uint 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 uint Location that holds the length of the signature
리턴 CKR

C_SignEncryptUpdate() 공개 메소드

Continues a multi-part combined signature and encryption operation, processing another data part
public C_SignEncryptUpdate ( uint session, byte part, uint partLen, byte encryptedPart, uint &encryptedPartLen ) : CKR
session uint The session's handle
part byte The data part to be signed and encrypted
partLen uint 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 uint Location that holds the length in bytes of the encrypted data part
리턴 CKR

C_SignFinal() 공개 메소드

Finishes a multi-part signature operation, returning the signature
public C_SignFinal ( uint session, byte signature, uint &signatureLen ) : CKR
session uint 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 uint Location that holds the length of the signature
리턴 CKR

C_SignInit() 공개 메소드

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

C_SignRecover() 공개 메소드

Signs data in a single operation, where the data can be recovered from the signature
public C_SignRecover ( uint session, byte data, uint dataLen, byte signature, uint &signatureLen ) : CKR
session uint The session's handle
data byte Data to be signed
dataLen uint 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 uint Location that holds the length of the signature
리턴 CKR

C_SignRecoverInit() 공개 메소드

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

C_SignUpdate() 공개 메소드

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

C_UnwrapKey() 공개 메소드

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

C_Verify() 공개 메소드

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

C_VerifyFinal() 공개 메소드

Finishes a multi-part verification operation, checking the signature
public C_VerifyFinal ( uint session, byte signature, uint signatureLen ) : CKR
session uint The session's handle
signature byte Signature
signatureLen uint The length of signature
리턴 CKR

C_VerifyInit() 공개 메소드

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

C_VerifyRecover() 공개 메소드

Verifies a signature in a single-part operation, where the data is recovered from the signature
public C_VerifyRecover ( uint session, byte signature, uint signatureLen, byte data, uint &dataLen ) : CKR
session uint The session's handle
signature byte Signature
signatureLen uint 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 uint Location that holds the length of the decrypted data
리턴 CKR

C_VerifyRecoverInit() 공개 메소드

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

C_VerifyUpdate() 공개 메소드

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

C_WaitForSlotEvent() 공개 메소드

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

C_WrapKey() 공개 메소드

Wraps (i.e., encrypts) a private or secret key
public C_WrapKey ( uint session, CK_MECHANISM &mechanism, uint wrappingKey, uint key, byte wrappedKey, uint &wrappedKeyLen ) : CKR
session uint The session's handle
mechanism CK_MECHANISM Wrapping mechanism
wrappingKey uint The handle of the wrapping key
key uint 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 uint Location that receives the length of the wrapped key
리턴 CKR

Dispose() 공개 메소드

Disposes object
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Disposes object
protected Dispose ( bool disposing ) : void
disposing bool Flag indicating whether managed resources should be disposed
리턴 void

Pkcs11() 공개 메소드

Loads PCKS#11 library
public Pkcs11 ( string libraryPath ) : System
libraryPath string Library name or path
리턴 System

Pkcs11() 공개 메소드

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)
리턴 System