Exemplo n.º 1
0
        /// <summary>
        /// Obtains information about a particular mechanism possibly supported by a token
        /// </summary>
        /// <param name="mechanism">Mechanism</param>
        /// <returns>Information about mechanism</returns>
        public MechanismInfo GetMechanismInfo(CKM mechanism)
        {
            CK_MECHANISM_INFO mechanismInfo = new CK_MECHANISM_INFO();
            CKR rv = _p11.C_GetMechanismInfo(_slotId, mechanism, ref mechanismInfo);

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

            return(new MechanismInfo(mechanism, mechanismInfo));
        }