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 具有下列預設屬性值:

屬性 預設值
ContentInfo 內容類型:1.2.840.113549.1.7.1 (資料)
長度:零
ContentEncryptionAlgorithm 1.2.840.113549.3.7 (RSA_DES_EDE3_CBC) 或 2.16.840.1.1.101.3.4.42 (AES-256-CBC)

收件者的預設值 SubjectIdentifierTypeIssuerAndSerialNumber

在.NET Framework上,預設對稱加密演算法是由建置應用程式可執行檔所依據之.NET Framework版本所決定。 從 .NET Framework 4.8 開始,預設演算法是 CBC 模式中的 AES-256;在舊版中,預設值為 TripleDES (CBC 模式中的 DES3-EDE) 。

在 .NET Core 上,預設對稱加密演算法是由載入的 System.Security.Cryptography.Pkcs 元件版本所決定。 從 System.Security.Cryptography.Pkcs NuGet 套件的 4.6.0 版開始,預設演算法在 CBC 模式中為 AES-256;在舊版中,預設為 TripleDES (CBC 模式中的 DES3-EDE) 。

適用於

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;在舊版中,預設值為 TripleDES (CBC 模式中的 DES3-EDE) 。

在 .NET Core 上,預設對稱加密演算法是由載入的 System.Security.Cryptography.Pkcs 元件版本所決定。 從 System.Security.Cryptography.Pkcs NuGet 套件的 4.6.0 版開始,預設演算法在 CBC 模式中為 AES-256;在舊版中,預設為 TripleDES (CBC 模式中的 DES3-EDE) 。

另請參閱

適用於

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;在舊版中,預設值為 TripleDES (CBC 模式中的 DES3-EDE) 。

在 .NET Core 上,預設對稱加密演算法是由載入的 System.Security.Cryptography.Pkcs 元件版本所決定。 從 System.Security.Cryptography.Pkcs NuGet 套件的 4.6.0 版開始,預設演算法在 CBC 模式中為 AES-256;在舊版中,預設為 TripleDES (CBC 模式中的 DES3-EDE) 。

另請參閱

適用於

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

適用於