X509KeyIdentifierClauseType 枚举

定义

一个列出 X.509 密钥标识符子句可能的类型的枚举。

public enum class X509KeyIdentifierClauseType
public enum X509KeyIdentifierClauseType
type X509KeyIdentifierClauseType = 
Public Enum X509KeyIdentifierClauseType
继承
X509KeyIdentifierClauseType

字段

Any 0

如果 X.509 证书中存在 SubjectKeyIdentifier,则使用它;否则使用 IssuerSerial

IssuerSerial 2

使用 IssuerSerial 引用:颁发者标识符加上对颁发者唯一的序列号。

RawDataKeyIdentifier 4

该引用包含整个 X.509 证书的原始数据。

SubjectKeyIdentifier 3

引用基于 X.509 证书的主题密钥标识符扩展(并非所有证书都具有扩展,它是可选属性)。

Thumbprint 1

使用 X.509 指纹。

示例

下面的代码演示如何将 X509ReferenceStyle 属性设置为此枚举的成员。

AsymmetricSecurityBindingElement abe =
    (AsymmetricSecurityBindingElement)SecurityBindingElement.
    CreateMutualCertificateBindingElement(
    MessageSecurityVersion.
    WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10);

abe.SetKeyDerivation(false);

X509SecurityTokenParameters istp =
   abe.InitiatorTokenParameters as X509SecurityTokenParameters;
if (istp != null)
{
    istp.X509ReferenceStyle =
    X509KeyIdentifierClauseType.IssuerSerial;
}
Dim abe As AsymmetricSecurityBindingElement = CType(SecurityBindingElement.CreateMutualCertificateBindingElement(MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10), AsymmetricSecurityBindingElement)

abe.SetKeyDerivation(False)

Dim istp As X509SecurityTokenParameters = TryCast(abe.InitiatorTokenParameters, X509SecurityTokenParameters)
If istp IsNot Nothing Then
    istp.X509ReferenceStyle = X509KeyIdentifierClauseType.IssuerSerial
End If

适用于