public interface KeyValue extends XMLStructure
KeyValue元在
W3C Recommendation for XML-Signature Syntax and Processing定义。一个
KeyValue对象包含一个公钥验证签名可能是有用的。XML架构定义的定义是:
<元名称=“键-值”type=“ds:keyvaluetype” />< complexType名称=“keyvaluetype混合=“真实”>
<选择>
<元ref=“ds:dsakeyvalue” />
<元ref=“ds:rsakeyvalue” />
<命名空间=“# #其他“processcontents="“宽松”/">
< /选择>< /名称>
<元名称=“dsakeyvalue”type=“ds:dsakeyvaluetype” />< complexType名称=“dsakeyvaluetype”>
<序>
<序列minoccurs=“0”>
<元名称=“p”type=“ds:cryptobinary” />
<元名称=“q”type=“ds:cryptobinary” />< /序列>
<元名称=“g”type=“ds:cryptobinary”minoccurs=“0” />
<元名称=“y”型=“ds:cryptobinary” />
<元名称=“j”型=“ds:cryptobinary”minoccurs=“0” />
<序列minoccurs=“0”>
<元名称=“种子”type=“ds:cryptobinary” />
<元名称=“pgencounter”type=“ds:cryptobinary” />< /序列>< /序列>< /名称>
<元名称=“rsakeyvalue”type=“ds:rsakeyvaluetype” />< complexType名称=“rsakeyvaluetype”>
<序>
<元名称=“模量”type=“ds:cryptobinary” />
<元名称=“指数”type=“ds:cryptobinary” />< /序列>< /名称>
序>
序列minoccurs=“0”>
序列minoccurs=“0”>
序>
命名空间=“#>
选择>一
KeyValue实例可以通过调用类的
KeyInfoFactory
newKeyValue方法创建的,并通过这一
PublicKey代表公共价值的关键。这里是创建从一个
DSAPublicKey一
Certificate存储在
KeyStore一
KeyValue例:
私钥keystore =密钥库。getInstance(密钥库。getdefaulttype());公钥dsapublickey =密钥库。getcertificate(“mydsasigningcert”)。getpublickey();keyinfofactory厂= keyinfofactory getInstance(DOM);核心价值=工厂。newkeyvalue(dsapublickey);这类返回
DSAKeyValue和
RSAKeyValue元素类型
DSAPublicKey和
RSAPublicKey对象,分别。请注意,在架构中的所有字段都是可访问的,这些类型的参数。
KeyInfoFactory.newKeyValue(PublicKey)
| Modifier and Type | Field and Description |
|---|---|
static String |
DSA_TYPE
URI标识消息的类型:HTTP:DSA keyValue /两。org / 2000 / 09 / xmldsig # dsakeyvalue。
|
static String |
RSA_TYPE
URI标识的RSA函数的消息类型:HTTP:/ /两。org / 2000 / 09 / xmldsig # rsakeyvalue。
|
| Modifier and Type | Method and Description |
|---|---|
PublicKey |
getPublicKey()
返回该
KeyValue公钥。
|
isFeatureSupportedstatic final String DSA_TYPE
RetrievalMethod班
type参数来描述远程
DSAKeyValue结构的价值。
static final String RSA_TYPE
RetrievalMethod班
type参数来描述远程
RSAKeyValue结构的价值。
PublicKey getPublicKey() throws KeyException
KeyValue公钥。
KeyValue公钥
KeyException -如果这
KeyValue不能转换为
PublicKey
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.