Pkcs11Interop  5.1.2
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Net.Pkcs11Interop.HighLevelAPI40.Session Class Reference

Class representing a logical connection between an application and a token More...

Inherits Net.Pkcs11Interop.HighLevelAPI.ISession.

Public Member Functions

void CloseSession ()
 Closes a session between an application and a token More...
 
void InitPin (string userPin)
 Initializes the normal user's PIN More...
 
void InitPin (byte[] userPin)
 Initializes the normal user's PIN More...
 
void SetPin (string oldPin, string newPin)
 Modifies the PIN of the user that is currently logged in, or the CKU_USER PIN if the session is not logged in. More...
 
void SetPin (byte[] oldPin, byte[] newPin)
 Modifies the PIN of the user that is currently logged in, or the CKU_USER PIN if the session is not logged in. More...
 
ISessionInfo GetSessionInfo ()
 Obtains information about a session More...
 
byte [] GetOperationState ()
 Obtains a copy of the cryptographic operations state of a session encoded as an array of bytes More...
 
void SetOperationState (byte[] state, IObjectHandle encryptionKey, IObjectHandle authenticationKey)
 Restores the cryptographic operations state of a session from an array of bytes obtained with GetOperationState More...
 
void Login (CKU userType, string pin)
 Logs a user into a token More...
 
void Login (CKU userType, byte[] pin)
 Logs a user into a token More...
 
void Logout ()
 Logs a user out from a token More...
 
IObjectHandle CreateObject (List< IObjectAttribute > attributes)
 Creates a new object More...
 
IObjectHandle CopyObject (IObjectHandle objectHandle, List< IObjectAttribute > attributes)
 Copies an object, creating a new object for the copy More...
 
void DestroyObject (IObjectHandle objectHandle)
 Destroys an object More...
 
ulong GetObjectSize (IObjectHandle objectHandle)
 Gets the size of an object in bytes. More...
 
List< IObjectAttributeGetAttributeValue (IObjectHandle objectHandle, List< CKA > attributes)
 Obtains the value of one or more attributes of an object More...
 
List< IObjectAttributeGetAttributeValue (IObjectHandle objectHandle, List< ulong > attributes)
 Obtains the value of one or more attributes of an object More...
 
void SetAttributeValue (IObjectHandle objectHandle, List< IObjectAttribute > attributes)
 Modifies the value of one or more attributes of an object More...
 
void FindObjectsInit (List< IObjectAttribute > attributes)
 Initializes a search for token and session objects that match a attributes More...
 
List< IObjectHandleFindObjects (int objectCount)
 Continues a search for token and session objects that match a template, obtaining additional object handles More...
 
void FindObjectsFinal ()
 Terminates a search for token and session objects More...
 
List< IObjectHandleFindAllObjects (List< IObjectAttribute > attributes)
 Searches for all token and session objects that match provided attributes More...
 
byte [] Encrypt (IMechanism mechanism, IObjectHandle keyHandle, byte[] data)
 Encrypts single-part data More...
 
void Encrypt (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream)
 Encrypts multi-part data More...
 
void Encrypt (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Encrypts multi-part data More...
 
byte [] Decrypt (IMechanism mechanism, IObjectHandle keyHandle, byte[] encryptedData)
 Decrypts single-part data More...
 
void Decrypt (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream)
 Decrypts multi-part data More...
 
void Decrypt (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Decrypts multi-part data More...
 
byte [] DigestKey (IMechanism mechanism, IObjectHandle keyHandle)
 Digests the value of a secret key More...
 
byte [] Digest (IMechanism mechanism, byte[] data)
 Digests single-part data More...
 
byte [] Digest (IMechanism mechanism, Stream inputStream)
 Digests multi-part data More...
 
byte [] Digest (IMechanism mechanism, Stream inputStream, int bufferLength)
 Digests multi-part data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, byte[] data)
 Signs single-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, string keyPin, byte[] data)
 Signs single-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, byte[] keyPin, byte[] data)
 Signs single-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, string keyPin, Stream inputStream)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, byte[] keyPin, Stream inputStream)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, int bufferLength)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, string keyPin, Stream inputStream, int bufferLength)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, byte[] keyPin, Stream inputStream, int bufferLength)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] SignRecover (IMechanism mechanism, IObjectHandle keyHandle, byte[] data)
 Signs single-part data, where the data can be recovered from the signature More...
 
byte [] SignRecover (IMechanism mechanism, IObjectHandle keyHandle, string keyPin, byte[] data)
 Signs single-part data, where the data can be recovered from the signature More...
 
byte [] SignRecover (IMechanism mechanism, IObjectHandle keyHandle, byte[] keyPin, byte[] data)
 Signs single-part data, where the data can be recovered from the signature More...
 
void Verify (IMechanism mechanism, IObjectHandle keyHandle, byte[] data, byte[] signature, out bool isValid)
 Verifies a signature of data, where the signature is an appendix to the data More...
 
void Verify (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, byte[] signature, out bool isValid)
 Verifies a signature of data, where the signature is an appendix to the data More...
 
void Verify (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, byte[] signature, out bool isValid, int bufferLength)
 Verifies a signature of data, where the signature is an appendix to the data More...
 
byte [] VerifyRecover (IMechanism mechanism, IObjectHandle keyHandle, byte[] signature, out bool isValid)
 Verifies signature of data, where the data can be recovered from the signature More...
 
void DigestEncrypt (IMechanism digestingMechanism, IMechanism encryptionMechanism, IObjectHandle keyHandle, byte[] data, out byte[] digest, out byte[] encryptedData)
 Digests and encrypts data More...
 
byte [] DigestEncrypt (IMechanism digestingMechanism, IMechanism encryptionMechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream)
 Digests and encrypts data More...
 
byte [] DigestEncrypt (IMechanism digestingMechanism, IMechanism encryptionMechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Digests and encrypts data More...
 
void DecryptDigest (IMechanism digestingMechanism, IMechanism decryptionMechanism, IObjectHandle keyHandle, byte[] data, out byte[] digest, out byte[] decryptedData)
 Digests and decrypts data More...
 
byte [] DecryptDigest (IMechanism digestingMechanism, IMechanism decryptionMechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream)
 Digests and decrypts data More...
 
byte [] DecryptDigest (IMechanism digestingMechanism, IMechanism decryptionMechanism, IObjectHandle keyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Digests and decrypts data More...
 
void SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, byte[] data, out byte[] signature, out byte[] encryptedData)
 Signs and encrypts data More...
 
void SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, string signingKeyPin, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, byte[] data, out byte[] signature, out byte[] encryptedData)
 Signs and encrypts data More...
 
void SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, byte[] signingKeyPin, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, byte[] data, out byte[] signature, out byte[] encryptedData)
 Signs and encrypts data More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream)
 Signs and encrypts data More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, string signingKeyPin, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream)
 Signs and encrypts data More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, byte[] signingKeyPin, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream)
 Signs and encrypts data More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Signs and encrypts data More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, string signingKeyPin, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Signs and encrypts data More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, byte[] signingKeyPin, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream, int bufferLength)
 Signs and encrypts data More...
 
void DecryptVerify (IMechanism verificationMechanism, IObjectHandle verificationKeyHandle, IMechanism decryptionMechanism, IObjectHandle decryptionKeyHandle, byte[] data, byte[] signature, out byte[] decryptedData, out bool isValid)
 Decrypts data and verifies a signature of data More...
 
void DecryptVerify (IMechanism verificationMechanism, IObjectHandle verificationKeyHandle, IMechanism decryptionMechanism, IObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte[] signature, out bool isValid)
 Decrypts data and verifies a signature of data More...
 
void DecryptVerify (IMechanism verificationMechanism, IObjectHandle verificationKeyHandle, IMechanism decryptionMechanism, IObjectHandle decryptionKeyHandle, Stream inputStream, Stream outputStream, byte[] signature, out bool isValid, int bufferLength)
 Decrypts data and verifies a signature of data More...
 
IObjectHandle GenerateKey (IMechanism mechanism, List< IObjectAttribute > attributes)
 Generates a secret key or set of domain parameters, creating a new object More...
 
void GenerateKeyPair (IMechanism mechanism, List< IObjectAttribute > publicKeyAttributes, List< IObjectAttribute > privateKeyAttributes, out IObjectHandle publicKeyHandle, out IObjectHandle privateKeyHandle)
 Generates a public/private key pair, creating new key objects More...
 
