WindowsClaimsIdentity.CreateFromCertificate 方法 (X509Certificate2, Boolean, String)

Initializes an instance of T:Microsoft.IdentityModel.Claims.WindowsClaimsIdentity.

命名空间: Microsoft.IdentityModel.Claims
程序集: Microsoft.IdentityModel(microsoft.identitymodel.dll 中)

用法

    Dim certificate As X509Certificate2
Dim useWindowsTokenService As Boolean
Dim issuerName As String
Dim returnValue As WindowsClaimsIdentity

returnValue = WindowsClaimsIdentity.CreateFromCertificate(certificate, useWindowsTokenService, issuerName)

语法

声明
Public Shared Function CreateFromCertificate ( _
    certificate As X509Certificate2, _
    useWindowsTokenService As Boolean, _
    issuerName As String _
) As WindowsClaimsIdentity
public static WindowsClaimsIdentity CreateFromCertificate (
    X509Certificate2 certificate,
    bool useWindowsTokenService,
    string issuerName
)
public:
static WindowsClaimsIdentity^ CreateFromCertificate (
    X509Certificate2^ certificate, 
    bool useWindowsTokenService, 
    String^ issuerName
)
public static WindowsClaimsIdentity CreateFromCertificate (
    X509Certificate2 certificate, 
    boolean useWindowsTokenService, 
    String issuerName
)
public static function CreateFromCertificate (
    certificate : X509Certificate2, 
    useWindowsTokenService : boolean, 
    issuerName : String
) : WindowsClaimsIdentity

参数

  • certificate
    The certificate to draw the Upn claim from to use to map to the associated T:Microsoft.IdentityModel.Claims.WindowsClaimsIdentity
  • useWindowsTokenService
    If true this method will an S4U logon will executed in the context of the trusted token service.
  • issuerName
    The name of the issuer to use for the claims.

返回值

A T:Microsoft.IdentityModel.Claims.WindowsClaimsIdentity representing the user associated with the UPN in the certificate.

异常

异常类型 条件

备注

If configured, the Windows Token Service will be utilized to ensure that this T:Microsoft.IdentityModel.Claims.WindowsClaimsIdentity allows impersonation.

线程安全

此类型的任何公共静态(在 Visual Basic 中为 Shared)成员都是线程安全的。但不能保证任何实例成员是线程安全的。

平台

开发平台

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

请参见

参考

WindowsClaimsIdentity 类
WindowsClaimsIdentity 成员
Microsoft.IdentityModel.Claims 命名空间