C# Class Net.Pkcs11Interop.HighLevelAPI81.Session

Class representing a logical connection between an application and a token
Inheritance: IDisposable
Show file Open project: Pkcs11Interop/Pkcs11Interop Class Usage Examples

Public Methods

Method Description
CancelFunction ( ) : void

Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL

CloseSession ( ) : void

Closes a session between an application and a token

CopyObject ( ObjectHandle objectHandle, List attributes ) : ObjectHandle

Copies an object, creating a new object for the copy

CreateObject ( List attributes ) : ObjectHandle

Creates a new object

Decrypt ( Mechanism mechanism, ObjectHandle keyHandle, byte encryptedData ) : byte[]

Decrypts single-part data

Decrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : void

Decrypts multi-part data

Decrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : void

Decrypts multi-part data

DecryptDigest ( Mechanism digestingMechanism, Mechanism decryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : byte[]

Digests and decrypts data

DecryptDigest ( Mechanism digestingMechanism, Mechanism decryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]

Digests and decrypts data

DecryptDigest ( Mechanism digestingMechanism, Mechanism decryptionMechanism, ObjectHandle keyHandle, byte data, byte &digest, byte &decryptedData ) : void

Digests and decrypts data

DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte signature, bool &isValid ) : void

Decrypts data and verifies a signature of data

DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte signature, bool &isValid, int bufferLength ) : void

Decrypts data and verifies a signature of data

DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, byte data, byte signature, byte &decryptedData, bool &isValid ) : void

Decrypts data and verifies a signature of data

DeriveKey ( Mechanism mechanism, ObjectHandle baseKeyHandle, List attributes ) : ObjectHandle

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

DestroyObject ( ObjectHandle objectHandle ) : void

Destroys an object

Digest ( Mechanism mechanism, Stream inputStream ) : byte[]

Digests multi-part data

Digest ( Mechanism mechanism, Stream inputStream, int bufferLength ) : byte[]

Digests multi-part data

Digest ( Mechanism mechanism, byte data ) : byte[]

Digests single-part data

DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : byte[]

Digests and encrypts data

DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]

Digests and encrypts data

DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, byte data, byte &digest, byte &encryptedData ) : void

Digests and encrypts data

DigestKey ( Mechanism mechanism, ObjectHandle keyHandle ) : byte[]

Digests the value of a secret key

Dispose ( ) : void

Disposes object

Encrypt ( Mechanism mechanism, ObjectHandle keyHandle, byte data ) : byte[]

Encrypts single-part data

Encrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : void

Encrypts multi-part data

Encrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : void

Encrypts multi-part data

FindAllObjects ( List attributes ) : List

Searches for all token and session objects that match provided attributes

FindObjects ( int objectCount ) : List

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

FindObjectsFinal ( ) : void

Terminates a search for token and session objects

FindObjectsInit ( List attributes ) : void

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

GenerateKey ( Mechanism mechanism, List attributes ) : ObjectHandle

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

GenerateKeyPair ( Mechanism mechanism, List publicKeyAttributes, List privateKeyAttributes, ObjectHandle &publicKeyHandle, ObjectHandle &privateKeyHandle ) : void

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

GenerateRandom ( int length ) : byte[]

Generates random or pseudo-random data

GetAttributeValue ( ObjectHandle objectHandle, List attributes ) : List

Obtains the value of one or more attributes of an object

GetAttributeValue ( ObjectHandle objectHandle, List attributes ) : List

Obtains the value of one or more attributes of an object

GetFunctionStatus ( ) : void

Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL

GetObjectSize ( ObjectHandle objectHandle ) : ulong

Gets the size of an object in bytes.

GetOperationState ( ) : byte[]

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

GetSessionInfo ( ) : SessionInfo

Obtains information about a session

InitPin ( byte userPin ) : void

Initializes the normal user's PIN

InitPin ( string userPin ) : void

Initializes the normal user's PIN

Login ( CKU userType, byte pin ) : void

Logs a user into a token

Login ( CKU userType, string pin ) : void

Logs a user into a token

Logout ( ) : void

Logs a user out from a token

