2 instantiations of RSASignaturePadding
System.Security.Cryptography (2)
System\Security\Cryptography\RSASignaturePadding.cs (2)
18private static readonly RSASignaturePadding s_pkcs1 = new RSASignaturePadding(RSASignaturePaddingMode.Pkcs1); 19private static readonly RSASignaturePadding s_pss = new RSASignaturePadding(RSASignaturePaddingMode.Pss);
179 references to RSASignaturePadding
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
HttpStress (1)
Program.cs (1)
398var certReq = new CertificateRequest($"CN={LocalhostName}", rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
32RSASignaturePadding.Pkcs1);
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
32RSASignaturePadding.Pkcs1);
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
32RSASignaturePadding.Pkcs1);
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
32RSASignaturePadding.Pkcs1);
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
32RSASignaturePadding.Pkcs1);
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
32RSASignaturePadding.Pkcs1);
InMemory.FunctionalTests (6)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (6)
228X509SignatureGenerator.CreateForRSA(rsa, RSASignaturePadding.Pkcs1), 263RSASignaturePadding.Pkcs1); 344X509SignatureGenerator.CreateForRSA(key, RSASignaturePadding.Pkcs1), 481key.SignData(tbsCertList, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); 635RSASignaturePadding.Pkcs1); 824RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.Authentication.Test (1)
src\Shared\test\Certificates\Certificates.cs (1)
86RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
CertificateManagerTests.cs (1)
304var csr = new CertificateRequest(httpsCertificate.Subject + "Not", privateKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.HttpOverrides.Tests (1)
src\Shared\test\Certificates\Certificates.cs (1)
86RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (6)
228X509SignatureGenerator.CreateForRSA(rsa, RSASignaturePadding.Pkcs1), 263RSASignaturePadding.Pkcs1); 344X509SignatureGenerator.CreateForRSA(key, RSASignaturePadding.Pkcs1), 481key.SignData(tbsCertList, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); 635RSASignaturePadding.Pkcs1); 824RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.Testing (1)
FakeSslCertificateFactory.cs (1)
29RSASignaturePadding.Pkcs1);
Microsoft.CodeAnalysis (1)
PEWriter\SigningUtilities.cs (1)
28var signature = rsa.SignHash(hash, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
Microsoft.CodeAnalysis.Test.Utilities (1)
Metadata\ILValidation.cs (1)
110if (!rsa.VerifyHash(hash, reversedSignature, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1))
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
919[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSASignaturePadding))]
netstandard (1)
netstandard.cs (1)
1923[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSASignaturePadding))]
System.Security.Cryptography (97)
src\libraries\Common\src\System\Security\Cryptography\Asn1\PssParamsAsn.manual.cs (2)
11internal RSASignaturePadding GetSignaturePadding( 61return RSASignaturePadding.Pss;
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (7)
727public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 753RSASignaturePadding padding, 778RSASignaturePadding padding) 786public override bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 852private static void ValidatePadding(RSASignaturePadding padding) 865Debug.Assert(padding == RSASignaturePadding.Pkcs1); 869Debug.Assert(padding == RSASignaturePadding.Pss);
System\Security\Cryptography\RSA.cs (22)
93public virtual byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => throw DerivedClassMustOverride(); 94public virtual bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => throw DerivedClassMustOverride(); 341public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 356public virtual bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => 372public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 384RSASignaturePadding padding) 401public virtual byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 411public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 454/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 456public byte[] SignData(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 465(HashAlgorithmName HashAlgorithm, RSASignaturePadding Padding) state, 513/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 519RSASignaturePadding padding) 560/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 562public byte[] SignHash(ReadOnlySpan<byte> hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 571(HashAlgorithmName HashAlgorithm, RSASignaturePadding Padding) state, 615/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 621RSASignaturePadding padding) 634public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 647RSASignaturePadding padding) 665public bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 676public virtual bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (23)
177public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 181if (padding != RSASignaturePadding.Pkcs1) 191public override byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 195if (padding != RSASignaturePadding.Pkcs1) 205public override bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 209if (padding != RSASignaturePadding.Pkcs1) 220_impl.SignData(buffer, offset, count, CapiHelper.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1); 223_impl.SignData(buffer, CapiHelper.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1); 226_impl.SignData(inputStream, CapiHelper.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1); 228public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 232if (padding != RSASignaturePadding.Pkcs1) 242public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 246if (padding != RSASignaturePadding.Pkcs1) 264return _impl.SignHash(rgbHash, algName, RSASignaturePadding.Pkcs1); 270_impl.VerifyData(buffer, signature, CapiHelper.ObjToHashAlgorithmName(halg), RSASignaturePadding.Pkcs1); 272public override bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 276if (padding != RSASignaturePadding.Pkcs1) 286public override bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 290if (padding != RSASignaturePadding.Pkcs1) 300public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 308public override bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 312if (padding != RSASignaturePadding.Pkcs1) 329CapiHelper.NameOrOidToHashAlgorithmName(str), RSASignaturePadding.Pkcs1);
System\Security\Cryptography\RSAPKCS1SignatureDeformatter.cs (1)
55return _rsaKey.VerifyHash(rgbHash, rgbSignature, new HashAlgorithmName(_algName), RSASignaturePadding.Pkcs1);
System\Security\Cryptography\RSAPKCS1SignatureFormatter.cs (1)
55return _rsaKey.SignHash(rgbHash, new HashAlgorithmName(_algName), RSASignaturePadding.Pkcs1);
System\Security\Cryptography\RSASignaturePadding.cs (11)
16public sealed class RSASignaturePadding : IEquatable<RSASignaturePadding> 18private static readonly RSASignaturePadding s_pkcs1 = new RSASignaturePadding(RSASignaturePaddingMode.Pkcs1); 19private static readonly RSASignaturePadding s_pss = new RSASignaturePadding(RSASignaturePaddingMode.Pss); 31public static RSASignaturePadding Pkcs1 39public static RSASignaturePadding Pss 59return Equals(obj as RSASignaturePadding); 62public bool Equals([NotNullWhen(true)] RSASignaturePadding? other) 67public static bool operator ==(RSASignaturePadding? left, RSASignaturePadding? right) 77public static bool operator !=(RSASignaturePadding? left, RSASignaturePadding? right)
System\Security\Cryptography\RSAWrapper.cs (9)
59RSASignaturePadding padding) => 66RSASignaturePadding padding) => 87RSASignaturePadding padding, 95RSASignaturePadding padding) => 111RSASignaturePadding padding) => 114public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => 121RSASignaturePadding padding, 131RSASignaturePadding padding) => 138RSASignaturePadding padding) =>
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (6)
25private readonly RSASignaturePadding? _rsaPadding; 129public CertificateRequest(string subjectName, RSA key, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 165RSASignaturePadding padding) 224RSASignaturePadding? rsaSignaturePadding = null) 572/// specifying an <see cref="RSASignaturePadding"/> value in the constructor. 623/// which does not accept a <see cref="RSASignaturePadding"/> value.
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (7)
22RSASignaturePadding? signerSignaturePadding = null) 37RSASignaturePadding? signerSignaturePadding = null) 84RSASignaturePadding? signerSignaturePadding = null) 102RSASignaturePadding? signerSignaturePadding = null) 119RSASignaturePadding? signerSignaturePadding) 313RSASignaturePadding padding = pssParams.GetSignaturePadding(); 363return rsa.VerifyData(toBeSigned, signature, hashAlg, RSASignaturePadding.Pkcs1);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (2)
113RSASignaturePadding? rsaSignaturePadding = null, 131RSASignaturePadding? rsaSignaturePadding)
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (1)
22return _key.SignData(data, hashAlgorithm, RSASignaturePadding.Pkcs1);
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (3)
13private readonly RSASignaturePadding _padding; 15internal RSAPssX509SignatureGenerator(RSA key, RSASignaturePadding padding) 30if (_padding != RSASignaturePadding.Pss)
System\Security\Cryptography\X509Certificates\X509SignatureGenerator.cs (2)
23public static X509SignatureGenerator CreateForRSA(RSA key, RSASignaturePadding signaturePadding) 28if (signaturePadding == RSASignaturePadding.Pkcs1)
System.Security.Cryptography.Algorithms (1)
System.Security.Cryptography.Algorithms.cs (1)
48[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSASignaturePadding))]
System.Security.Cryptography.Cose (15)
System\Security\Cryptography\Cose\CoseHelpers.cs (4)
145private static int SignHashWithRSA(RSA key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, Span<byte> destination) 259internal static HashAlgorithmName GetHashAlgorithmFromCoseAlgorithmAndKeyType(int algorithm, KeyType keyType, out RSASignaturePadding? padding) 286padding = RSASignaturePadding.Pkcs1; 291padding = RSASignaturePadding.Pss;
System\Security\Cryptography\Cose\CoseSign1Message.cs (3)
620HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 720HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 741private bool VerifyHash(AsymmetricAlgorithm key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, KeyType keyType, RSASignaturePadding? padding)
System\Security\Cryptography\Cose\CoseSignature.cs (3)
395HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 428HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 451private bool VerifyHash(AsymmetricAlgorithm key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, KeyType keyType, RSASignaturePadding? padding)
System\Security\Cryptography\Cose\CoseSigner.cs (5)
34public RSASignaturePadding? RSASignaturePadding { get; } 46/// <paramref name="key"/> is <see cref="RSA"/>, use <see cref="CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap?, CoseHeaderMap?)"/> to specify a signature padding. 104public CoseSigner(RSA key, RSASignaturePadding signaturePadding, HashAlgorithmName hashAlgorithm, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null) 192if (RSASignaturePadding == RSASignaturePadding.Pss) 203Debug.Assert(RSASignaturePadding == RSASignaturePadding.Pkcs1);
System.Security.Cryptography.Pkcs (31)
src\libraries\Common\src\System\Security\Cryptography\Asn1\PssParamsAsn.manual.cs (2)
11internal RSASignaturePadding GetSignaturePadding( 61return RSASignaturePadding.Pss;
System\Security\Cryptography\Pkcs\CmsSignature.cs (5)
29internal abstract RSASignaturePadding? SignaturePadding { get; } 62RSASignaturePadding? rsaSignaturePadding) 85if (rsaSignaturePadding == RSASignaturePadding.Pkcs1) 90else if (rsaSignaturePadding == RSASignaturePadding.Pss) 124RSASignaturePadding? rsaSignaturePadding,
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (1)
32internal override RSASignaturePadding? SignaturePadding => null;
System\Security\Cryptography\Pkcs\CmsSignature.ECDsa.cs (1)
33internal override RSASignaturePadding? SignaturePadding => null;
System\Security\Cryptography\Pkcs\CmsSignature.RSA.cs (14)
69RSASignaturePadding padding = GetSignaturePadding( 93protected abstract RSASignaturePadding GetSignaturePadding( 109RSASignaturePadding signaturePadding, 171internal override RSASignaturePadding? SignaturePadding => RSASignaturePadding.Pkcs1; 178protected override RSASignaturePadding GetSignaturePadding( 186return RSASignaturePadding.Pkcs1; 193return RSASignaturePadding.Pkcs1; 219RSASignaturePadding.Pkcs1, 287internal override RSASignaturePadding? SignaturePadding => RSASignaturePadding.Pss; 293protected override RSASignaturePadding GetSignaturePadding( 315RSASignaturePadding padding = pssParams.GetSignaturePadding(digestValueLength); 339RSASignaturePadding.Pss,
System\Security\Cryptography\Pkcs\CmsSigner.cs (8)
21private RSASignaturePadding? _signaturePadding; 35public RSASignaturePadding? SignaturePadding 41value != RSASignaturePadding.Pkcs1 && value != RSASignaturePadding.Pss) 112RSASignaturePadding? signaturePadding) 121RSASignaturePadding? signaturePadding) 124signaturePadding != RSASignaturePadding.Pkcs1 && signaturePadding != RSASignaturePadding.Pss)
Templates.Blazor.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Mvc.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Tests (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);