byte [] WrapKey (IMechanism mechanism, IObjectHandle wrappingKeyHandle, IObjectHandle keyHandle)
 Wraps (i.e., encrypts) a private or secret key More...
 
IObjectHandle UnwrapKey (IMechanism mechanism, IObjectHandle unwrappingKeyHandle, byte[] wrappedKey, List< IObjectAttribute > attributes)
 Unwraps (i.e. decrypts) a wrapped key, creating a new private key or secret key object More...
 
IObjectHandle DeriveKey (IMechanism mechanism, IObjectHandle baseKeyHandle, List< IObjectAttribute > attributes)
 Derives a key from a base key, creating a new key object More...
 
void SeedRandom (byte[] seed)
 Mixes additional seed material into the token's random number generator More...
 
byte [] GenerateRandom (int length)
 Generates random or pseudo-random data More...
 
void GetFunctionStatus ()
 Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL More...
 
void CancelFunction ()
 Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL More...
 
void Dispose ()
 Disposes object More...
 

Protected Member Functions

byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, byte[] data, bool performLogin, byte[] keyPin)
 Signs single-part data, where the signature is an appendix to the data More...
 
byte [] Sign (IMechanism mechanism, IObjectHandle keyHandle, Stream inputStream, int bufferLength, bool performLogin, byte[] keyPin)
 Signs multi-part data, where the signature is an appendix to the data More...
 
byte [] SignRecover (IMechanism mechanism, IObjectHandle keyHandle, byte[] data, bool performLogin, byte[] keyPin)
 Signs single-part data, where the data can be recovered from the signature More...
 
byte [] SignEncrypt (IMechanism signingMechanism, IObjectHandle signingKeyHandle, IMechanism encryptionMechanism, IObjectHandle encryptionKeyHandle, Stream inputStream, Stream outputStream, int bufferLength, bool performLogin, byte[] signingKeyPin)
 Signs and encrypts data More...
 
virtual void Dispose (bool disposing)
 Disposes object More...
 

Protected Attributes

bool _disposed = false
 Flag indicating whether instance has been disposed More...
 
Pkcs11InteropFactories _factories = null
 Factories to be used by Developer and Pkcs11Interop library More...
 
LowLevelAPI40.Pkcs11Library _pkcs11Library = null
 Low level PKCS#11 wrapper More...
 
NativeULong _sessionId = CK.CK_INVALID_HANDLE
 PKCS#11 handle of session More...
 
bool _closeWhenDisposed = true
 Flag indicating whether session should be closed when object is disposed More...
 

Properties

Pkcs11InteropFactories Factories [get]
 Factories to be used by Developer and Pkcs11Interop library More...
 
ulong SessionId [get]
 PKCS#11 handle of session More...
 
bool CloseWhenDisposed [get, set]
 Flag indicating whether session should be closed when object is disposed More...
 
- Properties inherited from Net.Pkcs11Interop.HighLevelAPI.ISession
Pkcs11InteropFactories Factories [get]
 Factories to be used by Developer and Pkcs11Interop library More...
 
ulong SessionId [get]
 PKCS#11 handle of session More...
 
bool CloseWhenDisposed [get]
 Flag indicating whether session should be closed when object is disposed More...
 

Detailed Description

Class representing a logical connection between an application and a token

Member Function Documentation

◆ CancelFunction()

void Net.Pkcs11Interop.HighLevelAPI40.Session.CancelFunction ( )

Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ CloseSession()

void Net.Pkcs11Interop.HighLevelAPI40.Session.CloseSession ( )

Closes a session between an application and a token

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ CopyObject()

IObjectHandle Net.Pkcs11Interop.HighLevelAPI40.Session.CopyObject ( IObjectHandle  objectHandle,
List< IObjectAttribute attributes 
)

Copies an object, creating a new object for the copy

Parameters
objectHandleHandle of object to be copied
attributesNew values for any attributes of the object that can ordinarily be modified
Returns
Handle of copied object

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ CreateObject()

IObjectHandle Net.Pkcs11Interop.HighLevelAPI40.Session.CreateObject ( List< IObjectAttribute attributes)

Creates a new object

Parameters
attributesObject attributes
Returns
Handle of created object

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Decrypt() [1/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Decrypt ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  encryptedData 
)

Decrypts single-part data

