Net.Pkcs11Interop.HighLevelAPI.Pkcs11.GetInfo C# (CSharp) Method

GetInfo() public method

Gets general information about loaded PKCS#11 library
public GetInfo ( ) : LibraryInfo
return LibraryInfo
        public LibraryInfo GetInfo()
        {
            if (this._disposed)
                throw new ObjectDisposedException(this.GetType().FullName);

            if (Platform.UnmanagedLongSize == 4)
            {
                if (Platform.StructPackingSize == 0)
                    return new LibraryInfo(_p11_40.GetInfo());
                else
                    return new LibraryInfo(_p11_41.GetInfo());
            }
            else
            {
                if (Platform.StructPackingSize == 0)
                    return new LibraryInfo(_p11_80.GetInfo());
                else
                    return new LibraryInfo(_p11_81.GetInfo());
            }
        }

Usage Example

        public void _01_BasicGetInfoTest()
        {
            using (Pkcs11 pkcs11 = new Pkcs11(Settings.Pkcs11LibraryPath, Settings.UseOsLocking))
            {
                LibraryInfo libraryInfo = pkcs11.GetInfo();

                // Do something interesting with library information
                Assert.IsFalse(String.IsNullOrEmpty(libraryInfo.ManufacturerId));
            }
        }
All Usage Examples Of Net.Pkcs11Interop.HighLevelAPI.Pkcs11::GetInfo