SeedRandom ( byte seed ) : void

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

SetAttributeValue ( ObjectHandle objectHandle, List attributes ) : void

Modifies the value of one or more attributes of an object

SetOperationState ( byte state, ObjectHandle encryptionKey, ObjectHandle authenticationKey ) : void

Restores the cryptographic operations state of a session from an array of bytes obtained with GetOperationState

SetPin ( byte oldPin, byte newPin ) : void

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

SetPin ( string oldPin, string newPin ) : void

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

Sign ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream ) : byte[]

Signs multi-part data, where the signature is an appendix to the data

Sign ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, int bufferLength ) : byte[]

Signs multi-part data, where the signature is an appendix to the data

Sign ( Mechanism mechanism, ObjectHandle keyHandle, byte data ) : byte[]

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

SignEncrypt ( Mechanism signingMechanism, ObjectHandle signingKeyHandle, Mechanism encryptionMechanism, ObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream ) : byte[]

Signs and encrypts data

SignEncrypt ( Mechanism signingMechanism, ObjectHandle signingKeyHandle, Mechanism encryptionMechanism, ObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]

Signs and encrypts data

SignEncrypt ( Mechanism signingMechanism, ObjectHandle signingKeyHandle, Mechanism encryptionMechanism, ObjectHandle encryptionKeyHandle, byte data, byte &signature, byte &encryptedData ) : void

Signs and encrypts data

SignRecover ( Mechanism mechanism, ObjectHandle keyHandle, byte data ) : byte[]

Signs single-part data, where the data can be recovered from the signature

UnwrapKey ( Mechanism mechanism, ObjectHandle unwrappingKeyHandle, byte wrappedKey, List attributes ) : ObjectHandle

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

Verify ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, byte signature, bool &isValid ) : void

Verifies a signature of data, where the signature is an appendix to the data

Verify ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, byte signature, bool &isValid, int bufferLength ) : void

Verifies a signature of data, where the signature is an appendix to the data

Verify ( Mechanism mechanism, ObjectHandle keyHandle, byte data, byte signature, bool &isValid ) : void

Verifies a signature of data, where the signature is an appendix to the data

VerifyRecover ( Mechanism mechanism, ObjectHandle keyHandle, byte signature, bool &isValid ) : byte[]

Verifies signature of data, where the data can be recovered from the signature

WrapKey ( Mechanism mechanism, ObjectHandle wrappingKeyHandle, ObjectHandle keyHandle ) : byte[]

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

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes object

Private Methods

Method Description
Session ( LowLevelAPI81 pkcs11, ulong sessionId ) : System

Initializes new instance of Session class

Method Details

CancelFunction() public method

Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL
public CancelFunction ( ) : void
return void

CloseSession() public method

Closes a session between an application and a token
public CloseSession ( ) : void
return void

CopyObject() public method

Copies an object, creating a new object for the copy
public CopyObject ( ObjectHandle objectHandle, List attributes ) : ObjectHandle
objectHandle ObjectHandle Handle of object to be copied
attributes List New values for any attributes of the object that can ordinarily be modified
return ObjectHandle

CreateObject() public method

Creates a new object
public CreateObject ( List attributes ) : ObjectHandle
attributes List Object attributes
return ObjectHandle

Decrypt() public method

Decrypts single-part data
public Decrypt ( Mechanism mechanism, ObjectHandle keyHandle, byte encryptedData ) : byte[]
mechanism Mechanism Decryption mechanism
keyHandle ObjectHandle Handle of the decryption key
encryptedData byte Data to be decrypted
return byte[]

Decrypt() public method

Decrypts multi-part data
public Decrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : void
mechanism Mechanism Decryption mechanism
keyHandle ObjectHandle Handle of the decryption key
inputStream Stream Input stream from which encrypted data should be read
outputStream Stream Output stream where decrypted data should be written
return void

Decrypt() public method

Decrypts multi-part data
public Decrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : void
mechanism Mechanism Decryption mechanism
keyHandle ObjectHandle Handle of the decryption key
inputStream Stream Input stream from which encrypted data should be read
outputStream Stream Output stream where decrypted data should be written
bufferLength int Size of read buffer in bytes
return void

DecryptDigest() public method

Digests and decrypts data
public DecryptDigest ( Mechanism digestingMechanism, Mechanism decryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : byte[]
digestingMechanism Mechanism Digesting mechanism
decryptionMechanism Mechanism Decryption mechanism
keyHandle ObjectHandle Handle of the decryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where decrypted data should be written
return byte[]

DecryptDigest() public method

Digests and decrypts data
public DecryptDigest ( Mechanism digestingMechanism, Mechanism decryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]
digestingMechanism Mechanism Digesting mechanism
decryptionMechanism Mechanism Decryption mechanism
keyHandle ObjectHandle Handle of the decryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where decrypted data should be written
bufferLength int Size of read buffer in bytes
return byte[]

DecryptDigest() public method

Digests and decrypts data
public DecryptDigest ( Mechanism digestingMechanism, Mechanism decryptionMechanism, ObjectHandle keyHandle, byte data, byte &digest, byte &decryptedData ) : void
digestingMechanism Mechanism Digesting mechanism
decryptionMechanism Mechanism Decryption mechanism
keyHandle ObjectHandle Handle of the decryption key
data byte Data to be processed
digest byte Digest
decryptedData byte Decrypted data
return void

DecryptVerify() public method

Decrypts data and verifies a signature of data
public DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte signature, bool &isValid ) : void
verificationMechanism Mechanism Verification mechanism
verificationKeyHandle ObjectHandle Handle of the verification key
decryptionMechanism Mechanism Decryption mechanism
decryptionKeyHandle ObjectHandle Handle of the decryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where decrypted data should be written
signature byte Signature
isValid bool Flag indicating whether signature is valid
return void

DecryptVerify() public method

Decrypts data and verifies a signature of data
public DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte signature, bool &isValid, int bufferLength ) : void
verificationMechanism Mechanism Verification mechanism
verificationKeyHandle ObjectHandle Handle of the verification key
decryptionMechanism Mechanism Decryption mechanism
decryptionKeyHandle ObjectHandle Handle of the decryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where decrypted data should be written
signature byte Signature
isValid bool Flag indicating whether signature is valid
bufferLength int Size of read buffer in bytes
return void

DecryptVerify() public method

Decrypts data and verifies a signature of data
public DecryptVerify ( Mechanism verificationMechanism, ObjectHandle verificationKeyHandle, Mechanism decryptionMechanism, ObjectHandle decryptionKeyHandle, byte data, byte signature, byte &decryptedData, bool &isValid ) : void
verificationMechanism Mechanism Verification mechanism
verificationKeyHandle ObjectHandle Handle of the verification key
decryptionMechanism Mechanism Decryption mechanism
decryptionKeyHandle ObjectHandle Handle of the decryption key
data byte Data to be processed
signature byte Signature
decryptedData byte Decrypted data
isValid bool Flag indicating whether signature is valid
return void

DeriveKey() public method

Derives a key from a base key, creating a new key object
public DeriveKey ( Mechanism mechanism, ObjectHandle baseKeyHandle, List attributes ) : ObjectHandle
mechanism Mechanism Derivation mechanism
baseKeyHandle ObjectHandle Handle of base key
attributes List Attributes for the new key
return ObjectHandle

DestroyObject() public method

Destroys an object
public DestroyObject ( ObjectHandle objectHandle ) : void
objectHandle ObjectHandle Handle of object to be destroyed
return void

Digest() public method

Digests multi-part data
public Digest ( Mechanism mechanism, Stream inputStream ) : byte[]
mechanism Mechanism Digesting mechanism
inputStream Stream Input stream from which data should be read
return byte[]

Digest() public method

Digests multi-part data
public Digest ( Mechanism mechanism, Stream inputStream, int bufferLength ) : byte[]
mechanism Mechanism Digesting mechanism
inputStream Stream Input stream from which data should be read
bufferLength int Size of read buffer in bytes
return byte[]

Digest() public method

Digests single-part data
public Digest ( Mechanism mechanism, byte data ) : byte[]
mechanism Mechanism Digesting mechanism
data byte Data to be digested
return byte[]

DigestEncrypt() public method

Digests and encrypts data
public DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : byte[]
digestingMechanism Mechanism Digesting mechanism
encryptionMechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where encrypted data should be written
return byte[]

DigestEncrypt() public method

Digests and encrypts data
public DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]
digestingMechanism Mechanism Digesting mechanism
encryptionMechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where encrypted data should be written
bufferLength int Size of read buffer in bytes
return byte[]

DigestEncrypt() public method

Digests and encrypts data
public DigestEncrypt ( Mechanism digestingMechanism, Mechanism encryptionMechanism, ObjectHandle keyHandle, byte data, byte &digest, byte &encryptedData ) : void
digestingMechanism Mechanism Digesting mechanism
encryptionMechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
data byte Data to be processed
digest byte Digest
encryptedData byte Encrypted data
return void

DigestKey() public method

Digests the value of a secret key
public DigestKey ( Mechanism mechanism, ObjectHandle keyHandle ) : byte[]
mechanism Mechanism Digesting mechanism
keyHandle ObjectHandle Handle of the secret key to be digested
return byte[]

Dispose() public method

Disposes object
public Dispose ( ) : void
return void

Dispose() protected method

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

Encrypt() public method

Encrypts single-part data
public Encrypt ( Mechanism mechanism, ObjectHandle keyHandle, byte data ) : byte[]
mechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
data byte Data to be encrypted
return byte[]

Encrypt() public method

Encrypts multi-part data
public Encrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream ) : void
mechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be encrypted should be read
outputStream Stream Output stream where encrypted data should be written
return void

Encrypt() public method

Encrypts multi-part data
public Encrypt ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : void
mechanism Mechanism Encryption mechanism
keyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be encrypted should be read
outputStream Stream Output stream where encrypted data should be written
bufferLength int Size of read buffer in bytes
return void

FindAllObjects() public method

Searches for all token and session objects that match provided attributes
public FindAllObjects ( List attributes ) : List
attributes List Attributes that should be matched
return List

FindObjects() public method

Continues a search for token and session objects that match a template, obtaining additional object handles
public FindObjects ( int objectCount ) : List
objectCount int Maximum number of object handles to be returned
return List

FindObjectsFinal() public method

Terminates a search for token and session objects
public FindObjectsFinal ( ) : void
return void

FindObjectsInit() public method

Initializes a search for token and session objects that match a attributes
public FindObjectsInit ( List attributes ) : void
attributes List Attributes that should be matched
return void

GenerateKey() public method

Generates a secret key or set of domain parameters, creating a new object
public GenerateKey ( Mechanism mechanism, List attributes ) : ObjectHandle
mechanism Mechanism Generation mechanism
attributes List Attributes of the new key or set of domain parameters
return ObjectHandle

GenerateKeyPair() public method

Generates a public/private key pair, creating new key objects
public GenerateKeyPair ( Mechanism mechanism, List publicKeyAttributes, List privateKeyAttributes, ObjectHandle &publicKeyHandle, ObjectHandle &privateKeyHandle ) : void
mechanism Mechanism Key generation mechanism
publicKeyAttributes List Attributes of the public key
privateKeyAttributes List Attributes of the private key
publicKeyHandle ObjectHandle Handle of the new public key
privateKeyHandle ObjectHandle Handle of the new private key
return void

GenerateRandom() public method

Generates random or pseudo-random data
public GenerateRandom ( int length ) : byte[]
length int Length in bytes of the random or pseudo-random data to be generated
return byte[]

GetAttributeValue() public method

Obtains the value of one or more attributes of an object
public GetAttributeValue ( ObjectHandle objectHandle, List attributes ) : List
objectHandle ObjectHandle Handle of object whose attributes should be read
attributes List List of attributes that should be read
return List

GetAttributeValue() public method

Obtains the value of one or more attributes of an object
public GetAttributeValue ( ObjectHandle objectHandle, List attributes ) : List
objectHandle ObjectHandle Handle of object whose attributes should be read
attributes List List of attributes that should be read
return List

