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