EnvelopedCms EnvelopedCms EnvelopedCms EnvelopedCms Class

定義

EnvelopedCms 類別,表示包裹資料的 CMS/PKCS #7 結構。The EnvelopedCms class represents a CMS/PKCS #7 structure for enveloped data.

public ref class EnvelopedCms sealed
public sealed class EnvelopedCms
type EnvelopedCms = class
Public NotInheritable Class EnvelopedCms
繼承
EnvelopedCmsEnvelopedCmsEnvelopedCmsEnvelopedCms

備註

密碼編譯訊息語法 RFC 與這些內容的型別,指定 CMS/PKCS #7 訊息的檔案名稱副檔名與下列 MIME 類型。The Cryptographic Message Syntax RFC specifies the following MIME types and file name extensions for CMS/PKCS #7 messages with these content types.

內容類型Content type MIME 類型MIME type 副檔名Extension
envelopedDataenvelopedData application/pkcs7-mimeapplication/pkcs7-mime .p7m.p7m
signedDatasignedData application/pkcs7-signatureapplication/pkcs7-signature .p7s.p7c.p7s.p7c

建構函式

EnvelopedCms() EnvelopedCms() EnvelopedCms() EnvelopedCms()

EnvelopedCms() 建構函式會建立 EnvelopedCms 類別的執行個體。The EnvelopedCms() constructor creates an instance of the EnvelopedCms class.

EnvelopedCms(ContentInfo) EnvelopedCms(ContentInfo) EnvelopedCms(ContentInfo) EnvelopedCms(ContentInfo)

EnvelopedCms(ContentInfo) 建構函式會使用指定的內容資訊做為內部內容類型,建立 EnvelopedCms 類別的執行個體。The EnvelopedCms(ContentInfo) constructor creates an instance of the EnvelopedCms class by using the specified content information as the inner content type.

EnvelopedCms(ContentInfo, AlgorithmIdentifier) EnvelopedCms(ContentInfo, AlgorithmIdentifier) EnvelopedCms(ContentInfo, AlgorithmIdentifier) EnvelopedCms(ContentInfo, AlgorithmIdentifier)

EnvelopedCms(ContentInfo, AlgorithmIdentifier) 建構函式會使用指定的內容資訊和加密演算法,建立 EnvelopedCms 類別的執行個體。The EnvelopedCms(ContentInfo, AlgorithmIdentifier) constructor creates an instance of the EnvelopedCms class by using the specified content information and encryption algorithm. 指定的內容資訊會做為內部內容類型。The specified content information is to be used as the inner content type.

EnvelopedCms(SubjectIdentifierType, ContentInfo) EnvelopedCms(SubjectIdentifierType, ContentInfo) EnvelopedCms(SubjectIdentifierType, ContentInfo) EnvelopedCms(SubjectIdentifierType, ContentInfo)

EnvelopedCms(SubjectIdentifierType, ContentInfo) 建構函式會使用指定的主旨識別項型別和內容資訊,建立 EnvelopedCms 類別的執行個體。The EnvelopedCms(SubjectIdentifierType, ContentInfo) constructor creates an instance of the EnvelopedCms class by using the specified subject identifier type and content information. 指定的內容資訊會做為內部內容類型。The specified content information is to be used as the inner content type.

EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier) EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier) EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier) EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier)

EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier) 建構函式會使用指定的主旨識別項型別、內容資訊和加密演算法,建立 EnvelopedCms 類別的執行個體。The EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier) constructor creates an instance of the EnvelopedCms class by using the specified subject identifier type, content information, and encryption algorithm. 指定的內容資訊會做為內部內容類型。The specified content information is to be used as the inner content type.

屬性

Certificates Certificates Certificates Certificates

Certificates 屬性會擷取與包裹 CMS/PKCS #7 訊息關聯的憑證組。The Certificates property retrieves the set of certificates associated with the enveloped CMS/PKCS #7 message.

ContentEncryptionAlgorithm ContentEncryptionAlgorithm ContentEncryptionAlgorithm ContentEncryptionAlgorithm

ContentEncryptionAlgorithm 屬性會擷取用於加密內容之演算法的識別項。The ContentEncryptionAlgorithm property retrieves the identifier of the algorithm used to encrypt the content.

ContentInfo ContentInfo ContentInfo ContentInfo

ContentInfo 屬性會擷取包裹 CMS/PKCS #7 訊息的內部內容資訊。The ContentInfo property retrieves the inner content information for the enveloped CMS/PKCS #7 message.

RecipientInfos RecipientInfos RecipientInfos RecipientInfos

RecipientInfos 屬性會擷取與包裹 CMS/PKCS #7 訊息關聯的收件者資訊。The RecipientInfos property retrieves the recipient information associated with the enveloped CMS/PKCS #7 message.

UnprotectedAttributes UnprotectedAttributes UnprotectedAttributes UnprotectedAttributes

UnprotectedAttributes 屬性 (property) 會擷取與 CMS/PKCS #7 訊息關聯之未保護的 (未加密) 屬性 (attribute)。The UnprotectedAttributes property retrieves the unprotected (unencrypted) attributes associated with the enveloped CMS/PKCS #7 message. 未保護的屬性不會加密,因此 EnvelopedCms 物件內不會具有資料機密性。Unprotected attributes are not encrypted, and so do not have data confidentiality within an EnvelopedCms object.

Version Version Version Version

