Pkcs12Builder.SealWithMac 方法

定义

重载

SealWithMac(ReadOnlySpan<Char>, HashAlgorithmName, Int32)

密封 PFX 以防止进一步的更改,方法是使用范围中的密码将基于密码的消息验证代码 (MAC) 应用于内容。

SealWithMac(String, HashAlgorithmName, Int32)

密封 PFX 以防止进一步的更改,方法是使用字符串中的密码将基于密码的消息验证代码 (MAC) 应用于内容。

SealWithMac(ReadOnlySpan<Char>, HashAlgorithmName, Int32)

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

密封 PFX 以防止进一步的更改,方法是使用范围中的密码将基于密码的消息验证代码 (MAC) 应用于内容。

public:
 void SealWithMac(ReadOnlySpan<char> password, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, int iterationCount);
public void SealWithMac (ReadOnlySpan<char> password, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int iterationCount);
member this.SealWithMac : ReadOnlySpan<char> * System.Security.Cryptography.HashAlgorithmName * int -> unit
Public Sub SealWithMac (password As ReadOnlySpan(Of Char), hashAlgorithm As HashAlgorithmName, iterationCount As Integer)

参数

password
ReadOnlySpan<Char>

用作计算 MAC 的密钥的密码。

hashAlgorithm
HashAlgorithmName

计算 MAC 时要使用的哈希算法。

iterationCount
Int32

用于计算 MAC 的密钥派生函数 (KDF) 的迭代计数。

例外

iterationCount 参数小于或等于 0。

PFX 已密封(IsSealedtrue)。

注解

此方法接受的任何哈希算法都可以由 Pkcs12Info 类处理。 某些哈希算法选择可能会导致某些操作系统或操作系统上的X509Certificate2X509Certificate2Collection.Import故障,因为这些方法依赖于系统库的支持。

通过 Export 导出为 PKCS#12 PFX 时,在全新安装 Windows 7 上使用的哈希算法的迭代计数为 SHA1 2000。 由于 SHA1 的冲突问题,Microsoft 建议使用基于 SHA256 或更高版本的安全模型;但是,某些 PFX 读取器可能仅支持 SHA1。

适用于

SealWithMac(String, HashAlgorithmName, Int32)

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

密封 PFX 以防止进一步的更改,方法是使用字符串中的密码将基于密码的消息验证代码 (MAC) 应用于内容。

public:
 void SealWithMac(System::String ^ password, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, int iterationCount);
public void SealWithMac (string? password, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int iterationCount);
public void SealWithMac (string password, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int iterationCount);
member this.SealWithMac : string * System.Security.Cryptography.HashAlgorithmName * int -> unit
Public Sub SealWithMac (password As String, hashAlgorithm As HashAlgorithmName, iterationCount As Integer)

参数

password
String

用作计算 MAC 的密钥的密码。

hashAlgorithm
HashAlgorithmName

计算 MAC 时要使用的哈希算法。

iterationCount
Int32

用于计算 MAC 的密钥派生函数 (KDF) 的迭代计数。

例外

iterationCount 参数小于或等于 0。

PFX 已密封(IsSealedtrue)。

注解

此方法接受的任何哈希算法都可以由 Pkcs12Info 类处理。 某些哈希算法选择可能会导致某些操作系统或操作系统上的X509Certificate2X509Certificate2Collection.Import故障,因为这些方法依赖于系统库的支持。

通过 X509Certificate.Export 导出为 PKCS#12 PFX 时,在全新安装 Windows 7 上使用的哈希算法的迭代计数为 SHA1 2000。 由于 SHA1 的冲突问题,Microsoft 建议使用基于 SHA256 或更高版本的安全模型;但是,某些 PFX 读取器可能仅支持 SHA1。

适用于