X509CertificateRecipientClientCredential.DefaultCertificate 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置用于服务的默认证书。
public:
property System::Security::Cryptography::X509Certificates::X509Certificate2 ^ DefaultCertificate { System::Security::Cryptography::X509Certificates::X509Certificate2 ^ get(); void set(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ value); };
public System.Security.Cryptography.X509Certificates.X509Certificate2 DefaultCertificate { get; set; }
member this.DefaultCertificate : System.Security.Cryptography.X509Certificates.X509Certificate2 with get, set
Public Property DefaultCertificate As X509Certificate2
属性值
用于服务的默认证书。
例外
试图在凭据为只读时进行设置。
示例
此代码演示如何访问该属性。
public void snippet24(CalculatorClient cc)
{
X509CertificateRecipientClientCredential rcc = cc.ClientCredentials.ServiceCertificate;
X509Certificate2 cert = rcc.DefaultCertificate;
}
注解
对于使用基于证书的消息安全的绑定,此证书用于加密发送给服务的消息,并期望服务用它来对客户端的应答进行签名。