public static CspCNGCollection EnumCNGProviders() { if (!CryptographyUtils.TestCNGCompat()) { throw new PlatformNotSupportedException(); } return(m_enumcngprovs()); }
public static CspObject[] EnumProviders() { if (!CryptographyUtils.TestCNGCompat()) { throw new PlatformNotSupportedException(); } var csps = new CCspInformations(); csps.AddAvailableCsps(); return((from ICspInformation csp in csps select new CspObject(csp)).ToArray()); }
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); }
/// <summary> /// Gets named registered Cryptographic Service Provider (CSP) or Key Storage Provider (KSP), its /// information and supported cryptographic algorithms. /// </summary> /// <param name="name">Cryptographic provider name.</param> /// <exception cref="PlatformNotSupportedException"> /// Current platform does not support key storage providers (prior to Windows Vista). /// </exception> /// <returns>Specified provider information. Method returns null if provider is not found.</returns> public static CspProviderInfo GetProviderInfo(String name) { if (!CryptographyUtils.TestCNGCompat()) { throw new PlatformNotSupportedException(); } var providers = new CCspInformations(); providers.AddAvailableCsps(); try { ICspInformation provider = providers.ItemByName[name]; return(new CspProviderInfo(provider)); } catch { return(null); } }
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); }