Net.Pkcs11Interop.HighLevelAPI81.MechanismParams.CkAesCtrParams.CkAesCtrParams C# (CSharp) Method

CkAesCtrParams() public method

Initializes a new instance of the CkAesCtrParams class.
public CkAesCtrParams ( ulong counterBits, byte cb ) : System
counterBits ulong The number of bits in the counter block (cb) that shall be incremented
cb byte Specifies the counter block (16 bytes)
return System
        public CkAesCtrParams(ulong counterBits, byte[] cb)
        {
            _lowLevelStruct.CounterBits = 0;
            _lowLevelStruct.Cb = new byte[16];

            _lowLevelStruct.CounterBits = counterBits;

            if (cb == null)
                throw new ArgumentNullException("cb");
            
            if (cb.Length != 16)
                throw new ArgumentOutOfRangeException("cb", "Array has to be 16 bytes long");

            Array.Copy(cb, _lowLevelStruct.Cb, cb.Length);
        }