Parameters
mechanismDecryption mechanism
keyHandleHandle of the decryption key
encryptedDataData to be decrypted
Returns
Decrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Decrypt() [2/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Decrypt ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream 
)

Decrypts multi-part data

Parameters
mechanismDecryption mechanism
keyHandleHandle of the decryption key
inputStreamInput stream from which encrypted data should be read
outputStreamOutput stream where decrypted data should be written

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Decrypt() [3/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Decrypt ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Decrypts multi-part data

Parameters
mechanismDecryption mechanism
keyHandleHandle of the decryption key
inputStreamInput stream from which encrypted data should be read
outputStreamOutput stream where decrypted data should be written
bufferLengthSize of read buffer in bytes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DecryptDigest() [1/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.DecryptDigest ( IMechanism  digestingMechanism,
IMechanism  decryptionMechanism,
IObjectHandle  keyHandle,
byte []  data,
out byte []  digest,
out byte []  decryptedData 
)

Digests and decrypts data

Parameters
digestingMechanismDigesting mechanism
decryptionMechanismDecryption mechanism
keyHandleHandle of the decryption key
dataData to be processed
digestDigest
decryptedDataDecrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DecryptDigest() [2/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.DecryptDigest ( IMechanism  digestingMechanism,
IMechanism  decryptionMechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream 
)

Digests and decrypts data

Parameters
digestingMechanismDigesting mechanism
decryptionMechanismDecryption mechanism
keyHandleHandle of the decryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where decrypted data should be written
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DecryptDigest() [3/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.DecryptDigest ( IMechanism  digestingMechanism,
IMechanism  decryptionMechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Digests and decrypts data

Parameters
digestingMechanismDigesting mechanism
decryptionMechanismDecryption mechanism
keyHandleHandle of the decryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where decrypted data should be written
bufferLengthSize of read buffer in bytes
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DecryptVerify() [1/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.DecryptVerify ( IMechanism  verificationMechanism,
IObjectHandle  verificationKeyHandle,
IMechanism  decryptionMechanism,
IObjectHandle  decryptionKeyHandle,
byte []  data,
byte []  signature,
out byte []  decryptedData,
out bool  isValid 
)

Decrypts data and verifies a signature of data

Parameters
verificationMechanismVerification mechanism
verificationKeyHandleHandle of the verification key
decryptionMechanismDecryption mechanism
decryptionKeyHandleHandle of the decryption key
dataData to be processed
signatureSignature
decryptedDataDecrypted data
isValidFlag indicating whether signature is valid

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DecryptVerify() [2/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.DecryptVerify ( IMechanism  verificationMechanism,
IObjectHandle  verificationKeyHandle,
IMechanism  decryptionMechanism,
IObjectHandle  decryptionKeyHandle,
Stream  inputStream,
Stream  outputStream,
byte []  signature,
out bool  isValid 
)

Decrypts data and verifies a signature of data

Parameters
verificationMechanismVerification mechanism
verificationKeyHandleHandle of the verification key
decryptionMechanismDecryption mechanism
decryptionKeyHandleHandle of the decryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where decrypted data should be written
signatureSignature
isValidFlag indicating whether signature is valid

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DecryptVerify() [3/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.DecryptVerify ( IMechanism  verificationMechanism,
IObjectHandle  verificationKeyHandle,
IMechanism  decryptionMechanism,
IObjectHandle  decryptionKeyHandle,
Stream  inputStream,
Stream  outputStream,
byte []  signature,
out bool  isValid,
int  bufferLength 
)

Decrypts data and verifies a signature of data

Parameters
verificationMechanismVerification mechanism
verificationKeyHandleHandle of the verification key
decryptionMechanismDecryption mechanism
decryptionKeyHandleHandle of the decryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where decrypted data should be written
signatureSignature
isValidFlag indicating whether signature is valid
bufferLengthSize of read buffer in bytes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DeriveKey()

IObjectHandle Net.Pkcs11Interop.HighLevelAPI40.Session.DeriveKey ( IMechanism  mechanism,
IObjectHandle  baseKeyHandle,
List< IObjectAttribute attributes 
)

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

Parameters
mechanismDerivation mechanism
baseKeyHandleHandle of base key
attributesAttributes for the new key
Returns
Handle of derived key

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DestroyObject()

void Net.Pkcs11Interop.HighLevelAPI40.Session.DestroyObject ( IObjectHandle  objectHandle)

Destroys an object

Parameters
objectHandleHandle of object to be destroyed

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Digest() [1/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Digest ( IMechanism  mechanism,
byte []  data 
)

Digests single-part data

Parameters
mechanismDigesting mechanism
dataData to be digested
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Digest() [2/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Digest ( IMechanism  mechanism,
Stream  inputStream 
)

Digests multi-part data

Parameters
mechanismDigesting mechanism
inputStreamInput stream from which data should be read
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Digest() [3/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Digest ( IMechanism  mechanism,
Stream  inputStream,
int  bufferLength 
)

Digests multi-part data

Parameters
mechanismDigesting mechanism
inputStreamInput stream from which data should be read
bufferLengthSize of read buffer in bytes
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DigestEncrypt() [1/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.DigestEncrypt ( IMechanism  digestingMechanism,
IMechanism  encryptionMechanism,
IObjectHandle  keyHandle,
byte []  data,
out byte []  digest,
out byte []  encryptedData 
)

Digests and encrypts data

Parameters
digestingMechanismDigesting mechanism
encryptionMechanismEncryption mechanism
keyHandleHandle of the encryption key
dataData to be processed
digestDigest
encryptedDataEncrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DigestEncrypt() [2/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.DigestEncrypt ( IMechanism  digestingMechanism,
IMechanism  encryptionMechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream 
)

Digests and encrypts data

Parameters
digestingMechanismDigesting mechanism
encryptionMechanismEncryption mechanism
keyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DigestEncrypt() [3/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.DigestEncrypt ( IMechanism  digestingMechanism,
IMechanism  encryptionMechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Digests and encrypts data

Parameters
digestingMechanismDigesting mechanism
encryptionMechanismEncryption mechanism
keyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
bufferLengthSize of read buffer in bytes
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ DigestKey()

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.DigestKey ( IMechanism  mechanism,
IObjectHandle  keyHandle 
)

Digests the value of a secret key

Parameters
mechanismDigesting mechanism
keyHandleHandle of the secret key to be digested
Returns
Digest

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Dispose() [1/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Dispose ( )

Disposes object

◆ Dispose() [2/2]

virtual void Net.Pkcs11Interop.HighLevelAPI40.Session.Dispose ( bool  disposing)
protectedvirtual

Disposes object

Parameters
disposingFlag indicating whether managed resources should be disposed

◆ Encrypt() [1/3]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Encrypt ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  data 
)

Encrypts single-part data

Parameters
mechanismEncryption mechanism
keyHandleHandle of the encryption key
dataData to be encrypted
Returns
Encrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Encrypt() [2/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Encrypt ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream 
)

Encrypts multi-part data

Parameters
mechanismEncryption mechanism
keyHandleHandle of the encryption key
inputStreamInput stream from which data to be encrypted should be read
outputStreamOutput stream where encrypted data should be written

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Encrypt() [3/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Encrypt ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Encrypts multi-part data

Parameters
mechanismEncryption mechanism
keyHandleHandle of the encryption key
inputStreamInput stream from which data to be encrypted should be read
outputStreamOutput stream where encrypted data should be written
bufferLengthSize of read buffer in bytes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ FindAllObjects()

List<IObjectHandle> Net.Pkcs11Interop.HighLevelAPI40.Session.FindAllObjects ( List< IObjectAttribute attributes)

Searches for all token and session objects that match provided attributes

Parameters
attributesAttributes that should be matched
Returns
Handles of found objects

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ FindObjects()

List<IObjectHandle> Net.Pkcs11Interop.HighLevelAPI40.Session.FindObjects ( int  objectCount)

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

Parameters
objectCountMaximum number of object handles to be returned
Returns
Found object handles

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ FindObjectsFinal()

void Net.Pkcs11Interop.HighLevelAPI40.Session.FindObjectsFinal ( )

Terminates a search for token and session objects

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ FindObjectsInit()

void Net.Pkcs11Interop.HighLevelAPI40.Session.FindObjectsInit ( List< IObjectAttribute attributes)

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

Parameters
attributesAttributes that should be matched

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GenerateKey()

IObjectHandle Net.Pkcs11Interop.HighLevelAPI40.Session.GenerateKey ( IMechanism  mechanism,
List< IObjectAttribute attributes 
)

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

Parameters
mechanismGeneration mechanism
attributesAttributes of the new key or set of domain parameters
Returns
Handle of the new key or set of domain parameters

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GenerateKeyPair()

void Net.Pkcs11Interop.HighLevelAPI40.Session.GenerateKeyPair ( IMechanism  mechanism,
List< IObjectAttribute publicKeyAttributes,
List< IObjectAttribute privateKeyAttributes,
out IObjectHandle  publicKeyHandle,
out IObjectHandle  privateKeyHandle 
)

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

Parameters
mechanismKey generation mechanism
publicKeyAttributesAttributes of the public key
privateKeyAttributesAttributes of the private key
publicKeyHandleHandle of the new public key
privateKeyHandleHandle of the new private key

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GenerateRandom()

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.GenerateRandom ( int  length)

Generates random or pseudo-random data

Parameters
lengthLength in bytes of the random or pseudo-random data to be generated
Returns
Generated random or pseudo-random data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GetAttributeValue() [1/2]

List<IObjectAttribute> Net.Pkcs11Interop.HighLevelAPI40.Session.GetAttributeValue ( IObjectHandle  objectHandle,
List< CKA attributes 
)

Obtains the value of one or more attributes of an object

Parameters
objectHandleHandle of object whose attributes should be read
attributesList of attributes that should be read
Returns
Object attributes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GetAttributeValue() [2/2]

List<IObjectAttribute> Net.Pkcs11Interop.HighLevelAPI40.Session.GetAttributeValue ( IObjectHandle  objectHandle,
List< ulong >  attributes 
)

Obtains the value of one or more attributes of an object

Parameters
objectHandleHandle of object whose attributes should be read
attributesList of attributes that should be read
Returns
Object attributes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GetFunctionStatus()

void Net.Pkcs11Interop.HighLevelAPI40.Session.GetFunctionStatus ( )

Legacy function which should throw CKR_FUNCTION_NOT_PARALLEL

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GetObjectSize()

ulong Net.Pkcs11Interop.HighLevelAPI40.Session.GetObjectSize ( IObjectHandle  objectHandle)

Gets the size of an object in bytes.

Parameters
objectHandleHandle of object
Returns
Size of an object in bytes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GetOperationState()

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.GetOperationState ( )

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

Returns
Operations state of a session

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ GetSessionInfo()

ISessionInfo Net.Pkcs11Interop.HighLevelAPI40.Session.GetSessionInfo ( )

Obtains information about a session

Returns
Information about a session

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ InitPin() [1/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.InitPin ( string  userPin)

Initializes the normal user's PIN

Parameters
userPinPin value

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ InitPin() [2/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.InitPin ( byte []  userPin)

Initializes the normal user's PIN

Parameters
userPinPin value

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Login() [1/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Login ( CKU  userType,
string  pin 
)

Logs a user into a token

Parameters
userTypeType of user
pinPin of user

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Login() [2/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Login ( CKU  userType,
byte []  pin 
)

Logs a user into a token

Parameters
userTypeType of user
pinPin of user

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Logout()

void Net.Pkcs11Interop.HighLevelAPI40.Session.Logout ( )

Logs a user out from a token

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SeedRandom()

void Net.Pkcs11Interop.HighLevelAPI40.Session.SeedRandom ( byte []  seed)

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

Parameters
seedSeed material

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SetAttributeValue()

void Net.Pkcs11Interop.HighLevelAPI40.Session.SetAttributeValue ( IObjectHandle  objectHandle,
List< IObjectAttribute attributes 
)

Modifies the value of one or more attributes of an object

Parameters
objectHandleHandle of object whose attributes should be modified
attributesList of attributes that should be modified

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SetOperationState()

void Net.Pkcs11Interop.HighLevelAPI40.Session.SetOperationState ( byte []  state,
IObjectHandle  encryptionKey,
IObjectHandle  authenticationKey 
)

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

Parameters
stateArray of bytes obtained with GetOperationState
encryptionKeyCK_INVALID_HANDLE or handle to the key which will be used for an ongoing encryption or decryption operation in the restored session
authenticationKeyCK_INVALID_HANDLE or handle to the key which will be used for an ongoing signature, MACing, or verification operation in the restored session

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SetPin() [1/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.SetPin ( string  oldPin,
string  newPin 
)

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

Parameters
oldPinOld PIN value
newPinNew PIN value

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SetPin() [2/2]

void Net.Pkcs11Interop.HighLevelAPI40.Session.SetPin ( byte []  oldPin,
byte []  newPin 
)

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

Parameters
oldPinOld PIN value
newPinNew PIN value

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [1/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  data,
bool  performLogin,
byte []  keyPin 
)
protected

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
dataData to be signed
performLoginFlag indicating whether context specific login should be performed
keyPinContext specific signature pin
Returns
Signature

◆ Sign() [2/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  data 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
dataData to be signed
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [3/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
string  keyPin,
byte []  data 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
dataData to be signed
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [4/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  keyPin,
byte []  data 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
dataData to be signed
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [5/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
inputStreamInput stream from which data should be read
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [6/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
string  keyPin,
Stream  inputStream 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
inputStreamInput stream from which data should be read
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [7/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  keyPin,
Stream  inputStream 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
inputStreamInput stream from which data should be read
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [8/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
int  bufferLength,
bool  performLogin,
byte []  keyPin 
)
protected

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
inputStreamInput stream from which data should be read
bufferLengthSize of read buffer in bytes
performLoginFlag indicating whether context specific login should be performed
keyPinContext specific signature pin
Returns
Signature

◆ Sign() [9/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
int  bufferLength 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
inputStreamInput stream from which data should be read
bufferLengthSize of read buffer in bytes
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [10/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
string  keyPin,
Stream  inputStream,
int  bufferLength 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
inputStreamInput stream from which data should be read
bufferLengthSize of read buffer in bytes
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Sign() [11/11]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.Sign ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  keyPin,
Stream  inputStream,
int  bufferLength 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
inputStreamInput stream from which data should be read
bufferLengthSize of read buffer in bytes
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [1/10]

void Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
byte []  data,
out byte []  signature,
out byte []  encryptedData 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
dataData to be processed
signatureSignature
encryptedDataEncrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [2/10]

void Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
string  signingKeyPin,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
byte []  data,
out byte []  signature,
out byte []  encryptedData 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
signingKeyPinContext specific signature pin
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
dataData to be processed
signatureSignature
encryptedDataEncrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [3/10]

void Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
byte []  signingKeyPin,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
byte []  data,
out byte []  signature,
out byte []  encryptedData 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
signingKeyPinContext specific signature pin
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
dataData to be processed
signatureSignature
encryptedDataEncrypted data

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [4/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [5/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
string  signingKeyPin,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
signingKeyPinContext specific signature pin
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [6/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
byte []  signingKeyPin,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
signingKeyPinContext specific signature pin
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [7/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength,
bool  performLogin,
byte []  signingKeyPin 
)
protected

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
bufferLengthSize of read buffer in bytes
performLoginFlag indicating whether context specific login should be performed
signingKeyPinContext specific signature pin
Returns
Signature

◆ SignEncrypt() [8/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
bufferLengthSize of read buffer in bytes
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [9/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
string  signingKeyPin,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
signingKeyPinContext specific signature pin
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
bufferLengthSize of read buffer in bytes
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignEncrypt() [10/10]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignEncrypt ( IMechanism  signingMechanism,
IObjectHandle  signingKeyHandle,
byte []  signingKeyPin,
IMechanism  encryptionMechanism,
IObjectHandle  encryptionKeyHandle,
Stream  inputStream,
Stream  outputStream,
int  bufferLength 
)

Signs and encrypts data

Parameters
signingMechanismSigning mechanism
signingKeyHandleHandle of the signing key
signingKeyPinContext specific signature pin
encryptionMechanismEncryption mechanism
encryptionKeyHandleHandle of the encryption key
inputStreamInput stream from which data to be processed should be read
outputStreamOutput stream where encrypted data should be written
bufferLengthSize of read buffer in bytes
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignRecover() [1/4]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignRecover ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  data,
bool  performLogin,
byte []  keyPin 
)
protected

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
dataData to be signed
performLoginFlag indicating whether context specific login should be performed
keyPinContext specific signature pin
Returns
Signature

◆ SignRecover() [2/4]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignRecover ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  data 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
dataData to be signed
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignRecover() [3/4]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignRecover ( IMechanism  mechanism,
IObjectHandle  keyHandle,
string  keyPin,
byte []  data 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
dataData to be signed
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ SignRecover() [4/4]

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.SignRecover ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  keyPin,
byte []  data 
)

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

Parameters
mechanismSignature mechanism
keyHandleSignature key
keyPinContext specific signature pin
dataData to be signed
Returns
Signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ UnwrapKey()

IObjectHandle Net.Pkcs11Interop.HighLevelAPI40.Session.UnwrapKey ( IMechanism  mechanism,
IObjectHandle  unwrappingKeyHandle,
byte []  wrappedKey,
List< IObjectAttribute attributes 
)

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

Parameters
mechanismUnwrapping mechanism
unwrappingKeyHandleHandle of unwrapping key
wrappedKeyWrapped key
attributesAttributes for unwrapped key
Returns
Handle of unwrapped key

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Verify() [1/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Verify ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  data,
byte []  signature,
out bool  isValid 
)

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

Parameters
mechanismVerification mechanism;
keyHandleVerification key
dataData that was signed
signatureSignature
isValidFlag indicating whether signature is valid

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Verify() [2/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Verify ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
byte []  signature,
out bool  isValid 
)

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

Parameters
mechanismVerification mechanism;
keyHandleVerification key
inputStreamInput stream from which data that was signed should be read
signatureSignature
isValidFlag indicating whether signature is valid

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ Verify() [3/3]

void Net.Pkcs11Interop.HighLevelAPI40.Session.Verify ( IMechanism  mechanism,
IObjectHandle  keyHandle,
Stream  inputStream,
byte []  signature,
out bool  isValid,
int  bufferLength 
)

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

Parameters
mechanismVerification mechanism;
keyHandleVerification key
inputStreamInput stream from which data that was signed should be read
signatureSignature
isValidFlag indicating whether signature is valid
bufferLengthSize of read buffer in bytes

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ VerifyRecover()

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.VerifyRecover ( IMechanism  mechanism,
IObjectHandle  keyHandle,
byte []  signature,
out bool  isValid 
)

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

Parameters
mechanismVerification mechanism;
keyHandleVerification key
signatureSignature
isValidFlag indicating whether signature is valid
Returns
Data recovered from the signature

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

◆ WrapKey()

byte [] Net.Pkcs11Interop.HighLevelAPI40.Session.WrapKey ( IMechanism  mechanism,
IObjectHandle  wrappingKeyHandle,
IObjectHandle  keyHandle 
)

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

Parameters
mechanismWrapping mechanism
wrappingKeyHandleHandle of wrapping key
keyHandleHandle of key to be wrapped
Returns
Wrapped key

Implements Net.Pkcs11Interop.HighLevelAPI.ISession.

Member Data Documentation

◆ _closeWhenDisposed

bool Net.Pkcs11Interop.HighLevelAPI40.Session._closeWhenDisposed = true
protected

Flag indicating whether session should be closed when object is disposed

◆ _disposed

bool Net.Pkcs11Interop.HighLevelAPI40.Session._disposed = false
protected

Flag indicating whether instance has been disposed

◆ _factories

Pkcs11InteropFactories Net.Pkcs11Interop.HighLevelAPI40.Session._factories = null
protected

Factories to be used by Developer and Pkcs11Interop library

◆ _pkcs11Library

LowLevelAPI40.Pkcs11Library Net.Pkcs11Interop.HighLevelAPI40.Session._pkcs11Library = null
protected

Low level PKCS#11 wrapper

◆ _sessionId

NativeULong Net.Pkcs11Interop.HighLevelAPI40.Session._sessionId = CK.CK_INVALID_HANDLE
protected

PKCS#11 handle of session

Property Documentation

◆ CloseWhenDisposed

bool Net.Pkcs11Interop.HighLevelAPI40.Session.CloseWhenDisposed
getset

Flag indicating whether session should be closed when object is disposed

◆ Factories

Pkcs11InteropFactories Net.Pkcs11Interop.HighLevelAPI40.Session.Factories
get

Factories to be used by Developer and Pkcs11Interop library

◆ SessionId

ulong Net.Pkcs11Interop.HighLevelAPI40.Session.SessionId
get

PKCS#11 handle of session


The documentation for this class was generated from the following file: