RSA.Encrypt 方法 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| Encrypt(Byte[], RSAEncryptionPadding) | 在派生类中被重写时,使用指定的填充模式加密输入数据。 | 
| Encrypt(ReadOnlySpan<Byte>, RSAEncryptionPadding) | 使用指定的填充模式对输入数据进行加密。 | 
| Encrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding) | 使用指定的填充模式对输入数据进行加密。 | 
Encrypt(Byte[], RSAEncryptionPadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
在派生类中被重写时,使用指定的填充模式加密输入数据。
public:
 virtual cli::array <System::Byte> ^ Encrypt(cli::array <System::Byte> ^ data, System::Security::Cryptography::RSAEncryptionPadding ^ padding);public:
 abstract cli::array <System::Byte> ^ Encrypt(cli::array <System::Byte> ^ data, System::Security::Cryptography::RSAEncryptionPadding ^ padding);public virtual byte[] Encrypt(byte[] data, System.Security.Cryptography.RSAEncryptionPadding padding);public abstract byte[] Encrypt(byte[] data, System.Security.Cryptography.RSAEncryptionPadding padding);abstract member Encrypt : byte[] * System.Security.Cryptography.RSAEncryptionPadding -> byte[]
override this.Encrypt : byte[] * System.Security.Cryptography.RSAEncryptionPadding -> byte[]abstract member Encrypt : byte[] * System.Security.Cryptography.RSAEncryptionPadding -> byte[]Public Overridable Function Encrypt (data As Byte(), padding As RSAEncryptionPadding) As Byte()Public MustOverride Function Encrypt (data As Byte(), padding As RSAEncryptionPadding) As Byte()参数
- data
- Byte[]
要加密的数据。
- padding
- RSAEncryptionPadding
填充模式。
返回
已加密的数据。
例外
              data 或 padding 为 null。
派生方法必须重写此方法。
另请参阅
适用于
Encrypt(ReadOnlySpan<Byte>, RSAEncryptionPadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
使用指定的填充模式对输入数据进行加密。
public:
 cli::array <System::Byte> ^ Encrypt(ReadOnlySpan<System::Byte> data, System::Security::Cryptography::RSAEncryptionPadding ^ padding);public byte[] Encrypt(ReadOnlySpan<byte> data, System.Security.Cryptography.RSAEncryptionPadding padding);member this.Encrypt : ReadOnlySpan<byte> * System.Security.Cryptography.RSAEncryptionPadding -> byte[]Public Function Encrypt (data As ReadOnlySpan(Of Byte), padding As RSAEncryptionPadding) As Byte()参数
- data
- ReadOnlySpan<Byte>
要加密的数据。
- padding
- RSAEncryptionPadding
填充模式。
返回
已加密的数据。
例外
              padding 为 null。
此实现尚未实现 或 TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)之Encrypt(Byte[], RSAEncryptionPadding)一。
另请参阅
- Encrypt(Byte[], RSAEncryptionPadding)
- Encrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding)
- TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)
适用于
Encrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
使用指定的填充模式对输入数据进行加密。
public:
 int Encrypt(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::RSAEncryptionPadding ^ padding);public int Encrypt(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding);member this.Encrypt : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.RSAEncryptionPadding -> intPublic Function Encrypt (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), padding As RSAEncryptionPadding) As Integer参数
- data
- ReadOnlySpan<Byte>
要加密的数据。
- padding
- RSAEncryptionPadding
填充模式。
返回
写入 destination 的总字节数。
例外
              padding 为 null。
中的 destination 缓冲区太小,无法保存加密的数据。
此实现尚未实现 或 TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)之Encrypt(Byte[], RSAEncryptionPadding)一。
另请参阅
- Encrypt(Byte[], RSAEncryptionPadding)
- Encrypt(ReadOnlySpan<Byte>, RSAEncryptionPadding)
- TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)