4 instantiations of CngKey
System.Core (4)
System\Security\Cryptography\CngKey.cs (4)
449CngKey key = new CngKey(kspHandle, keyHandle); 607CngKey key = new CngKey(kspHandle, keyHandle); 716return new CngKey(kspHandle, keyHandle); 749key = new CngKey(kspHandle, keyHandleCopy);
80 references to CngKey
System.Core (78)
System\Security\Cryptography\CngKey.cs (24)
398public static CngKey Create(CngAlgorithm algorithm) { 399Contract.Ensures(Contract.Result<CngKey>() != null); 403public static CngKey Create(CngAlgorithm algorithm, string keyName) { 404Contract.Ensures(Contract.Result<CngKey>() != null); 409public static CngKey Create(CngAlgorithm algorithm, string keyName, CngKeyCreationParameters creationParameters) { 410Contract.Ensures(Contract.Result<CngKey>() != null); 449CngKey key = new CngKey(kspHandle, keyHandle); 551public static CngKey Import(byte[] keyBlob, CngKeyBlobFormat format) { 552Contract.Ensures(Contract.Result<CngKey>() != null); 556internal static CngKey Import(byte[] keyBlob, string curveName, CngKeyBlobFormat format) { 557Contract.Ensures(Contract.Result<CngKey>() != null); 561public static CngKey Import(byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider) { 562Contract.Ensures(Contract.Result<CngKey>() != null); 567internal static CngKey Import(byte[] keyBlob, string curveName, CngKeyBlobFormat format, CngProvider provider) 569Contract.Ensures(Contract.Result<CngKey>() != null); 607CngKey key = new CngKey(kspHandle, keyHandle); 678public static CngKey Open(string keyName) { 679Contract.Ensures(Contract.Result<CngKey>() != null); 683public static CngKey Open(string keyName, CngProvider provider) { 684Contract.Ensures(Contract.Result<CngKey>() != null); 689public static CngKey Open(string keyName, CngProvider provider, CngKeyOpenOptions openOptions) { 690Contract.Ensures(Contract.Result<CngKey>() != null); 724public static CngKey Open(SafeNCryptKeyHandle keyHandle, CngKeyHandleOpenOptions keyHandleOpenOptions) { 746CngKey key = null;
System\Security\Cryptography\ECDiffieHellmanCng.cs (14)
37private CngKey m_key; 69public ECDiffieHellmanCng(CngKey key) { 97Key = CngKey.Open(importHandle, key.IsEphemeral ? CngKeyHandleOpenOptions.EphemeralKey : CngKeyHandleOpenOptions.None); 209public CngKey Key { 211Contract.Ensures(Contract.Result<CngKey>() != null); 212Contract.Ensures(Contract.Result<CngKey>().AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 248m_key = CngKey.Create(algorithm, null, creationParameters); 328using (CngKey import = otherKey.Import()) { 337public byte[] DeriveKeyMaterial(CngKey otherPartyPublicKey) { 503using (CngKey importedKey = otherKey.Import()) { 513public SafeNCryptSecretHandle DeriveSecretAgreementHandle(CngKey otherPartyPublicKey) { 555CngKey newKey = CngKey.Create(curve, name => CngKey.EcdhCurveNameToAlgorithm(name));
System\Security\Cryptography\ECDiffieHellmanCngPublicKey.cs (8)
69using (CngKey imported = CngKey.Import(publicKeyBlob, format)) { 78internal static ECDiffieHellmanCngPublicKey FromKey(CngKey key) { 117public CngKey Import() { 118Contract.Ensures(Contract.Result<CngKey>() != null); 121return CngKey.Import(ToByteArray(), m_curveName, BlobFormat); 148using (CngKey key = Import()) { 163using (CngKey key = Import()) {
System\Security\Cryptography\ECDsaCng.cs (10)
23private CngKey m_key; 51public ECDsaCng(CngKey key) { 78Key = CngKey.Open(keyHandle, key.IsEphemeral ? CngKeyHandleOpenOptions.EphemeralKey : CngKeyHandleOpenOptions.None); 122public CngKey Key { 124Contract.Ensures(Contract.Result<CngKey>() != null); 125Contract.Ensures(IsEccAlgorithmGroup(Contract.Result<CngKey>().AlgorithmGroup)); 161m_key = CngKey.Create(algorithm, null, creationParameters); 433CngKey newKey = CngKey.Create(curve, name => CngKey.EcdsaCurveNameToAlgorithm(name));
System\Security\Cryptography\Rfc4050KeyFormatter.cs (1)
65Contract.Ensures(Contract.Result<CngKey>() != null);
System\Security\Cryptography\RsaCng.cs (9)
22private CngKey _key; 44/// <see cref="CngKey.AlgorithmGroup" /> must be Rsa. 53public RSACng(CngKey key) 64Key = CngKey.Open(key.Handle, key.IsEphemeral ? CngKeyHandleOpenOptions.EphemeralKey : CngKeyHandleOpenOptions.None); 78public CngKey Key 103_key = CngKey.Create(CngAlgorithm.Rsa, null, creationParameters); 391CngKey newKey = CngKey.Import(rsaBlob, publicOnly ? s_rsaPublicBlob : s_rsaPrivateBlob); 479CngKey key = Key;
System\Security\Cryptography\X509Certificates\ECDsaCertificateExtensions.cs (8)
33CngKey key = CngKey.Open(privateKeyHandle, openOptions); 88using (CngKey key = CngKey.Import(keyBlob, blobFormat)) 125CngKey key; 347private static CngKey LegacyBCryptHandleToNCryptHandle(SafeBCryptKeyHandle bcryptKeyHandle) 351CngKey Key = CngKey.Import(keyBlob, CngKeyBlobFormat.EccPublicBlob);
System\Security\Cryptography\X509Certificates\RSACertificateExtensions.cs (4)
51CngKey key = CngKey.Import(cngBlob, CngKeyBlobFormat.GenericPublicBlob); 88CngKey key = CngKey.Open(privateKeyHandle, openOptions);
System.Data (2)
fx\src\data\System\Data\SqlClient\SqlColumnEncryptionCngProvider.cs (2)
394CngKey cngKey; 398cngKey = CngKey.Open(keyIdentifier, cngProvider);