EnvelopedCms 构造函数

定义

初始化 EnvelopedCms 类的新实例。

重载

EnvelopedCms()

使用默认值初始化 EnvelopedCms 类的新实例。

EnvelopedCms(ContentInfo)

使用指定的内容信息初始化 EnvelopedCms 类的新实例。

EnvelopedCms(ContentInfo, AlgorithmIdentifier)

使用指定的对称加密算法和内容信息初始化 EnvelopedCms 类的新实例。

EnvelopedCms(SubjectIdentifierType, ContentInfo)

在通过 UI 选择收件人时,使用指定的内容信息和使用者标识符方案初始化 EnvelopedCms 类的新实例。

EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier)

在通过 UI 选择收件人时,使用指定的对称加密算法、内容信息和使用者标识符方案初始化 EnvelopedCms 类的新实例。

EnvelopedCms()

使用默认值初始化 EnvelopedCms 类的新实例。

public:
 EnvelopedCms();
public EnvelopedCms ();
Public Sub New ()

注解

EnvelopedCms 类具有以下默认属性值:

properties 默认值
ContentInfo 内容类型:1.2.840.113549.1.7.1 (数据)
长度:零
ContentEncryptionAlgorithm 1.2.840.113549.3.7 (RSA_DES_EDE3_CBC) 或 2.16.840.1.101.3.4.1.42 (AES-256-CBC)

收件人的默认值 SubjectIdentifierTypeIssuerAndSerialNumber

在.NET Framework,默认对称加密算法由生成应用程序可执行文件的.NET Framework版本确定。 从 .NET Framework 4.8 开始,默认算法在 CBC 模式下为 AES-256;在早期版本中,默认算法为 CBC 模式下的 DES3-EDE (DES3-EDE) 。

在 .NET Core 上,默认对称加密算法由加载的 System.Security.Cryptography.Pkcs 程序集的版本决定。 从 System.Security.Cryptography.Pkcs NuGet 包的 4.6.0 版本开始,默认算法是 CBC 模式下的 AES-256;在早期版本中,默认值为 TripleDES (DES3-EDE) CBC 模式下。

适用于

EnvelopedCms(ContentInfo)

使用指定的内容信息初始化 EnvelopedCms 类的新实例。

public:
 EnvelopedCms(System::Security::Cryptography::Pkcs::ContentInfo ^ contentInfo);
public EnvelopedCms (System.Security.Cryptography.Pkcs.ContentInfo contentInfo);
new System.Security.Cryptography.Pkcs.EnvelopedCms : System.Security.Cryptography.Pkcs.ContentInfo -> System.Security.Cryptography.Pkcs.EnvelopedCms
Public Sub New (contentInfo As ContentInfo)

参数

contentInfo
ContentInfo

要加密的消息内容。

例外

contentInfo 参数为 null

注解

收件人的默认值 SubjectIdentifierTypeIssuerAndSerialNumber

在.NET Framework,默认对称加密算法由生成应用程序可执行文件的.NET Framework版本确定。 从 .NET Framework 4.8 开始,默认算法在 CBC 模式下为 AES-256;在早期版本中,默认算法为 CBC 模式下的 DES3-EDE (DES3-EDE) 。

在 .NET Core 上,默认对称加密算法由加载的 System.Security.Cryptography.Pkcs 程序集的版本决定。 从 System.Security.Cryptography.Pkcs NuGet 包的 4.6.0 版本开始,默认算法是 CBC 模式下的 AES-256;在早期版本中,默认值为 TripleDES (DES3-EDE) CBC 模式下。

另请参阅

适用于

EnvelopedCms(ContentInfo, AlgorithmIdentifier)

使用指定的对称加密算法和内容信息初始化 EnvelopedCms 类的新实例。

public:
 EnvelopedCms(System::Security::Cryptography::Pkcs::ContentInfo ^ contentInfo, System::Security::Cryptography::Pkcs::AlgorithmIdentifier ^ encryptionAlgorithm);