GetFunctionStatus() public method

Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL
public GetFunctionStatus ( ) : void
return void

GetObjectSize() public method

Gets the size of an object in bytes.
public GetObjectSize ( ObjectHandle objectHandle ) : ulong
objectHandle ObjectHandle Handle of object
return ulong

GetOperationState() public method

Obtains a copy of the cryptographic operations state of a session encoded as an array of bytes
public GetOperationState ( ) : byte[]
return byte[]

GetSessionInfo() public method

Obtains information about a session
public GetSessionInfo ( ) : SessionInfo
return SessionInfo

InitPin() public method

Initializes the normal user's PIN
public InitPin ( byte userPin ) : void
userPin byte Pin value
return void

InitPin() public method

Initializes the normal user's PIN
public InitPin ( string userPin ) : void
userPin string Pin value
return void

Login() public method

Logs a user into a token
public Login ( CKU userType, byte pin ) : void
userType CKU Type of user
pin byte Pin of user
return void

Login() public method

Logs a user into a token
public Login ( CKU userType, string pin ) : void
userType CKU Type of user
pin string Pin of user
return void

Logout() public method

Logs a user out from a token
public Logout ( ) : void
return void

SeedRandom() public method

Mixes additional seed material into the token's random number generator
public SeedRandom ( byte seed ) : void
seed byte Seed material
return void

SetAttributeValue() public method

Modifies the value of one or more attributes of an object
public SetAttributeValue ( ObjectHandle objectHandle, List attributes ) : void
objectHandle ObjectHandle Handle of object whose attributes should be modified
attributes List List of attributes that should be modified
return void

SetOperationState() public method

Restores the cryptographic operations state of a session from an array of bytes obtained with GetOperationState
public SetOperationState ( byte state, ObjectHandle encryptionKey, ObjectHandle authenticationKey ) : void
state byte Array of bytes obtained with GetOperationState
encryptionKey ObjectHandle CK_INVALID_HANDLE or handle to the key which will be used for an ongoing encryption or decryption operation in the restored session
authenticationKey ObjectHandle CK_INVALID_HANDLE or handle to the key which will be used for an ongoing signature, MACing, or verification operation in the restored session
return void

SetPin() public method

Modifies the PIN of the user that is currently logged in, or the CKU_USER PIN if the session is not logged in.
public SetPin ( byte oldPin, byte newPin ) : void
oldPin byte Old PIN value
newPin byte New PIN value
return void

SetPin() public method

Modifies the PIN of the user that is currently logged in, or the CKU_USER PIN if the session is not logged in.
public SetPin ( string oldPin, string newPin ) : void
oldPin string Old PIN value
newPin string New PIN value
return void

Sign() public method

Signs multi-part data, where the signature is an appendix to the data
public Sign ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream ) : byte[]
mechanism Mechanism Signature mechanism
keyHandle ObjectHandle Signature key
inputStream Stream Input stream from which data should be read
return byte[]

Sign() public method

Signs multi-part data, where the signature is an appendix to the data
public Sign ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, int bufferLength ) : byte[]
mechanism Mechanism Signature mechanism
keyHandle ObjectHandle Signature key
inputStream Stream Input stream from which data should be read
bufferLength int Size of read buffer in bytes
return byte[]

Sign() public method

Signs single-part data, where the signature is an appendix to the data
public Sign ( Mechanism mechanism, ObjectHandle keyHandle, byte data ) : byte[]
mechanism Mechanism Signature mechanism
keyHandle ObjectHandle Signature key
data byte Data to be signed
return byte[]

SignEncrypt() public method

Signs and encrypts data
public SignEncrypt ( Mechanism signingMechanism, ObjectHandle signingKeyHandle, Mechanism encryptionMechanism, ObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream ) : byte[]
signingMechanism Mechanism Signing mechanism
signingKeyHandle ObjectHandle Handle of the signing key
encryptionMechanism Mechanism Encryption mechanism
encryptionKeyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where encrypted data should be written
return byte[]

