2 instantiations of RSAEncryptionPadding
System.Security.Cryptography (2)
System\Security\Cryptography\RSAEncryptionPadding.cs (2)
16public static RSAEncryptionPadding Pkcs1 { get; } = new RSAEncryptionPadding(RSAEncryptionPaddingMode.Pkcs1, default); 70return new RSAEncryptionPadding(RSAEncryptionPaddingMode.Oaep, hashAlgorithm);
95 references to RSAEncryptionPadding
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (4)
CertificateManagerTests.cs (4)
189Assert.Equal("plaintext", Encoding.ASCII.GetString(exportedCertificate.GetRSAPrivateKey().Decrypt(exportedCertificate.GetRSAPrivateKey().Encrypt(Encoding.ASCII.GetBytes(message), RSAEncryptionPadding.OaepSHA256), RSAEncryptionPadding.OaepSHA256))); 310Assert.Equal("plaintext", Encoding.ASCII.GetString(exportedCertificate.GetRSAPrivateKey().Decrypt(exportedCertificate.GetRSAPrivateKey().Encrypt(Encoding.ASCII.GetBytes(message), RSAEncryptionPadding.OaepSHA256), RSAEncryptionPadding.OaepSHA256)));
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
910[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAEncryptionPadding))]
netstandard (1)
netstandard.cs (1)
1914[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAEncryptionPadding))]
System.Security.Cryptography (70)
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (8)
84public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) 112RSAEncryptionPadding padding, 172RSAEncryptionPadding padding) 206public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) 232public override bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 246RSAEncryptionPadding padding, 860private static void ValidatePadding(RSAEncryptionPadding padding) 872padding != RSAEncryptionPadding.Pkcs1)
System\Security\Cryptography\RSA.cs (22)
91public virtual byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) => throw DerivedClassMustOverride(); 92public virtual byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) => throw DerivedClassMustOverride(); 102public virtual bool TryDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 117public virtual bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 155/// This implementation has not implemented one of <see cref="Encrypt(byte[], RSAEncryptionPadding)" /> or 158/// <seealso cref="Encrypt(byte[], RSAEncryptionPadding)" /> 159/// <seealso cref="Encrypt(ReadOnlySpan{byte}, Span{byte}, RSAEncryptionPadding)" /> 161public byte[] Encrypt(ReadOnlySpan<byte> data, RSAEncryptionPadding padding) 169RSAEncryptionPadding padding, 205/// This implementation has not implemented one of <see cref="Encrypt(byte[], RSAEncryptionPadding)" /> or 208/// <seealso cref="Encrypt(byte[], RSAEncryptionPadding)" /> 209/// <seealso cref="Encrypt(ReadOnlySpan{byte}, RSAEncryptionPadding)" /> 211public int Encrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding) 242/// This implementation has not implemented one of <see cref="Decrypt(byte[], RSAEncryptionPadding)" /> or 245/// <seealso cref="Decrypt(byte[], RSAEncryptionPadding)" /> 246/// <seealso cref="Decrypt(ReadOnlySpan{byte}, Span{byte}, RSAEncryptionPadding)" /> 248public byte[] Decrypt(ReadOnlySpan<byte> data, RSAEncryptionPadding padding) 256RSAEncryptionPadding padding, 288/// This implementation has not implemented one of <see cref="Decrypt(byte[], RSAEncryptionPadding)" /> or 291/// <seealso cref="Decrypt(byte[], RSAEncryptionPadding)" /> 292/// <seealso cref="Decrypt(ReadOnlySpan{byte}, RSAEncryptionPadding)" /> 294public int Decrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding)
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (16)
50return _impl.Decrypt(rgb, fOAEP ? RSAEncryptionPadding.OaepSHA1 : RSAEncryptionPadding.Pkcs1); 53public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) 59padding == RSAEncryptionPadding.Pkcs1 ? Decrypt(data, fOAEP: false) : 60padding == RSAEncryptionPadding.OaepSHA1 ? Decrypt(data, fOAEP: true) : // For compat, this prevents OaepSHA2 options as fOAEP==true will cause Decrypt to use OaepSHA1 64public override bool TryDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 70if (padding != RSAEncryptionPadding.Pkcs1 && padding != RSAEncryptionPadding.OaepSHA1) 89return _impl.Encrypt(rgb, fOAEP ? RSAEncryptionPadding.OaepSHA1 : RSAEncryptionPadding.Pkcs1); 92public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) 98padding == RSAEncryptionPadding.Pkcs1 ? Encrypt(data, fOAEP: false) : 99padding == RSAEncryptionPadding.OaepSHA1 ? Encrypt(data, fOAEP: true) : // For compat, this prevents OaepSHA2 options as fOAEP==true will cause Decrypt to use OaepSHA1 103public override bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 107if (padding != RSAEncryptionPadding.Pkcs1 && padding != RSAEncryptionPadding.OaepSHA1)
System\Security\Cryptography\RSAEncryptionPadding.cs (16)
11public sealed class RSAEncryptionPadding : IEquatable<RSAEncryptionPadding> 16public static RSAEncryptionPadding Pkcs1 { get; } = new RSAEncryptionPadding(RSAEncryptionPaddingMode.Pkcs1, default); 21public static RSAEncryptionPadding OaepSHA1 { get; } = CreateOaep(HashAlgorithmName.SHA1); 26public static RSAEncryptionPadding OaepSHA256 { get; } = CreateOaep(HashAlgorithmName.SHA256); 31public static RSAEncryptionPadding OaepSHA384 { get; } = CreateOaep(HashAlgorithmName.SHA384); 36public static RSAEncryptionPadding OaepSHA512 { get; } = CreateOaep(HashAlgorithmName.SHA512); 41public static RSAEncryptionPadding OaepSHA3_256 { get; } = CreateOaep(HashAlgorithmName.SHA3_256); 46public static RSAEncryptionPadding OaepSHA3_384 { get; } = CreateOaep(HashAlgorithmName.SHA3_384); 51public static RSAEncryptionPadding OaepSHA3_512 { get; } = CreateOaep(HashAlgorithmName.SHA3_512); 66public static RSAEncryptionPadding CreateOaep(HashAlgorithmName hashAlgorithm) 105return Equals(obj as RSAEncryptionPadding); 108public bool Equals([NotNullWhen(true)] RSAEncryptionPadding? other) 115public static bool operator ==(RSAEncryptionPadding? left, RSAEncryptionPadding? right) 125public static bool operator !=(RSAEncryptionPadding? left, RSAEncryptionPadding? right)
System\Security\Cryptography\RSAOAEPKeyExchangeDeformatter.cs (1)
29return _rsaKey.Decrypt(rgbData, RSAEncryptionPadding.OaepSHA1);
System\Security\Cryptography\RSAOAEPKeyExchangeFormatter.cs (1)
72return _rsaKey.Encrypt(rgbData, RSAEncryptionPadding.OaepSHA1);
System\Security\Cryptography\RSAPKCS1KeyExchangeDeformatter.cs (1)
39return _rsaKey.Decrypt(rgbIn, RSAEncryptionPadding.Pkcs1);
System\Security\Cryptography\RSAPKCS1KeyExchangeFormatter.cs (1)
53return _rsaKey.Encrypt(rgbData, RSAEncryptionPadding.Pkcs1);
System\Security\Cryptography\RSAWrapper.cs (4)
52public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) => _wrapped.Encrypt(data, padding); 54public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) => _wrapped.Decrypt(data, padding); 72RSAEncryptionPadding padding, 79RSAEncryptionPadding padding,
System.Security.Cryptography.Algorithms (1)
System.Security.Cryptography.Algorithms.cs (1)
39[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAEncryptionPadding))]
System.Security.Cryptography.Pkcs (18)
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (10)
71RSAEncryptionPadding? encryptionPadding; 76encryptionPadding = RSAEncryptionPadding.Pkcs1; 139RSAEncryptionPadding padding = recipient.RSAEncryptionPadding ?? RSAEncryptionPadding.Pkcs1; 141if (padding == RSAEncryptionPadding.Pkcs1) 146else if (padding == RSAEncryptionPadding.OaepSHA1) 151else if (padding == RSAEncryptionPadding.OaepSHA256) 156else if (padding == RSAEncryptionPadding.OaepSHA384) 161else if (padding == RSAEncryptionPadding.OaepSHA512) 182RSAEncryptionPadding encryptionPadding,
Internal\Cryptography\PkcsHelpers.cs (5)
636[NotNullWhen(true)] out RSAEncryptionPadding? rsaEncryptionPadding, 681rsaEncryptionPadding = RSAEncryptionPadding.OaepSHA1; 684rsaEncryptionPadding = RSAEncryptionPadding.OaepSHA256; 687rsaEncryptionPadding = RSAEncryptionPadding.OaepSHA384; 690rsaEncryptionPadding = RSAEncryptionPadding.OaepSHA512;
System\Security\Cryptography\Pkcs\CmsRecipient.cs (3)
22CmsRecipient(X509Certificate2 certificate, RSAEncryptionPadding rsaEncryptionPadding) 39CmsRecipient(SubjectIdentifierType recipientIdentifierType, X509Certificate2 certificate, RSAEncryptionPadding rsaEncryptionPadding) 80RSAEncryptionPadding? RSAEncryptionPadding { get; }