Class DOMKeyValue<K extends java.security.PublicKey>
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMKeyValue<K>
-
- All Implemented Interfaces:
javax.xml.crypto.dsig.keyinfo.KeyValue
,javax.xml.crypto.XMLStructure
- Direct Known Subclasses:
DOMKeyValue.DSA
,DOMKeyValue.EC
,DOMKeyValue.RSA
,DOMKeyValue.Unknown
public abstract class DOMKeyValue<K extends java.security.PublicKey> extends DOMStructure implements javax.xml.crypto.dsig.keyinfo.KeyValue
DOM-based implementation of KeyValue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
DOMKeyValue.DSA
(package private) static class
DOMKeyValue.EC
(package private) static class
DOMKeyValue.RSA
(package private) static class
DOMKeyValue.Unknown
-
Field Summary
Fields Modifier and Type Field Description private K
publicKey
private static java.lang.String
XMLDSIG_11_XMLNS
-
Constructor Summary
Constructors Constructor Description DOMKeyValue(K key)
DOMKeyValue(org.w3c.dom.Element kvtElem)
Creates aDOMKeyValue
from an element.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static java.math.BigInteger
bigInt(java.lang.String s)
static java.math.BigInteger
decode(org.w3c.dom.Element elem)
boolean
equals(java.lang.Object obj)
private static java.security.PublicKey
generatePublicKey(java.security.KeyFactory kf, java.security.spec.KeySpec keyspec)
java.security.PublicKey
getPublicKey()
int
hashCode()
void
marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)
(package private) abstract void
marshalPublicKey(org.w3c.dom.Node parent, org.w3c.dom.Document doc, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)
(package private) static javax.xml.crypto.dsig.keyinfo.KeyValue
unmarshal(org.w3c.dom.Element kvElem)
(package private) abstract K
unmarshalKeyValue(org.w3c.dom.Element kvtElem)
-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
-
-
-
-
Field Detail
-
XMLDSIG_11_XMLNS
private static final java.lang.String XMLDSIG_11_XMLNS
- See Also:
- Constant Field Values
-
publicKey
private final K extends java.security.PublicKey publicKey
-
-
Constructor Detail
-
DOMKeyValue
public DOMKeyValue(K key) throws java.security.KeyException
- Throws:
java.security.KeyException
-
DOMKeyValue
public DOMKeyValue(org.w3c.dom.Element kvtElem) throws javax.xml.crypto.MarshalException
Creates aDOMKeyValue
from an element.- Parameters:
kvtElem
- a KeyValue child element- Throws:
javax.xml.crypto.MarshalException
-
-
Method Detail
-
unmarshal
static javax.xml.crypto.dsig.keyinfo.KeyValue unmarshal(org.w3c.dom.Element kvElem) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
getPublicKey
public java.security.PublicKey getPublicKey() throws java.security.KeyException
- Specified by:
getPublicKey
in interfacejavax.xml.crypto.dsig.keyinfo.KeyValue
- Throws:
java.security.KeyException
-
marshal
public void marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context) throws javax.xml.crypto.MarshalException
- Specified by:
marshal
in classDOMStructure
- Throws:
javax.xml.crypto.MarshalException
-
marshalPublicKey
abstract void marshalPublicKey(org.w3c.dom.Node parent, org.w3c.dom.Document doc, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
unmarshalKeyValue
abstract K unmarshalKeyValue(org.w3c.dom.Element kvtElem) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
generatePublicKey
private static java.security.PublicKey generatePublicKey(java.security.KeyFactory kf, java.security.spec.KeySpec keyspec)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
decode
public static java.math.BigInteger decode(org.w3c.dom.Element elem) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
bigInt
private static java.math.BigInteger bigInt(java.lang.String s)
-
-