SignerInfo 類別


SignerInfo 類別,表示與 SignedCms 物件 (表示 CMS/PKCS #7 訊息) 關聯的簽署人。The SignerInfo class represents a signer associated with a SignedCms object that represents a CMS/PKCS #7 message.

public ref class SignerInfo sealed
public sealed class SignerInfo
type SignerInfo = class
Public NotInheritable Class SignerInfo


類別所代表的簽章 SignerInfo 可以是透過訊息內容或簽章。The signatures represented by the SignerInfo class can be either over message content or a signature. 後者的簽章類型稱為 副署The latter kind of signature is referred to as a countersignature.

此 CMS/PKCS #7 的執行僅支援一層的副署。This implementation of CMS/PKCS #7 supports only one level of countersignature. 也就是說,簽章可以簽署,這會形成副署,但該副署無法重新簽署。That is, a signature can be signed, which forms a countersignature, but that countersignature cannot be signed again.

這個類別沒有公用的函式;因此,它無法公開具現化。This class does not have a public constructor; therefore, it cannot be publicly instantiated. 它是可從屬性存取的唯讀類別 SignedCms.SignerInfosIt is a read-only class accessible from the SignedCms.SignerInfos property.



Certificate 屬性 (Property) 擷取與簽署人資訊關聯的簽章憑證。The Certificate property retrieves the signing certificate associated with the signer information.


CounterSignerInfos 屬性 (Property) 擷取與簽署人資訊關聯的副簽署人組。The CounterSignerInfos property retrieves the set of counter signers associated with the signer information.


DigestAlgorithm 屬性 (Property),擷取表示用來計算簽章之雜湊演算法的 Oid 物件。The DigestAlgorithm property retrieves the Oid object that represents the hash algorithm used in the computation of the signatures.


取得目前 SignerInfo 物件使用的簽章演算法識別碼。Gets the identifier for the signature algorithm used by the current SignerInfo object.


SignedAttributes 屬性 (Property) 會擷取與簽署人資訊關聯之已簽署屬性 (Attribute) 的 CryptographicAttributeObjectCollection 集合。The SignedAttributes property retrieves the CryptographicAttributeObjectCollection collection of signed attributes that is associated with the signer information. 已簽署的屬性 (Attribute) 是和其餘的訊息內容一起簽署。Signed attributes are signed along with the rest of the message content.


SignerIdentifier 屬性 (Property),擷取與簽署人資訊關聯的簽署人憑證識別項。The SignerIdentifier property retrieves the certificate identifier of the signer associated with the signer information.


UnsignedAttributes 屬性 (Property),擷取與 CryptographicAttributeObjectCollection 內容關聯的未簽署屬性 (Attribute) 的 SignerInfo 集合。The UnsignedAttributes property retrieves the CryptographicAttributeObjectCollection collection of unsigned attributes that is associated with the SignerInfo content. 可在不使簽章失效的情況下修改未簽署的屬性。Unsigned attributes can be modified without invalidating the signature.


Version 屬性 (Property) 擷取簽署人資訊版本。The Version property retrieves the signer information version.



將指定的屬性加入至目前的文件。Adds the specified attribute to the current document.


CheckHash() 方法會驗證 CMS/PKCS #7 訊息簽署人資訊的資料完整性。The CheckHash() method verifies the data integrity of the CMS/PKCS #7 message signer information. CheckHash() 是特定安全性基礎結構應用程式中會使用的特定方法,在這種應用程式中,主體會在設定 CmsSigner 物件時使用 SubjectIdentifierType 列舉的 HashOnly 成員。CheckHash() is a specialized method used in specific security infrastructure applications in which the subject uses the HashOnly member of the SubjectIdentifierType enumeration when setting up a CmsSigner object. CheckHash() 不會驗證簽署人資訊,因為這個方法並不涉及確認數位簽章。CheckHash() does not authenticate the signer information because this method does not involve verifying a digital signature. 如需為一般目的而檢查 CMS/PKCS #7 訊息簽署人資訊和副署的完整性和驗證性 (Authenticity),請使用 CheckSignature(Boolean)CheckSignature(X509Certificate2Collection, Boolean) 方法。For general-purpose checking of the integrity and authenticity of CMS/PKCS #7 message signer information and countersignatures, use the CheckSignature(Boolean) or CheckSignature(X509Certificate2Collection, Boolean) methods.


CheckSignature(Boolean) 方法會驗證 (Verify) 訊息的數位簽章,也可以選擇性地驗證 (Validate) 憑證。The CheckSignature(Boolean) method verifies the digital signature of the message and, optionally, validates the certificate.

CheckSignature(X509Certificate2Collection, Boolean)

CheckSignature(X509Certificate2Collection, Boolean) 方法使用指定的憑證集合來驗證 (Verify) 訊息的數位簽章,也可以選擇性地驗證 (Validate) 憑證。The CheckSignature(X509Certificate2Collection, Boolean) method verifies the digital signature of the message by using the specified collection of certificates and, optionally, validates the certificate.


ComputeCounterSignature() 方法,提示使用者選取簽章憑證、建立副署,以及將簽章加入至 CMS/PKCS #7 訊息。The ComputeCounterSignature() method prompts the user to select a signing certificate, creates a countersignature, and adds the signature to the CMS/PKCS #7 message. 限制副屬為一個層級。Countersignatures are restricted to one level.


ComputeCounterSignature(CmsSigner) 方法使用指定的簽署人建立副署,並將簽章加入至 CMS/PKCS #7 訊息。The ComputeCounterSignature(CmsSigner) method creates a countersignature by using the specified signer and adds the signature to the CMS/PKCS #7 message. 限制副屬為一個層級。Countersignatures are restricted to one level.


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

(繼承來源 Object)

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

(繼承來源 Object)

擷取目前 SignerInfo 物件的簽章。Retrieves the signature for the current SignerInfo object.


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

(繼承來源 Object)

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)

RemoveCounterSignature(Int32) 方法移除 CounterSignerInfos 集合之指定索引的副署。The RemoveCounterSignature(Int32) method removes the countersignature at the specified index of the CounterSignerInfos collection.


RemoveCounterSignature(SignerInfo) 方法移除指定之 SignerInfo 物件的副署。The RemoveCounterSignature(SignerInfo) method removes the countersignature for the specified SignerInfo object.


從目前的文件中移除指定的屬性。Removes the specified attribute from the current document.


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

(繼承來源 Object)