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

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
        public void Login(CKU userType, byte[] pin)
        {
            if (this._disposed)
                throw new ObjectDisposedException(this.GetType().FullName);

            byte[] pinValue = null;
            ulong pinValueLen = 0;
            if (pin != null)
            {
                pinValue = pin;
                pinValueLen = Convert.ToUInt64(pin.Length);
            }
            
            CKR rv = _p11.C_Login(_sessionId, userType, pinValue, pinValueLen);
            if (rv != CKR.CKR_OK)
                throw new Pkcs11Exception("C_Login", rv);
        }

Same methods

Session::Login ( CKU userType, string pin ) : void