public void Login(CKU userType, string pin)
{
if (this._disposed)
throw new ObjectDisposedException(this.GetType().FullName);
byte[] pinValue = null;
ulong pinValueLen = 0;
if (pin != null)
{
pinValue = ConvertUtils.Utf8StringToBytes(pin);
pinValueLen = Convert.ToUInt64(pinValue.Length);
}
CKR rv = _p11.C_Login(_sessionId, userType, pinValue, pinValueLen);
if (rv != CKR.CKR_OK)
throw new Pkcs11Exception("C_Login", rv);
}