Share via


Pkcs12Builder.AddSafeContentsEncrypted 方法

定义

重载

AddSafeContentsEncrypted(Pkcs12SafeContents, Byte[], PbeParameters)

将内容添加到使用字节数组中基于字节的密码加密的捆绑包中的 PFX。

AddSafeContentsEncrypted(Pkcs12SafeContents, ReadOnlySpan<Byte>, PbeParameters)

将内容添加到使用字节范围中基于字节的密码加密的捆绑包中的 PFX。

AddSafeContentsEncrypted(Pkcs12SafeContents, ReadOnlySpan<Char>, PbeParameters)

将内容添加到使用字节范围中基于字符的密码加密的捆绑包中的 PFX。

AddSafeContentsEncrypted(Pkcs12SafeContents, String, PbeParameters)

将内容添加到使用字符串中基于字符的密码加密的捆绑包中的 PFX。

AddSafeContentsEncrypted(Pkcs12SafeContents, Byte[], PbeParameters)

Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs

将内容添加到使用字节数组中基于字节的密码加密的捆绑包中的 PFX。

public:
 void AddSafeContentsEncrypted(System::Security::Cryptography::Pkcs::Pkcs12SafeContents ^ safeContents, cli::array <System::Byte> ^ passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public void AddSafeContentsEncrypted (System.Security.Cryptography.Pkcs.Pkcs12SafeContents safeContents, byte[]? passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
public void AddSafeContentsEncrypted (System.Security.Cryptography.Pkcs.Pkcs12SafeContents safeContents, byte[] passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddSafeContentsEncrypted : System.Security.Cryptography.Pkcs.Pkcs12SafeContents * byte[] * System.Security.Cryptography.PbeParameters -> unit
Public Sub AddSafeContentsEncrypted (safeContents As Pkcs12SafeContents, passwordBytes As Byte(), pbeParameters As PbeParameters)

参数

safeContents
Pkcs12SafeContents

要添加到 PFX 的内容。

passwordBytes
Byte[]

加密内容时用作密码的字节数组。

pbeParameters
PbeParameters

加密内容时使用的基于密码加密 (PBE) 参数。

例外

safeContentspbeParameters 参数为 null

safeContents 参数值已经过加密。

PFX 已密封(IsSealedtrue)。

pbeParameters 指示应使用需要基于 Char 密码的 TripleDes3KeyPkcs12

注解

密码字节直接传递到由 指示 pbeParameters的算法使用的密钥派生函数 (KDF) 。 当使用 PBKDF2 (基于密码的密钥派生函数 2) 处理密码时,这样可以与使用 UTF-8 以外的文本编码的其他系统兼容。

safeContents的内容在调用此方法期间读取、加密,并在内部存储为加密内容。 在此方法调用后对 Pkcs12SafeContents 或其引用所做的任何 Pkcs12SafeBag 更改都不会反映在最终输出中。

适用于

AddSafeContentsEncrypted(Pkcs12SafeContents, ReadOnlySpan<Byte>, PbeParameters)

Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs

将内容添加到使用字节范围中基于字节的密码加密的捆绑包中的 PFX。

public:
 void AddSafeContentsEncrypted(System::Security::Cryptography::Pkcs::Pkcs12SafeContents ^ safeContents, ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public void AddSafeContentsEncrypted (System.Security.Cryptography.Pkcs.Pkcs12SafeContents safeContents, ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddSafeContentsEncrypted : System.Security.Cryptography.Pkcs.Pkcs12SafeContents * ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> unit
Public Sub AddSafeContentsEncrypted (safeContents As Pkcs12SafeContents, passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters)

参数

safeContents
Pkcs12SafeContents

要添加到 PFX 的内容。

passwordBytes
ReadOnlySpan<Byte>

加密内容时用作密码的字节范围。

pbeParameters
PbeParameters

加密内容时使用的基于密码加密 (PBE) 参数。

例外

safeContentspbeParameters 参数为 null

safeContents 参数值已经过加密。

PFX 已密封(IsSealedtrue)。

pbeParameters 指示应使用需要基于 Char 密码的 TripleDes3KeyPkcs12

注解

密码字节直接传递到由 指示 pbeParameters的算法使用的密钥派生函数 (KDF) 。 当使用 PBKDF2 (基于密码的密钥派生函数 2) 处理密码时,这样可以与使用 UTF-8 以外的文本编码的其他系统兼容。

safeContents的内容在调用此方法期间读取、加密,并在内部存储为加密内容。 在此方法调用后对 Pkcs12SafeContents 或其引用所做的任何 Pkcs12SafeBag 更改都不会反映在最终输出中。

适用于

AddSafeContentsEncrypted(Pkcs12SafeContents, ReadOnlySpan<Char>, PbeParameters)

Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs

将内容添加到使用字节范围中基于字符的密码加密的捆绑包中的 PFX。

public:
 void AddSafeContentsEncrypted(System::Security::Cryptography::Pkcs::Pkcs12SafeContents ^ safeContents, ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public void AddSafeContentsEncrypted (System.Security.Cryptography.Pkcs.Pkcs12SafeContents safeContents, ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddSafeContentsEncrypted : System.Security.Cryptography.Pkcs.Pkcs12SafeContents * ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> unit
Public Sub AddSafeContentsEncrypted (safeContents As Pkcs12SafeContents, password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters)

参数

safeContents
Pkcs12SafeContents

要添加到 PFX 的内容。

password
ReadOnlySpan<Char>

加密内容时用作密码的范围。

pbeParameters
PbeParameters

加密内容时使用的基于密码加密 (PBE) 参数。

例外

safeContentspbeParameters 参数为 null

safeContents 参数值已经过加密。

PFX 已密封(IsSealedtrue)。

注解

pbeParameters 指示使用 PBKDF2 (基于密码的密钥派生函数 2) 的算法时,密码将通过 UTF-8 编码转换为字节。

safeContents的内容在调用此方法期间读取、加密,并在内部存储为加密内容。 在此方法调用后对 Pkcs12SafeContents 或其引用所做的任何 Pkcs12SafeBag 更改都不会反映在最终输出中。

适用于

AddSafeContentsEncrypted(Pkcs12SafeContents, String, PbeParameters)

Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs
Source:
Pkcs12Builder.cs

将内容添加到使用字符串中基于字符的密码加密的捆绑包中的 PFX。

public:
 void AddSafeContentsEncrypted(System::Security::Cryptography::Pkcs::Pkcs12SafeContents ^ safeContents, System::String ^ password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public void AddSafeContentsEncrypted (System.Security.Cryptography.Pkcs.Pkcs12SafeContents safeContents, string? password, System.Security.Cryptography.PbeParameters pbeParameters);
public void AddSafeContentsEncrypted (System.Security.Cryptography.Pkcs.Pkcs12SafeContents safeContents, string password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddSafeContentsEncrypted : System.Security.Cryptography.Pkcs.Pkcs12SafeContents * string * System.Security.Cryptography.PbeParameters -> unit
Public Sub AddSafeContentsEncrypted (safeContents As Pkcs12SafeContents, password As String, pbeParameters As PbeParameters)

参数

safeContents
Pkcs12SafeContents

要添加到 PFX 的内容。

password
String

加密内容时用作密码的字符串。

pbeParameters
PbeParameters

加密内容时使用的基于密码加密 (PBE) 参数。

例外

safeContentspbeParameters 参数为 null

safeContents 参数值已经过加密。

PFX 已密封(IsSealedtrue)。

注解

pbeParameters 指示使用 PBKDF2 (基于密码的密钥派生函数 2) 的算法时,密码将通过 UTF-8 编码转换为字节。

safeContents的内容在调用此方法期间读取、加密,并在内部存储为加密内容。 在此方法调用后对 Pkcs12SafeContents 或其引用所做的任何 Pkcs12SafeBag 更改都不会反映在最终输出中。

适用于