public EnvelopedCms (System.Security.Cryptography.Pkcs.ContentInfo contentInfo, System.Security.Cryptography.Pkcs.AlgorithmIdentifier encryptionAlgorithm);
new System.Security.Cryptography.Pkcs.EnvelopedCms : System.Security.Cryptography.Pkcs.ContentInfo * System.Security.Cryptography.Pkcs.AlgorithmIdentifier -> System.Security.Cryptography.Pkcs.EnvelopedCms
Public Sub New (contentInfo As ContentInfo, encryptionAlgorithm As AlgorithmIdentifier)

参数

contentInfo
ContentInfo

要加密的消息内容。

encryptionAlgorithm
AlgorithmIdentifier

加密消息内容时要使用的对称加密算法的标识符。

例外

contentInfoencryptionAlgorithm 参数为 null

注解

收件人的默认值 SubjectIdentifierTypeIssuerAndSerialNumber

另请参阅

适用于

EnvelopedCms(SubjectIdentifierType, ContentInfo)

在通过 UI 选择收件人时,使用指定的内容信息和使用者标识符方案初始化 EnvelopedCms 类的新实例。

public:
 EnvelopedCms(System::Security::Cryptography::Pkcs::SubjectIdentifierType recipientIdentifierType, System::Security::Cryptography::Pkcs::ContentInfo ^ contentInfo);
public EnvelopedCms (System.Security.Cryptography.Pkcs.SubjectIdentifierType recipientIdentifierType, System.Security.Cryptography.Pkcs.ContentInfo contentInfo);
new System.Security.Cryptography.Pkcs.EnvelopedCms : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.Pkcs.ContentInfo -> System.Security.Cryptography.Pkcs.EnvelopedCms
Public Sub New (recipientIdentifierType As SubjectIdentifierType, contentInfo As ContentInfo)

参数

recipientIdentifierType
SubjectIdentifierType

枚举值之一,它指定要用于通过 UI 提示符选择的收件人证书的使用者标识符方案。

contentInfo
ContentInfo

要加密的消息内容。

例外

contentInfo 参数为 null

注解

在.NET Framework,默认对称加密算法由生成应用程序可执行文件的.NET Framework版本确定。 从 .NET Framework 4.8 开始,默认算法在 CBC 模式下为 AES-256;在早期版本中,默认算法为 CBC 模式下的 DES3-EDE (DES3-EDE) 。

在 .NET Core 上,默认对称加密算法由加载的 System.Security.Cryptography.Pkcs 程序集的版本决定。 从 System.Security.Cryptography.Pkcs NuGet 包的 4.6.0 版本开始,默认算法是 CBC 模式下的 AES-256;在早期版本中,默认值为 TripleDES (DES3-EDE) CBC 模式下。

另请参阅

适用于

EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier)

在通过 UI 选择收件人时,使用指定的对称加密算法、内容信息和使用者标识符方案初始化 EnvelopedCms 类的新实例。

public:
 EnvelopedCms(System::Security::Cryptography::Pkcs::SubjectIdentifierType recipientIdentifierType, System::Security::Cryptography::Pkcs::ContentInfo ^ contentInfo, System::Security::Cryptography::Pkcs::AlgorithmIdentifier ^ encryptionAlgorithm);
public EnvelopedCms (System.Security.Cryptography.Pkcs.SubjectIdentifierType recipientIdentifierType, System.Security.Cryptography.Pkcs.ContentInfo contentInfo, System.Security.Cryptography.Pkcs.AlgorithmIdentifier encryptionAlgorithm);
new System.Security.Cryptography.Pkcs.EnvelopedCms : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.Pkcs.ContentInfo * System.Security.Cryptography.Pkcs.AlgorithmIdentifier -> System.Security.Cryptography.Pkcs.EnvelopedCms
Public Sub New (recipientIdentifierType As SubjectIdentifierType, contentInfo As ContentInfo, encryptionAlgorithm As AlgorithmIdentifier)

参数

recipientIdentifierType
SubjectIdentifierType

枚举值之一,它指定要用于通过 UI 提示符选择的收件人证书的使用者标识符方案。

contentInfo
ContentInfo

要加密的消息内容。

encryptionAlgorithm
AlgorithmIdentifier

加密消息内容时要使用的对称加密算法的标识符。

例外

contentInfoencryptionAlgorithm 参数为 null

适用于