示例#1
0
        /// <summary>
        /// Obtains information about a particular token in the system.
        /// </summary>
        /// <returns>Token information</returns>
        public TokenInfo GetTokenInfo()
        {
            CK_TOKEN_INFO tokenInfo = new CK_TOKEN_INFO();
            CKR           rv        = _p11.C_GetTokenInfo(_slotId, ref tokenInfo);

            if (rv != CKR.CKR_OK)
            {
                throw new Pkcs11Exception("C_GetTokenInfo", rv);
            }

            return(new TokenInfo(_slotId, tokenInfo));
        }
示例#2
0
        /// <summary>
        /// Obtains information about a particular token in the system.
        /// </summary>
        /// <returns>Token information</returns>
        public ITokenInfo GetTokenInfo()
        {
            _logger.Debug("Slot({0})::GetTokenInfo", _slotId);

            CK_TOKEN_INFO tokenInfo = new CK_TOKEN_INFO();
            CKR           rv        = _p11.C_GetTokenInfo(_slotId, ref tokenInfo);

            if (rv != CKR.CKR_OK)
            {
                throw new Pkcs11Exception("C_GetTokenInfo", rv);
            }

            return(new TokenInfo(_slotId, tokenInfo));
        }