5 types derived from RSA
System.Security.Cryptography (5)
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (1)
16public sealed partial class RSAOpenSsl : RSA, IRuntimeAlgorithm
System\Security\Cryptography\Cng.NotSupported.cs (1)
333public sealed partial class RSACng : RSA
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (1)
10public sealed partial class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm, IRuntimeAlgorithm
System\Security\Cryptography\RSAOpenSsl.cs (1)
10public sealed partial class RSAOpenSsl : RSA
System\Security\Cryptography\RSAWrapper.cs (1)
10internal sealed class RSAWrapper : RSA
268 references to RSA
dotnet-dev-certs (7)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
36using var key = c.GetRSAPrivateKey();
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\TrustDriver.cs (1)
141public abstract GenericXmlSecurityToken GetIssuedToken(RequestSecurityTokenResponse rstr, string expectedTokenType, ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies, RSA clientKey);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSTrust.cs (1)
493ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies, RSA clientKey)
HttpStress (2)
Program.cs (2)
396using (RSA rsa = RSA.Create())
IIS.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (4)
26var parentKey = CreateKeyMaterial(2048); 93private RSA CreateKeyMaterial(int minimumKeySize) 95var rsa = RSA.Create(minimumKeySize);
IIS.LongTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (4)
26var parentKey = CreateKeyMaterial(2048); 93private RSA CreateKeyMaterial(int minimumKeySize) 95var rsa = RSA.Create(minimumKeySize);
IIS.NewHandler.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (4)
26var parentKey = CreateKeyMaterial(2048); 93private RSA CreateKeyMaterial(int minimumKeySize) 95var rsa = RSA.Create(minimumKeySize);
IIS.NewShim.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (4)
26var parentKey = CreateKeyMaterial(2048); 93private RSA CreateKeyMaterial(int minimumKeySize) 95var rsa = RSA.Create(minimumKeySize);
IIS.ShadowCopy.Tests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (4)
26var parentKey = CreateKeyMaterial(2048); 93private RSA CreateKeyMaterial(int minimumKeySize) 95var rsa = RSA.Create(minimumKeySize);
IISExpress.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (4)
26var parentKey = CreateKeyMaterial(2048); 93private RSA CreateKeyMaterial(int minimumKeySize) 95var rsa = RSA.Create(minimumKeySize);
InMemory.FunctionalTests (14)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (14)
151RSA publicKey, 167internal X509Certificate2 CreateEndEntity(string subject, RSA publicKey, X509ExtensionCollection extensions) 176internal X509Certificate2 CreateOcspSigner(string subject, RSA publicKey) 225using (RSA rsa = _cert.GetRSAPrivateKey()) 239RSA publicKey, 340using (RSA key = _cert.GetRSAPrivateKey()) 478using (RSA key = _cert.GetRSAPrivateKey()) 630using (RSA rsa = responder.GetRSAPrivateKey()) 817using (RSA rootKey = RSA.Create(keySize)) 818using (RSA eeKey = RSA.Create(keySize)) 856using RSA intermediateKey = RSA.Create(keySize);
Microsoft.AspNetCore.Authentication.Test (2)
src\Shared\test\Certificates\Certificates.cs (2)
80using (var key = RSA.Create(2048))
Microsoft.AspNetCore.DataProtection (1)
XmlEncryption\EncryptedXmlDecryptor.cs (1)
156using (var privateKey = keyDecryptionCert.GetRSAPrivateKey())
Microsoft.AspNetCore.DeveloperCertificates.XPlat (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
CertificateManagerTests.cs (1)
303using var privateKey = httpsCertificate.GetRSAPrivateKey();
Microsoft.AspNetCore.HttpOverrides.Tests (2)
src\Shared\test\Certificates\Certificates.cs (2)
80using (var key = RSA.Create(2048))
Microsoft.AspNetCore.Server.Kestrel.Core (9)
Internal\Certificates\CertificateConfigLoader.cs (2)
105using var rsa = RSA.Create();
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
36using var key = c.GetRSAPrivateKey();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (14)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (14)
151RSA publicKey, 167internal X509Certificate2 CreateEndEntity(string subject, RSA publicKey, X509ExtensionCollection extensions) 176internal X509Certificate2 CreateOcspSigner(string subject, RSA publicKey) 225using (RSA rsa = _cert.GetRSAPrivateKey()) 239RSA publicKey, 340using (RSA key = _cert.GetRSAPrivateKey()) 478using (RSA key = _cert.GetRSAPrivateKey()) 630using (RSA rsa = responder.GetRSAPrivateKey()) 817using (RSA rootKey = RSA.Create(keySize)) 818using (RSA eeKey = RSA.Create(keySize)) 856using RSA intermediateKey = RSA.Create(keySize);
Microsoft.AspNetCore.Testing (3)
FakeSslCertificateFactory.cs (3)
16private static readonly RSA _rsa = GenerateRsa(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 47internal static RSA GenerateRsa(bool runsOnWindows) 54: RSA.Create();
Microsoft.Build.Tasks.Core (9)
ManifestUtil\mansign2.cs (8)
525rsaCsp.ImportParameters(((RSA)snKey).ExportParameters(false)); 724RSA rsaPrivateKey = signer.Certificate.GetRSAPrivateKey(); 736var rsaCsp = rsaPrivateKey is RSACryptoServiceProvider ? 961RSA snKey = signer.StrongNameKey as RSA; 980if (!(signer.StrongNameKey is RSA)) 1115RSA rsa = strongNameKey as RSA;
ManifestUtil\SecurityUtil.cs (1)
684using (RSA rsa = cert.GetRSAPrivateKey())
Microsoft.CodeAnalysis (2)
PEWriter\SigningUtilities.cs (2)
24using (var rsa = RSA.Create())
Microsoft.CodeAnalysis.Test.Utilities (2)
Metadata\ILValidation.cs (2)
100using (var rsa = RSA.Create())
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
908[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSA))]
netstandard (1)
netstandard.cs (1)
1912[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSA))]
PresentationUI (1)
MS\Internal\Documents\DocumentSignatureManager.cs (1)
489using (RSA rsa = x509Certificate2.GetRSAPrivateKey())
System.Security.Cryptography (76)
System\Security\Cryptography\RSA.Create.OpenSsl.cs (1)
8public static new partial RSA Create()
System\Security\Cryptography\RSA.cs (14)
19public static new partial RSA Create(); 23public static new RSA? Create(string algName) 25return (RSA?)CryptoConfig.CreateFromName(algName); 29public static RSA Create(int keySizeInBits) 31RSA rsa = Create(); 46public static RSA Create(RSAParameters parameters) 48RSA rsa = Create(); 166RSA rsa, 253RSA rsa, 462RSA rsa, 568RSA rsa, 1334static bool Export(RSA alg, Span<byte> destination, out int bytesWritten) 1380static bool Export(RSA alg, Span<byte> destination, out int bytesWritten) 1403private delegate bool TryFunc<TState>(RSA rsa, ReadOnlySpan<byte> input, byte[] destination, TState state, out int bytesWritten);
System\Security\Cryptography\RSA.Xml.cs (1)
20SR.Format(SR.Cryptography_InvalidFromXmlString, nameof(RSA), name));
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (2)
14private readonly RSA _impl; 27_impl = RSA.Create(dwKeySize);
System\Security\Cryptography\RSAOAEPKeyExchangeDeformatter.cs (3)
8private RSA? _rsaKey; 15_rsaKey = (RSA)key; 36_rsaKey = (RSA)key;
System\Security\Cryptography\RSAOAEPKeyExchangeFormatter.cs (3)
9private RSA? _rsaKey; 17_rsaKey = (RSA)key; 59_rsaKey = (RSA)key;
System\Security\Cryptography\RSAPKCS1KeyExchangeDeformatter.cs (3)
10private RSA? _rsaKey; 19_rsaKey = (RSA)key; 46_rsaKey = (RSA)key;
System\Security\Cryptography\RSAPKCS1KeyExchangeFormatter.cs (3)
10private RSA? _rsaKey; 19_rsaKey = (RSA)key; 40_rsaKey = (RSA)key;
System\Security\Cryptography\RSAPKCS1SignatureDeformatter.cs (3)
12private RSA? _rsaKey; 20_rsaKey = (RSA)key; 27_rsaKey = (RSA)key;
System\Security\Cryptography\RSAPKCS1SignatureFormatter.cs (3)
12private RSA? _rsaKey; 21_rsaKey = (RSA)key; 28_rsaKey = (RSA)key;
System\Security\Cryptography\RSAWrapper.cs (2)
12private readonly RSA _wrapped; 14internal RSAWrapper(RSA wrapped)
System\Security\Cryptography\X509Certificates\CertificateExtensionsCommon.cs (3)
27if (typeof(T) == typeof(RSA) || typeof(T) == typeof(DSA)) 60if (typeof(T) == typeof(RSA)) 78if (typeof(T) == typeof(RSA))
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (5)
129public CertificateRequest(string subjectName, RSA key, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 163RSA key, 515RSA? rsa = _key as RSA; 710RSA? rsa = issuerCertificate.GetRSAPrivateKey();
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (1)
295RSA? rsa = publicKey.GetRSAPublicKey();
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (1)
190RSA? rsa = issuerCertificate.GetRSAPrivateKey();
System\Security\Cryptography\X509Certificates\ICertificatePal.cs (2)
30RSA? GetRSAPrivateKey(); 38ICertificatePal CopyWithPrivateKey(RSA privateKey);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (2)
551public RSA? GetRSAPrivateKey() 680public ICertificatePal CopyWithPrivateKey(RSA privateKey)
System\Security\Cryptography\X509Certificates\PublicKey.cs (4)
157/// Gets the <see cref="RSA" /> public key, or <see langword="null" /> if the key is not an RSA key. 166public RSA? GetRSAPublicKey() 171RSA rsa = RSA.Create();
System\Security\Cryptography\X509Certificates\RSACertificateExtensions.cs (9)
9/// Provides extension methods for retrieving <see cref="RSA" /> implementations for the 15/// Gets the <see cref="RSA" /> public key from the certificate or null if the certificate does not have an RSA public key. 17public static RSA? GetRSAPublicKey(this X509Certificate2 certificate) 19return certificate.GetPublicKey<RSA>(); 23/// Gets the <see cref="RSA" /> private key from the certificate or null if the certificate does not have an RSA private key. 25public static RSA? GetRSAPrivateKey(this X509Certificate2 certificate) 27return certificate.GetPrivateKey<RSA>(); 30public static X509Certificate2 CopyWithPrivateKey(this X509Certificate2 certificate, RSA privateKey) 38using (RSA? publicKey = GetRSAPublicKey(certificate))
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (3)
11private readonly RSA _key; 13internal RSAPkcs1X509SignatureGenerator(RSA key) 30internal static PublicKey BuildPublicKey(RSA rsa)
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (2)
12private readonly RSA _key; 15internal RSAPssX509SignatureGenerator(RSA key, RSASignaturePadding padding)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (5)
575using (RSA? pubRsa = this.GetRSAPublicKey()) 953Oids.Rsa => ExtractKeyFromPem<RSA>(keyPem, s_RsaPublicKeyPrivateKeyLabels, RSA.Create, certificate.CopyWithPrivateKey), 1024Oids.Rsa => ExtractKeyFromEncryptedPem<RSA>(keyPem, password, RSA.Create, certificate.CopyWithPrivateKey),
System\Security\Cryptography\X509Certificates\X509SignatureGenerator.cs (1)
23public static X509SignatureGenerator CreateForRSA(RSA key, RSASignaturePadding signaturePadding)
System.Security.Cryptography.Algorithms (1)
System.Security.Cryptography.Algorithms.cs (1)
38[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSA))]
System.Security.Cryptography.Cose (12)
System\Security\Cryptography\Cose\CoseHelpers.cs (4)
120return SignHashWithRSA((RSA)key, hasher, signer.HashAlgorithm, signer.RSASignaturePadding, destination); 145private static int SignHashWithRSA(RSA key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, Span<byte> destination) 280_ => throw new CryptographicException(SR.Format(SR.Sign1AlgDoesNotMatchWithTheOnesSupportedByTypeOfKey, algorithm, typeof(RSA))) 303RSA => KeyType.RSA,
System\Security\Cryptography\Cose\CoseSign1Message.cs (2)
759var rsa = (RSA)key;
System\Security\Cryptography\Cose\CoseSignature.cs (2)
469var rsa = (RSA)key;
System\Security\Cryptography\Cose\CoseSigner.cs (4)
46/// <paramref name="key"/> is <see cref="RSA"/>, use <see cref="CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap?, CoseHeaderMap?)"/> to specify a signature padding. 70if (key is RSA) 104public CoseSigner(RSA key, RSASignaturePadding signaturePadding, HashAlgorithmName hashAlgorithm, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null)
System.Security.Cryptography.Pkcs (15)
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (1)
79if (typeof(T) == typeof(RSA))
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (2)
47RSA? key = privateKey as RSA;
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (5)
35internal byte[]? DecryptCek(X509Certificate2? cert, RSA? privateKey, out Exception? exception) 65RSA? privateKey, 99using (RSA? rsa = cert.GetRSAPrivateKey()) 171using (RSA rsa = recipient.Certificate.GetRSAPublicKey()!) 181RSA? privateKey,
System\Security\Cryptography\Pkcs\CmsSignature.RSA.cs (6)
44return (key as RSA) != null; 75RSA? publicKey = certificate.GetRSAPublicKey(); 112RSA certPublicKey = certificate.GetRSAPublicKey()!; 115RSA? privateKey = key as RSA ?? 116PkcsPal.Instance.GetPrivateKeyForSigning<RSA>(certificate, silent) ??
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
111RSA? privateKey,
System.Security.Cryptography.Xml (14)
System\Security\Cryptography\Xml\EncryptedXml.cs (8)
437return EncryptedXml.DecryptKey(encryptedKey.CipherData.CipherValue, (RSA)kek, fOAEP); 447using (RSA? privateKey = certificate.GetRSAPrivateKey()) 532if (!(keyObject is SymmetricAlgorithm) && !(keyObject is RSA)) 557using (RSA? rsaPublicKey = certificate.GetRSAPublicKey()) 612RSA rsa = (encryptionKey as RSA)!; 947public static byte[] EncryptKey(byte[] keyData, RSA rsa, bool useOAEP) 1000public static byte[] DecryptKey(byte[] keyData, RSA rsa, bool useOAEP)
System\Security\Cryptography\Xml\RSAKeyValue.cs (4)
10private RSA _key; 18_key = RSA.Create(); 21public RSAKeyValue(RSA key) 35public RSA Key
System\Security\Cryptography\Xml\RSAPKCS1SignatureDescription.cs (1)
12KeyAlgorithm = typeof(RSA).AssemblyQualifiedName;
System\Security\Cryptography\Xml\SignedXml.cs (1)
409else if (key is RSA)
System.ServiceModel.Primitives (17)
System\IdentityModel\Claims\Claim.cs (1)
151public static Claim CreateRsaClaim(RSA rsa)
System\IdentityModel\Tokens\X509AsymmetricSecurityKey.cs (11)
146if ((PrivateKey as RSA) != null) 148return (PrivateKey as RSA); 176if ((PublicKey as RSA) != null) 178return (PublicKey as RSA); 281RSA rsa = (PublicKey as RSA); 356RSA rsa = (PrivateKey as RSA); 366RSA rsaSha256 = (privateKey as RSA); 437return (PublicKey is RSA);
System\ServiceModel\RsaEndpointIdentity.cs (5)
26RSA rsa = certificate.GetRSAPublicKey(); 65RSA rsa = (RSA)this.IdentityClaim.Resource; 73private static RSA ToRsa(string keyString) 78RSA rsa = new RSACryptoServiceProvider();
Templates.Blazor.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
Templates.Blazor.WebAssembly.Auth.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
Templates.Blazor.WebAssembly.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
Templates.Mvc.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);
Templates.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
523RSA? key = null; 552key = RSA.Create(); 777using var key = CreateKeyMaterial(RSAMinimumKeySizeInBits); 788static RSA CreateKeyMaterial(int minimumKeySize) 790var rsa = RSA.Create(minimumKeySize);