Net.Pkcs11Interop.HighLevelAPI81.Session.GetOperationState C# (CSharp) Method

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[]
        public byte[] GetOperationState()
        {
            if (this._disposed)
                throw new ObjectDisposedException(this.GetType().FullName);

            ulong operationStateLen = 0;
            CKR rv = _p11.C_GetOperationState(_sessionId, null, ref operationStateLen);
            if (rv != CKR.CKR_OK)
                throw new Pkcs11Exception("C_GetOperationState", rv);

            byte[] operationState = new byte[operationStateLen];
            rv = _p11.C_GetOperationState(_sessionId, operationState, ref operationStateLen);
            if (rv != CKR.CKR_OK)
                throw new Pkcs11Exception("C_GetOperationState", rv);

            return operationState;
        }