APIdia Launch Partner
Top Description Inners Fields Constructors Methods
org.jcp.xml.dsig.internal.dom

public abstract Class DOMKeyValue<K extends PublicKey>

extends DOMStructure
implements KeyValue
Class Inheritance
All Implemented Interfaces
javax.xml.crypto.dsig.keyinfo.KeyValue, javax.xml.crypto.XMLStructure
Known Direct Subclasses
org.jcp.xml.dsig.internal.dom.DOMKeyValue.RSA, org.jcp.xml.dsig.internal.dom.DOMKeyValue.DSA, org.jcp.xml.dsig.internal.dom.DOMKeyValue.EC, org.jcp.xml.dsig.internal.dom.DOMKeyValue.Unknown
Imports
java.io.IOException, java.math.BigInteger, java.security.KeyException, .KeyFactory, .NoSuchAlgorithmException, .PublicKey, java.security.interfaces.DSAParams, .DSAPublicKey, .ECPublicKey, .RSAPublicKey, java.security.spec.DSAPublicKeySpec, .ECField, .ECFieldFp, .ECParameterSpec, .ECPoint, .ECPublicKeySpec, .EllipticCurve, .InvalidKeySpecException, .KeySpec, .RSAPublicKeySpec, java.util.Arrays, javax.xml.crypto.MarshalException, javax.xml.crypto.dom.DOMCryptoContext, javax.xml.crypto.dsig.XMLSignature, javax.xml.crypto.dsig.keyinfo.KeyValue, com.sun.org.apache.xml.internal.security.utils.XMLUtils, org.w3c.dom.Document, .Element, .Node

DOM-based implementation of KeyValue.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final K
private static final String

Constructor Summary

AccessConstructor and Description
public
DOMKeyValue(K key)

public
DOMKeyValue(Element
a KeyValue child element
kvtElem
)

Creates a DOMKeyValue from an element.

Method Summary

Modifier and TypeMethod and Description
private static BigInteger
public static BigInteger
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

private static PublicKey
public PublicKey
getPublicKey()

Implements javax.xml.crypto.dsig.keyinfo.KeyValue.getPublicKey.

Returns the public key of this KeyValue.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public void
pack-priv abstract void
marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context)

pack-priv static KeyValue
pack-priv abstract K
Inherited from org.jcp.xml.dsig.internal.dom.DOMStructure:
equalsContentisFeatureSupported

Field Detail

publicKeyback to summary
private final K publicKey
XMLDSIG_11_XMLNSback to summary
private static final String XMLDSIG_11_XMLNS

Constructor Detail

DOMKeyValueback to summary
public DOMKeyValue(K key) throws KeyException
DOMKeyValueback to summary
public DOMKeyValue(Element kvtElem) throws MarshalException

Creates a DOMKeyValue from an element.

Parameters
kvtElem:Element

a KeyValue child element

Method Detail

bigIntback to summary
private static BigInteger bigInt(String s)
decodeback to summary
public static BigInteger decode(Element elem) throws MarshalException
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
generatePublicKeyback to summary
private static PublicKey generatePublicKey(KeyFactory kf, KeySpec keyspec)
getPublicKeyback to summary
public PublicKey getPublicKey() throws KeyException

Implements javax.xml.crypto.dsig.keyinfo.KeyValue.getPublicKey.

Doc from javax.xml.crypto.dsig.keyinfo.KeyValue.getPublicKey.

Returns the public key of this KeyValue.

Annotations
@Override
Exceptions
KeyException:
if this KeyValue cannot be converted to a PublicKey
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
marshalback to summary
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMStructure.marshal.

Annotations
@Override
marshalPublicKeyback to summary
pack-priv abstract void marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context) throws MarshalException
unmarshalback to summary
pack-priv static KeyValue unmarshal(Element kvElem) throws MarshalException
unmarshalKeyValueback to summary
pack-priv abstract K unmarshalKeyValue(Element kvtElem) throws MarshalException
org.jcp.xml.dsig.internal.dom back to summary

pack-priv final Class DOMKeyValue.DSA

extends DOMKeyValue<DSAPublicKey>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private KeyFactory
private DOMCryptoBinary
g

private DOMCryptoBinary
p

private DOMCryptoBinary
q

private DOMCryptoBinary
y

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
DSA(Element elem)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv DSAPublicKey
Inherited from org.jcp.xml.dsig.internal.dom.DOMKeyValue:
decodeequalsgetPublicKeyhashCodemarshalunmarshal

Field Detail

dsakfback to summary
private KeyFactory dsakf
gback to summary
private DOMCryptoBinary g
pback to summary
private DOMCryptoBinary p
qback to summary
private DOMCryptoBinary q
yback to summary
private DOMCryptoBinary y

Constructor Detail

DSAback to summary
pack-priv DSA(DSAPublicKey key) throws KeyException
DSAback to summary
pack-priv DSA(Element elem) throws MarshalException

Method Detail

marshalPublicKeyback to summary
pack-priv void marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.marshalPublicKey.

Annotations
@Override
unmarshalKeyValueback to summary
pack-priv DSAPublicKey unmarshalKeyValue(Element kvtElem) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.unmarshalKeyValue.

Annotations
@Override
org.jcp.xml.dsig.internal.dom back to summary

pack-priv final Class DOMKeyValue.EC

extends DOMKeyValue<ECPublicKey>
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final DOMKeyValue.EC.Curve
private static final DOMKeyValue.EC.Curve
private static final DOMKeyValue.EC.Curve
private KeyFactory
private ECParameterSpec
private byte[]
private static final DOMKeyValue.EC.Curve
private static final DOMKeyValue.EC.Curve
private static final DOMKeyValue.EC.Curve

Constructor Summary

AccessConstructor and Description
pack-priv
EC(ECPublicKey ecKey)

pack-priv
EC(Element dmElem)

Method Summary

Modifier and TypeMethod and Description
private static ECPoint
decodePoint(byte[] data, EllipticCurve curve)

private static byte[]
private static String
private static ECParameterSpec
private static DOMKeyValue.EC.Curve
initializeCurve(String name, String oid, String sfield, String a, String b, String x, String y, String n, int h)

pack-priv void
private static boolean
private static byte[]
trimZeroes(byte[] b)

pack-priv ECPublicKey
Inherited from org.jcp.xml.dsig.internal.dom.DOMKeyValue:
decodeequalsgetPublicKeyhashCodemarshalunmarshal

Field Detail

BRAINPOOLP256R1back to summary
private static final DOMKeyValue.EC.Curve BRAINPOOLP256R1
BRAINPOOLP384R1back to summary
private static final DOMKeyValue.EC.Curve BRAINPOOLP384R1
BRAINPOOLP512R1back to summary
private static final DOMKeyValue.EC.Curve BRAINPOOLP512R1
eckfback to summary
private KeyFactory eckf
ecParamsback to summary
private ECParameterSpec ecParams
ecPublicKeyback to summary
private byte[] ecPublicKey
SECP256R1back to summary
private static final DOMKeyValue.EC.Curve SECP256R1
SECP384R1back to summary
private static final DOMKeyValue.EC.Curve SECP384R1
SECP521R1back to summary
private static final DOMKeyValue.EC.Curve SECP521R1

Constructor Detail

ECback to summary
pack-priv EC(ECPublicKey ecKey) throws KeyException
ECback to summary
pack-priv EC(Element dmElem) throws MarshalException

Method Detail

decodePointback to summary
private static ECPoint decodePoint(byte[] data, EllipticCurve curve) throws IOException
encodePointback to summary
private static byte[] encodePoint(ECPoint point, EllipticCurve curve)
getCurveOidback to summary
private static String getCurveOid(ECParameterSpec params)
getECParameterSpecback to summary
private static ECParameterSpec getECParameterSpec(String oid)
initializeCurveback to summary
private static DOMKeyValue.EC.Curve initializeCurve(String name, String oid, String sfield, String a, String b, String x, String y, String n, int h)
marshalPublicKeyback to summary
pack-priv void marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.marshalPublicKey.

Annotations
@Override
matchCurveback to summary
private static boolean matchCurve(ECParameterSpec params, DOMKeyValue.EC.Curve curve)
trimZeroesback to summary
private static byte[] trimZeroes(byte[] b)
unmarshalKeyValueback to summary
pack-priv ECPublicKey unmarshalKeyValue(Element kvtElem) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.unmarshalKeyValue.

Annotations
@Override
org.jcp.xml.dsig.internal.dom back to summary

pack-priv final Class DOMKeyValue.EC.Curve

extends ECParameterSpec
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
Curve(String name, String oid, EllipticCurve curve, ECPoint g, BigInteger n, int h)

Method Summary

Modifier and TypeMethod and Description
private String
private String
Inherited from java.security.spec.ECParameterSpec:
getCofactorgetCurvegetGeneratorgetOrder

Field Detail

nameback to summary
private final String name
oidback to summary
private final String oid

Constructor Detail

Curveback to summary
pack-priv Curve(String name, String oid, EllipticCurve curve, ECPoint g, BigInteger n, int h)

Method Detail

getNameback to summary
private String getName()
getObjectIdback to summary
private String getObjectId()
org.jcp.xml.dsig.internal.dom back to summary

pack-priv final Class DOMKeyValue.RSA

extends DOMKeyValue<RSAPublicKey>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private DOMCryptoBinary
private DOMCryptoBinary
private KeyFactory

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
RSA(Element elem)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides org.jcp.xml.dsig.internal.dom.DOMKeyValue.equals.

Indicates whether some other object is "equal to" this one.

pack-priv void
pack-priv RSAPublicKey
Inherited from org.jcp.xml.dsig.internal.dom.DOMKeyValue:
decodegetPublicKeyhashCodemarshalunmarshal

Field Detail

exponentback to summary
private DOMCryptoBinary exponent
modulusback to summary
private DOMCryptoBinary modulus
rsakfback to summary
private KeyFactory rsakf

Constructor Detail

RSAback to summary
pack-priv RSA(RSAPublicKey key) throws KeyException
RSAback to summary
pack-priv RSA(Element elem) throws MarshalException

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides org.jcp.xml.dsig.internal.dom.DOMKeyValue.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
marshalPublicKeyback to summary
pack-priv void marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.marshalPublicKey.

Annotations
@Override
unmarshalKeyValueback to summary
pack-priv RSAPublicKey unmarshalKeyValue(Element kvtElem) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.unmarshalKeyValue.

Annotations
@Override
org.jcp.xml.dsig.internal.dom back to summary

pack-priv final Class DOMKeyValue.Unknown

extends DOMKeyValue<PublicKey>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private DOMStructure

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv PublicKey
Inherited from org.jcp.xml.dsig.internal.dom.DOMKeyValue:
decodeequalsgetPublicKeyhashCodemarshalunmarshal

Field Detail

externalPublicKeyback to summary
private DOMStructure externalPublicKey

Constructor Detail

Unknownback to summary
pack-priv Unknown(Element elem) throws MarshalException

Method Detail

marshalPublicKeyback to summary
pack-priv void marshalPublicKey(Node parent, Document doc, String dsPrefix, DOMCryptoContext context) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.marshalPublicKey.

Annotations
@Override
unmarshalKeyValueback to summary
pack-priv PublicKey unmarshalKeyValue(Element kvElem) throws MarshalException

Implements abstract org.jcp.xml.dsig.internal.dom.DOMKeyValue.unmarshalKeyValue.

Annotations
@Override