Version 屬性會擷取包裹 CMS/PKCS #7 訊息的版本。The Version property retrieves the version of the enveloped CMS/PKCS #7 message.

方法

Decode(Byte[]) Decode(Byte[]) Decode(Byte[]) Decode(Byte[])

Decode(Byte[]) 方法會解碼指定的包裹 CMS/PKCS #7 訊息,並重設 EnvelopedCms 物件中的所有成員變數。The Decode(Byte[]) method decodes the specified enveloped CMS/PKCS #7 message and resets all member variables in the EnvelopedCms object.

Decrypt() Decrypt() Decrypt() Decrypt()

Decrypt() 方法會將解碼之包裹 CMS/PKCS #7 訊息的內容解密。The Decrypt() method decrypts the contents of the decoded enveloped CMS/PKCS #7 message. Decrypt() 方法會在目前的使用者和我的存放區 (My Store) 電腦中,搜尋合適的憑證和私密金鑰。The Decrypt() method searches the current user and computer My stores for the appropriate certificate and private key.

Decrypt(RecipientInfo) Decrypt(RecipientInfo) Decrypt(RecipientInfo) Decrypt(RecipientInfo)

Decrypt(RecipientInfo) 方法會使用與指定的收件者資訊所識別之憑證關聯的私密金鑰,將解碼之包裹 CMS/PKCS #7 訊息的內容解密。The Decrypt(RecipientInfo) method decrypts the contents of the decoded enveloped CMS/PKCS #7 message by using the private key associated with the certificate identified by the specified recipient information.

Decrypt(RecipientInfo, AsymmetricAlgorithm) Decrypt(RecipientInfo, AsymmetricAlgorithm) Decrypt(RecipientInfo, AsymmetricAlgorithm) Decrypt(RecipientInfo, AsymmetricAlgorithm)
Decrypt(RecipientInfo, X509Certificate2Collection) Decrypt(RecipientInfo, X509Certificate2Collection) Decrypt(RecipientInfo, X509Certificate2Collection) Decrypt(RecipientInfo, X509Certificate2Collection)

Decrypt(RecipientInfo, X509Certificate2Collection) 方法會使用與指定之收件者資訊所識別的憑證關聯的私密金鑰,並使用指定的憑證集合,將解碼之包裹 CMS/PKCS #7 訊息的內容解密。The Decrypt(RecipientInfo, X509Certificate2Collection) method decrypts the contents of the decoded enveloped CMS/PKCS #7 message by using the private key associated with the certificate identified by the specified recipient information and by using the specified certificate collection. Decrypt(RecipientInfo, X509Certificate2Collection) 方法會在指定的憑證集合以及我的憑證存放區 (My Certificate Store) 中,搜尋用於解密的適當憑證。The Decrypt(RecipientInfo, X509Certificate2Collection) method searches the specified certificate collection and the My certificate store for the proper certificate to use for the decryption.

Decrypt(X509Certificate2Collection) Decrypt(X509Certificate2Collection) Decrypt(X509Certificate2Collection) Decrypt(X509Certificate2Collection)

Decrypt(X509Certificate2Collection) 方法會使用指定的憑證集合,將解碼之包裹 CMS/PKCS #7 訊息的內容解密。The Decrypt(X509Certificate2Collection) method decrypts the contents of the decoded enveloped CMS/PKCS #7 message by using the specified certificate collection. Decrypt(X509Certificate2Collection) 方法會在指定的憑證集合以及我的憑證存放區 (My Certificate Store) 中,搜尋用於解密的適當憑證。The Decrypt(X509Certificate2Collection) method searches the specified certificate collection and the My certificate store for the proper certificate to use for the decryption.

Encode() Encode() Encode() Encode()

Encode() 方法會將包裹 CMS/PKCS #7 訊息內容編碼,並傳回為位元組值陣列。The Encode() method encodes the contents of the enveloped CMS/PKCS #7 message and returns it as an array of byte values. 加密動作必須在編碼之前完成。Encryption must be done before encoding.

Encrypt() Encrypt() Encrypt() Encrypt()

Encrypt() 方法會加密 CMS/PKCS #7 訊息的內容。The Encrypt() method encrypts the contents of the CMS/PKCS #7 message.

Encrypt(CmsRecipient) Encrypt(CmsRecipient) Encrypt(CmsRecipient) Encrypt(CmsRecipient)

Encrypt(CmsRecipient) 方法會使用指定的收件者資訊將 CMS/PKCS #7 訊息的內容加密。The Encrypt(CmsRecipient) method encrypts the contents of the CMS/PKCS #7 message by using the specified recipient information.

Encrypt(CmsRecipientCollection) Encrypt(CmsRecipientCollection) Encrypt(CmsRecipientCollection) Encrypt(CmsRecipientCollection)

Encrypt(CmsRecipientCollection) 方法會使用指定之收件者清單的資訊,將 CMS/PKCS #7 訊息的內容加密。The Encrypt(CmsRecipientCollection) method encrypts the contents of the CMS/PKCS #7 message by using the information for the specified list of recipients. 使用訊息加密金鑰透過對稱加密演算法 (例如三重 DES),將訊息加密。The message is encrypted by using a message encryption key with a symmetric encryption algorithm such as triple DES. 訊息加密金鑰接著會與各個收件者的公開金鑰一同加密。The message encryption key is then encrypted with the public key of each recipient.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於