コード例 #1
0
        public static CspProviderInfoCollection GetProviderInfo()
        {
            if (!CryptographyUtils.TestCNGCompat())
            {
                throw new PlatformNotSupportedException();
            }

            var csps = new CCspInformations();

            csps.AddAvailableCsps();
            var retValue = new CspProviderInfoCollection();

            retValue.AddRange((from ICspInformation csp in csps select new CspProviderInfo(csp)).ToArray());
            CryptographyUtils.ReleaseCom(csps);
            return(retValue);
        }
コード例 #2
0
        public static CspProviderInfoCollection GetProviderInfo(String name)
        {
            if (!CryptographyUtils.TestCNGCompat())
            {
                throw new PlatformNotSupportedException();
            }

            var csps = new CCspInformations();

            csps.AddAvailableCsps();
            var retValue = new CspProviderInfoCollection {
                new CspProviderInfo(csps.ItemByName[name])
            };

            CryptographyUtils.ReleaseCom(csps);
            return(retValue);
        }