SignerInfo.ComputeCounterSignature 方法
定义
创建副署并将签名添加到 CMS/PKCS #7 消息。Creates a countersignature and adds the signature to the CMS/PKCS #7 message.
重载
| ComputeCounterSignature() |
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) |
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. |
ComputeCounterSignature()
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.
public:
void ComputeCounterSignature();
public void ComputeCounterSignature ();
member this.ComputeCounterSignature : unit -> unit
Public Sub ComputeCounterSignature ()
例外
向不接受空引用作为有效参数的方法传递了一个空引用。A null reference was passed to a method that does not accept it as a valid argument.
未能完成加密操作。A cryptographic operation could not be completed.
注解
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 method displays a user interface in which you choose signers for this message. 这要求当前进程在 用户交互模式下 运行,这意味着该 Environment.UserInteractive 属性设置为 true 。This requires that the current process is running in user interactive mode, meaning that the Environment.UserInteractive property is set to true. 进程通常处于用户交互模式,除非它是服务进程或在 Web 应用程序中运行。A process is normally in user interactive mode unless it is a service process or running inside a Web application.
其证书满足以下条件的签名者将显示在列表中:Signers whose certificates meet the following conditions will be displayed in the list:
证书具有关联的私钥。The certificate has an associated private key.
证书在其有效期内。The certificate is within its validity period.
证书没有密钥用法或支持数字签名或认可的密钥用法。The certificate has no key usage or a key usage that supports digital signatures or nonrepudiation.
从 "我的存储" 中选择签名者证书。Signer certificates are chosen from the My store.
.NET Framework 安全性.NET Framework Security
要显示用户界面,需要具备以下权限:The following permissions are required to display the user interface:
访问签名密钥需要以下权限:The following permissions are required to access the signature key:
适用于
ComputeCounterSignature(CmsSigner)
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.
public:
void ComputeCounterSignature(System::Security::Cryptography::Pkcs::CmsSigner ^ signer);
public void ComputeCounterSignature (System.Security.Cryptography.Pkcs.CmsSigner signer);
member this.ComputeCounterSignature : System.Security.Cryptography.Pkcs.CmsSigner -> unit
Public Sub ComputeCounterSignature (signer As CmsSigner)
参数
例外
向不接受空引用作为有效参数的方法传递了一个空引用。A null reference was passed to a method that does not accept it as a valid argument.
未能完成加密操作。A cryptographic operation could not be completed.
注解
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.
.NET Framework 安全性.NET Framework Security
访问签名密钥需要以下权限:The following permissions are required to access the signature key: