ConfigurationBasedIssuerNameRegistry 类

定义

表示颁发者名称注册想,其维护一系列可信颁发者,它们加载子应用程序配置文件中的元素,该文件将每个颁发者名称与 X.509 证书关联,该证书为验证颁发者生成的签名所需。Represents an issuer name registry that maintains a list of trusted issuers loaded from elements in the application configuration file that associate each issuer name to the X.509 certificate that is needed to verify the signature of tokens produced by the issuer.

public ref class ConfigurationBasedIssuerNameRegistry : System::IdentityModel::Tokens::IssuerNameRegistry
public class ConfigurationBasedIssuerNameRegistry : System.IdentityModel.Tokens.IssuerNameRegistry
type ConfigurationBasedIssuerNameRegistry = class
    inherit IssuerNameRegistry
Public Class ConfigurationBasedIssuerNameRegistry
Inherits IssuerNameRegistry
继承
ConfigurationBasedIssuerNameRegistry

示例

下面的 XML 显示为 ConfigurationBasedIssuerNameRegistry 安全标记处理程序集合添加的的配置。The following XML shows configuration for a ConfigurationBasedIssuerNameRegistry added for a collection of security token handlers. <trustedIssuers>元素的行为类似于经典 .net 配置集合,允许 <add> <delete><clear> 元素作为子元素。The <trustedIssuers> element behaves like a classic .NET configuration collection, allowing the <add>, <delete> and <clear> elements as child elements.

<system.identityModel>  
  <identityConfiguration>  
    <securityTokenHandlersCollection>  
      <securityTokenHandlerConfiguration>  
        <issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel">  
          <trustedIssuers>  
             <add thumbprint="97249e … 158de" name="contoso.com" />  
         </trustedIssuers>  
        </issuerNameRegistry>  
      </securityTokenHandlerConfiguration>  
  </identityConfiguration>  
</system.identityModel>  

注解

ConfigurationBasedIssuerNameRegistry类通过将每个受信任颁发者的证书映射到引用该颁发者的名称来维护可信颁发者的字典。The ConfigurationBasedIssuerNameRegistry class maintains a dictionary of trusted issuers by mapping the certificate of each trusted issuer to a name that refers to that issuer. 证书使用指纹的 "已使用" 的 "ASN" 编码形式指定。The certificates are specified using the ASN.1 encoded form of the thumbprint. 颁发者名称可以是任何字符串,只要它在应用程序的作用域内是唯一的。The issuer name can be any string, as long as it is unique within the scope of the application. 此字典可通过 ConfiguredTrustedIssuers 属性访问。This dictionary can be accessed through the ConfiguredTrustedIssuers property. 类只能解析 x.509 证书。The class can only resolve X.509 certificates.

受信任的颁发者的映射在配置文件中指定,方法是在 < s > 元素下添加条目。The map of trusted issuers is specified in a configuration file by adding entries under the <trustedIssuers> element. <trustedIssuers>元素是 < > issuerNameRegistry元素的子元素,在该元素的 ConfigurationBasedIssuerNameRegistry 属性中指定了类时,该元素是有效的 typeThe <trustedIssuers> element is a child element of the <issuerNameRegistry> element and it is valid when the ConfigurationBasedIssuerNameRegistry class is specified in the type attribute of that element. 有关详细信息,请参阅 WIF 配置架构中每个元素的文档。For more information, see the documentation for each of these elements in the WIF Configuration Schema. 有关颁发者名称注册表的详细信息,请参阅 IssuerNameRegistry 类。For more information about issuer name registries, see the IssuerNameRegistry class.

你可以从派生 ConfigurationBasedIssuerNameRegistry ,以实现你自己的基于配置的颁发者名称注册表。You can derive from ConfigurationBasedIssuerNameRegistry to implement your own configuration based issuer name registry. 要重写的方法将取决于您的实现。Which methods you override will depend upon your implementation. 例如,可以重写 LoadCustomConfiguration 方法以从自定义配置架构加载配置。For example, you can override the LoadCustomConfiguration method to load configuration from a custom configuration schema.

构造函数

ConfigurationBasedIssuerNameRegistry()

初始化 ConfigurationBasedIssuerNameRegistry 类的新实例。Initializes a new instance of the ConfigurationBasedIssuerNameRegistry class.

属性

ConfiguredTrustedIssuers

获取为当前实例配置的可信颁发者的字典。Gets the dictionary of trusted issuers that have been configured for this instance.

方法

AddTrustedIssuer(String, String)

添加一个颁发者到信任发行人字典。Adds an issuer to the dictionary of trusted issuers.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetIssuerName(SecurityToken)

返回与指定的 X509SecurityToken 相关的发行人名称,通过映射证书指纹到已信任的发行人字典中的名称。Returns the issuer name associated with the specified X509SecurityToken by mapping the certificate thumbprint to a name in the trusted issuers dictionary.

GetIssuerName(SecurityToken, String)

当在派生类中重写时,返回指定安全令牌的颁发者名称。When overridden in a derived class, returns the name of the issuer of the specified security token. 在确定要返回的颁布者名称中要考虑的指定的颁布者名称。The specified issuer name may be considered in determining the issuer name to return.

(继承自 IssuerNameRegistry)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetWindowsIssuerName()

返回用于 Windows 声明的默认颁发者名称。Returns the default issuer name to be used for Windows claims.

(继承自 IssuerNameRegistry)
LoadCustomConfiguration(XmlNodeList)

加载配置的可信颁发者。Loads the trusted issuers from configuration.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