public abstract class KeyInfoFactory extends Object
KeyInfo对象或完成一
KeyInfo对象从一个相应的XML表示工厂。
每个实例的KeyInfoFactory支持一个特定的XML机制类型。创建一个KeyInfoFactory,调用一个静态getInstance方法,通过在XML机制类型所需的,例如:
KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
本厂生产的对象,将基于DOM和遵守DOM互操作性要求在API概述 DOM Mechanism Requirements部分定义。看到一个标准的机构类型的API概述 Service Providers节。
KeyInfoFactory实现注册和使用Provider机构加载。例如,一个支持DOM机制将被指定在Provider类服务提供商:
把(“keyinfofactory。DOM”、“组织的例子。DOMKeyInfoFactory);
另外,被本厂创建XMLStructures可能包含特定的KeyInfo状态而不是为了得到重用。
实现必须至少支持默认机制类型:DOM。
注意,调用者必须使用相同的KeyInfoFactory实例创建一个特定对象的XMLStructures KeyInfo。如果从不同的供应商或不同的机构类型XMLStructures一起使用的行为是未定义的。
并发访问
这个类的静态方法保证是线程安全的。多线程可以同时调用在这个类中定义的静态方法,没有任何不良影响。
然而,对于这个类定义的非静态方法,这是不正确的。除非另有书面由一个特定的供应商,线程需要访问一个单一的KeyInfoFactory实例同时应同步自己提供必要的锁。多个线程中的每个操作不同的KeyInfoFactory实例不需要同步。
| Modifier | Constructor and Description |
|---|---|
protected |
KeyInfoFactory()
默认构造函数,通过子类调用。
|
| Modifier and Type | Method and Description |
|---|---|
static KeyInfoFactory |
getInstance()
返回一个
KeyInfoFactory支持默认的XML处理机制和表现型(DOM)。
|
static KeyInfoFactory |
getInstance(String mechanismType)
返回一个
KeyInfoFactory支持指定的XML处理机制和表现型(如:“DOM”)。
|
static KeyInfoFactory |
getInstance(String mechanismType, Provider provider)
返回一个
KeyInfoFactory支持请求的XML处理机制和表现型(如:“DOM”),由指定的供应商提供。
|
static KeyInfoFactory |
getInstance(String mechanismType, String provider)
返回一个
KeyInfoFactory支持请求的XML处理机制和表现型(如:“DOM”),由指定的供应商提供。
|
String |
getMechanismType()
返回类型的XML处理机制,这
KeyInfoFactory表示支持(例如:“DOM”)
|
Provider |
getProvider()
返回该
KeyInfoFactory提供者。
|
abstract URIDereferencer |
getURIDereferencer()
返回引用的
URIDereferencer,默认使用URI在
RetrievalMethod对象引用。
|
abstract boolean |
isFeatureSupported(String feature)
指示是否支持指定的功能。
|
abstract KeyInfo |
newKeyInfo(List content)
创建一个
KeyInfo包含指定列表的关键信息类型。
|
abstract KeyInfo |
newKeyInfo(List content, String id)
创建一个
KeyInfo包含指定列表的主要信息类型和可选的ID。
|
abstract KeyName |
newKeyName(String name)
创建指定名称的
KeyName。
|
abstract KeyValue |
newKeyValue(PublicKey key)
创建从指定的公钥
KeyValue。
|
abstract PGPData |
newPGPData(byte[] keyId)
创建一个
PGPData从指定的PGP公钥标识。
|
abstract PGPData |
newPGPData(byte[] keyId, byte[] keyPacket, List other)
创建从指定的PGP公钥标识符和可选
PGPData,关键材料包和外部元素列表。
|
abstract PGPData |
newPGPData(byte[] keyPacket, List other)
创建从指定的PGP密钥材料包和外部元素的可选列表
PGPData。
|
abstract RetrievalMethod |
newRetrievalMethod(String uri)
创建从指定的URI
RetrievalMethod。
|
abstract RetrievalMethod |
newRetrievalMethod(String uri, String type, List transforms)
创建从指定的参数
RetrievalMethod。
|
abstract X509Data |
newX509Data(List content)
创建一个
X509Data包含指定列表的X.509证书的内容。
|
abstract X509IssuerSerial |
newX509IssuerSerial(String issuerName, BigInteger serialNumber)
创建从指定发行人的
X509IssuerSerial X.500可分辨名称和编号。
|
abstract KeyInfo |
unmarshalKeyInfo(XMLStructure xmlStructure)
|
public static KeyInfoFactory getInstance(String mechanismType)
KeyInfoFactory支持指定的XML处理机制和表现型(如:“DOM”)。
该方法采用标准的JCA提供者查找机制来定位和实例化所需的机构类型KeyInfoFactory实施。它通过注册安全Providers列表,从最喜欢的Provider。从支持指定机构的第一Provider新KeyInfoFactory对象返回。
注意,注册商的列表可以通过Security.getProviders()检索方法。
mechanismType - XML处理机制和表征的类型。看到一个标准的机构类型的API概述
Service Providers节。
KeyInfoFactory
null
mechanismType
NullPointerException
NoSuchMechanismException -如果没有
Provider支持指定
KeyInfoFactory实施机制
Provider
public static KeyInfoFactory getInstance(String mechanismType, Provider provider)
KeyInfoFactory支持请求的XML处理机制和表现型(如:“DOM”),由指定的供应商提供。注意,指定的
Provider对象不必在供应商列表注册。
mechanismType - XML处理机制和表征的类型。看到一个标准的机构类型的API概述
Service Providers节。
provider -
Provider对象
KeyInfoFactory
NullPointerException -如果
mechanismType或
provider是
null
NoSuchMechanismException -如果指定机构
KeyInfoFactory执行不可从指定的
Provider对象
Provider
public static KeyInfoFactory getInstance(String mechanismType, String provider) throws NoSuchProviderException
KeyInfoFactory支持请求的XML处理机制和表现型(如:“DOM”),由指定的供应商提供。指定的提供程序必须在安全提供程序列表中注册。
注意,注册商的列表可以通过Security.getProviders()检索方法。
mechanismType - XML处理机制和表征的类型。看到一个标准的机构类型的API概述
Service Providers节。
provider -供应商的字符串名称
KeyInfoFactory
NoSuchProviderException -如果指定的供应商不在安全提供商注册名单
NullPointerException -如果
mechanismType或
provider是
null
NoSuchMechanismException -如果一个指定的机构
KeyInfoFactory执行不可从指定的供应商
Provider
public static KeyInfoFactory getInstance()
KeyInfoFactory支持默认的XML处理机制和表现型(DOM)。
该方法采用标准的JCA提供者查找机制来定位和实例化一个KeyInfoFactory执行默认机制类型。它通过注册安全Providers列表,从最喜欢的Provider。从第一Provider支持DOM机制的新KeyInfoFactory对象返回。
注意,注册商的列表可以通过Security.getProviders()检索方法。
KeyInfoFactory
NoSuchMechanismException -如果没有
Provider支持的DOM
KeyInfoFactory实施机制
Provider
public final String getMechanismType()
KeyInfoFactory表示支持(例如:“DOM”)
KeyInfoFactory所支持的XML处理机制
public final Provider getProvider()
KeyInfoFactory提供者。
KeyInfoFactory提供者
public abstract KeyInfo newKeyInfo(List content)
KeyInfo包含指定列表的关键信息类型。
content -一个或多个较关键的信息类型
XMLStructures。这份名单是在复制防止后续的修改。
KeyInfo
null
content
NullPointerException
IllegalArgumentException -如果
content是空的
ClassCastException -如果
content包含任何条目不
XMLStructure型
public abstract KeyInfo newKeyInfo(List content, String id)
KeyInfo包含指定列表的主要信息类型和可选的ID。
id参数表示XML
ID属性的值和引用
KeyInfo从其他XML结构是有用的。
content -一个或多个较关键的信息类型
XMLStructures。这份名单是在复制防止后续的修改。
id -一个XML
ID值(可能是
null)
KeyInfo
null
content
NullPointerException
IllegalArgumentException -如果
content是空的
ClassCastException -如果
content包含任何条目不
XMLStructure型
public abstract KeyName newKeyName(String name)
KeyName。
name,识别关键的名字
KeyName
null
name
NullPointerException
public abstract KeyValue newKeyValue(PublicKey key) throws KeyException
KeyValue。
key -公钥
KeyValue
KeyException -如果
key的算法不认可或支持这
KeyInfoFactory
null
key
NullPointerException
public abstract PGPData newPGPData(byte[] keyId)
PGPData从指定的PGP公钥标识。
keyId - PGP公钥标识符的定义在
RFC 2440,11.2节。该阵列被克隆,以防止随后的修改。
PGPData
null
keyId
NullPointerException
IllegalArgumentException -如果密钥ID的格式不正确
public abstract PGPData newPGPData(byte[] keyId, byte[] keyPacket, List other)
PGPData,关键材料包和外部元素列表。
keyId - PGP公钥标识符的定义在
RFC 2440,11.2节。该阵列被克隆,以防止随后的修改。
keyPacket - PGP密钥材料包的定义,5.5节。该阵列被克隆,以防止随后的修改。可能是
null。
other -列出代表从外部命名空间元素
XMLStructures。这份名单是在复制防止后续的修改。可能是
null或空。
PGPData
null
keyId
NullPointerException
IllegalArgumentException -如果
keyId或
keyPacket格式不正确。对于
keyPacket,包头的格式检查和标签的验证,它的类型是关键材料。未检查数据包体的内容和格式。
ClassCastException -如果
other包含任何条目不
XMLStructure型
public abstract PGPData newPGPData(byte[] keyPacket, List other)
PGPData。
keyPacket - PGP密钥材料包的定义,5.5节。该阵列被克隆,以防止随后的修改。
other -列出代表从外部命名空间元素
XMLStructures。这份名单是在复制防止后续的修改。可能是
null或空。
PGPData
null
keyPacket
NullPointerException
IllegalArgumentException -如果
keyPacket格式不正确。对于
keyPacket,包头的格式检查和标签的验证,它的类型是关键材料。未检查数据包体的内容和格式。
ClassCastException -如果
other包含任何条目不
XMLStructure型
public abstract RetrievalMethod newRetrievalMethod(String uri)
RetrievalMethod。
uri,标识要检索的信息
KeyInfo URI
RetrievalMethod
null
uri
NullPointerException
IllegalArgumentException -如果
uri不是RFC 2396兼容
public abstract RetrievalMethod newRetrievalMethod(String uri, String type, List transforms)
RetrievalMethod。
uri,标识要检索的信息
KeyInfo URI
type - URI标识要检索的
KeyInfo信息类型(可能是
null)
transforms -
Transforms列表。列表是防守复制防止后续的修改。可能是
null或空。
RetrievalMethod
null
uri
NullPointerException
IllegalArgumentException -如果
uri不是RFC 2396兼容
ClassCastException -如果
transforms包含任何条目不
Transform型
public abstract X509Data newX509Data(List content)
X509Data包含指定列表的X.509证书的内容。
content -一个或多个X.509证书的内容类型。有效的类型
String(课题名称),
byte[](主题密钥ID),
X509Certificate,
X509CRL,或
XMLStructure(
X509IssuerSerial对象或元素从外部命名空间)。课题名称是尊贵的名字在RFC 2253格式字符串。实现必须支持的属性类型关键词在RFC 2253中定义的(CN,L,ST,O,OU,C,街、DC和UID)。实现可能支持额外的关键字。这份名单是在复制防止后续的修改。
X509Data
null
content
NullPointerException
IllegalArgumentException -如果
content是空的,或如果主题名称不是RFC 2253兼容的或一个属性类型的关键词是不被认可的。
ClassCastException -如果
content包含任何条目,不是上面提到的一个有效的类型
public abstract X509IssuerSerial newX509IssuerSerial(String issuerName, BigInteger serialNumber)
X509IssuerSerial X.500可分辨名称和编号。
issuerName -发行人的专有名称的字符串格式在RFC 2253。实现必须支持的属性类型关键词在RFC 2253中定义的(CN,L,ST,O,OU,C,街、DC和UID)。实现可能支持额外的关键字。
serialNumber -序号
X509IssuerSerial
NullPointerException -如果
issuerName或
serialNumber是
null
IllegalArgumentException -如果发行人名称不是RFC 2253兼容的或一个属性类型的关键词是不被认可的。
public abstract boolean isFeatureSupported(String feature)
feature -功能名称(如绝对URI)
true如果指定的功能是支持,
false否则
null
feature
NullPointerException
public abstract URIDereferencer getURIDereferencer()
URIDereferencer,默认使用URI在
RetrievalMethod对象引用。
URIDereferencer
public abstract KeyInfo unmarshalKeyInfo(XMLStructure xmlStructure) throws MarshalException
xmlStructure -是一种机制,特定的XML结构,从数据的消息
KeyInfo
null
xmlStructure
NullPointerException
ClassCastException -如果
xmlStructure类型是不适合本厂
MarshalException -如果在发生不可恢复的异常反
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.