SignEncrypt() public method

Signs and encrypts data
public SignEncrypt ( Mechanism signingMechanism, ObjectHandle signingKeyHandle, Mechanism encryptionMechanism, ObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream, int bufferLength ) : byte[]
signingMechanism Mechanism Signing mechanism
signingKeyHandle ObjectHandle Handle of the signing key
encryptionMechanism Mechanism Encryption mechanism
encryptionKeyHandle ObjectHandle Handle of the encryption key
inputStream Stream Input stream from which data to be processed should be read
outputStream Stream Output stream where encrypted data should be written
bufferLength int Size of read buffer in bytes
return byte[]

SignEncrypt() public method

Signs and encrypts data
public SignEncrypt ( Mechanism signingMechanism, ObjectHandle signingKeyHandle, Mechanism encryptionMechanism, ObjectHandle encryptionKeyHandle, byte data, byte &signature, byte &encryptedData ) : void
signingMechanism Mechanism Signing mechanism
signingKeyHandle ObjectHandle Handle of the signing key
encryptionMechanism Mechanism Encryption mechanism
encryptionKeyHandle ObjectHandle Handle of the encryption key
data byte Data to be processed
signature byte Signature
encryptedData byte Encrypted data
return void

SignRecover() public method

Signs single-part data, where the data can be recovered from the signature
public SignRecover ( Mechanism mechanism, ObjectHandle keyHandle, byte data ) : byte[]
mechanism Mechanism Signature mechanism
keyHandle ObjectHandle Signature key
data byte Data to be signed
return byte[]

UnwrapKey() public method

Unwraps (i.e. decrypts) a wrapped key, creating a new private key or secret key object
public UnwrapKey ( Mechanism mechanism, ObjectHandle unwrappingKeyHandle, byte wrappedKey, List attributes ) : ObjectHandle
mechanism Mechanism Unwrapping mechanism
unwrappingKeyHandle ObjectHandle Handle of unwrapping key
wrappedKey byte Wrapped key
attributes List Attributes for unwrapped key
return ObjectHandle

Verify() public method

Verifies a signature of data, where the signature is an appendix to the data
public Verify ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, byte signature, bool &isValid ) : void
mechanism Mechanism Verification mechanism;
keyHandle ObjectHandle Verification key
inputStream Stream Input stream from which data that was signed should be read
signature byte Signature
isValid bool Flag indicating whether signature is valid
return void

Verify() public method

Verifies a signature of data, where the signature is an appendix to the data
public Verify ( Mechanism mechanism, ObjectHandle keyHandle, Stream inputStream, byte signature, bool &isValid, int bufferLength ) : void
mechanism Mechanism Verification mechanism;
keyHandle ObjectHandle Verification key
inputStream Stream Input stream from which data that was signed should be read
signature byte Signature
isValid bool Flag indicating whether signature is valid
bufferLength int Size of read buffer in bytes
return void

Verify() public method

Verifies a signature of data, where the signature is an appendix to the data
public Verify ( Mechanism mechanism, ObjectHandle keyHandle, byte data, byte signature, bool &isValid ) : void
mechanism Mechanism Verification mechanism;
keyHandle ObjectHandle Verification key
data byte Data that was signed
signature byte Signature
isValid bool Flag indicating whether signature is valid
return void

VerifyRecover() public method

Verifies signature of data, where the data can be recovered from the signature
public VerifyRecover ( Mechanism mechanism, ObjectHandle keyHandle, byte signature, bool &isValid ) : byte[]
mechanism Mechanism Verification mechanism;
keyHandle ObjectHandle Verification key
signature byte Signature
isValid bool Flag indicating whether signature is valid
return byte[]

WrapKey() public method

Wraps (i.e., encrypts) a private or secret key
public WrapKey ( Mechanism mechanism, ObjectHandle wrappingKeyHandle, ObjectHandle keyHandle ) : byte[]
mechanism Mechanism Wrapping mechanism
wrappingKeyHandle ObjectHandle Handle of wrapping key
keyHandle ObjectHandle Handle of key to be wrapped
return byte[]