Class ECKeyValue
- java.lang.Object
-
- org.apache.xml.security.utils.ElementProxy
-
- org.apache.xml.security.utils.Signature11ElementProxy
-
- org.apache.xml.security.keys.content.keyvalues.ECKeyValue
-
- All Implemented Interfaces:
KeyValueContent
public class ECKeyValue extends Signature11ElementProxy implements KeyValueContent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ECKeyValue.Curve
-
Field Summary
Fields Modifier and Type Field Description private static ECKeyValue.Curve
SECP256R1
private static ECKeyValue.Curve
SECP384R1
private static ECKeyValue.Curve
SECP521R1
-
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI, LOG
-
-
Constructor Summary
Constructors Constructor Description ECKeyValue(org.w3c.dom.Document doc, java.security.Key key)
Constructor DSAKeyValueECKeyValue(org.w3c.dom.Element element, java.lang.String baseURI)
Constructor DSAKeyValue
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.math.BigInteger
bigInt(java.lang.String s)
private static java.security.spec.ECPoint
decodePoint(byte[] data, java.security.spec.EllipticCurve curve)
private static byte[]
encodePoint(java.security.spec.ECPoint point, java.security.spec.EllipticCurve curve)
java.lang.String
getBaseLocalName()
Returns the localname of the Elements of the sub-class.private static java.lang.String
getCurveOid(java.security.spec.ECParameterSpec params)
private static java.security.spec.ECParameterSpec
getECParameterSpec(java.lang.String oid)
private static org.w3c.dom.Element
getFirstChildElement(org.w3c.dom.Node node)
private static org.w3c.dom.Element
getNextSiblingElement(org.w3c.dom.Node node)
private static org.w3c.dom.Element
getNextSiblingElement(org.w3c.dom.Node node, java.lang.String localName, java.lang.String namespaceURI)
java.security.PublicKey
getPublicKey()
Method getPublicKeyprivate static ECKeyValue.Curve
initializeCurve(java.lang.String name, java.lang.String oid, java.lang.String sfield, java.lang.String a, java.lang.String b, java.lang.String x, java.lang.String y, java.lang.String n, int h)
private static boolean
matchCurve(java.security.spec.ECParameterSpec params, ECKeyValue.Curve curve)
private static byte[]
trimZeroes(byte[] b)
private static org.w3c.dom.Element
verifyElement(org.w3c.dom.Element elem, java.lang.String localName, java.lang.String namespaceURI)
-
Methods inherited from class org.apache.xml.security.utils.Signature11ElementProxy
getBaseNamespace
-
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContext
-
-
-
-
Field Detail
-
SECP256R1
private static final ECKeyValue.Curve SECP256R1
-
SECP384R1
private static final ECKeyValue.Curve SECP384R1
-
SECP521R1
private static final ECKeyValue.Curve SECP521R1
-
-
Constructor Detail
-
ECKeyValue
public ECKeyValue(org.w3c.dom.Element element, java.lang.String baseURI) throws XMLSecurityException
Constructor DSAKeyValue- Parameters:
element
-baseURI
-- Throws:
XMLSecurityException
-
ECKeyValue
public ECKeyValue(org.w3c.dom.Document doc, java.security.Key key) throws java.lang.IllegalArgumentException
Constructor DSAKeyValue- Parameters:
doc
-key
-- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
initializeCurve
private static ECKeyValue.Curve initializeCurve(java.lang.String name, java.lang.String oid, java.lang.String sfield, java.lang.String a, java.lang.String b, java.lang.String x, java.lang.String y, java.lang.String n, int h)
-
getPublicKey
public java.security.PublicKey getPublicKey() throws XMLSecurityException
Method getPublicKey- Specified by:
getPublicKey
in interfaceKeyValueContent
- Returns:
- the public key
- Throws:
XMLSecurityException
-
getBaseLocalName
public java.lang.String getBaseLocalName()
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalName
in classElementProxy
- Returns:
- the localname of the Elements of the sub-class.
-
getFirstChildElement
private static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node node)
-
getNextSiblingElement
private static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node, java.lang.String localName, java.lang.String namespaceURI) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
getNextSiblingElement
private static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node)
-
verifyElement
private static org.w3c.dom.Element verifyElement(org.w3c.dom.Element elem, java.lang.String localName, java.lang.String namespaceURI) throws javax.xml.crypto.MarshalException
- Throws:
javax.xml.crypto.MarshalException
-
getCurveOid
private static java.lang.String getCurveOid(java.security.spec.ECParameterSpec params)
-
matchCurve
private static boolean matchCurve(java.security.spec.ECParameterSpec params, ECKeyValue.Curve curve)
-
decodePoint
private static java.security.spec.ECPoint decodePoint(byte[] data, java.security.spec.EllipticCurve curve) throws java.io.IOException
- Throws:
java.io.IOException
-
encodePoint
private static byte[] encodePoint(java.security.spec.ECPoint point, java.security.spec.EllipticCurve curve)
-
trimZeroes
private static byte[] trimZeroes(byte[] b)
-
getECParameterSpec
private static java.security.spec.ECParameterSpec getECParameterSpec(java.lang.String oid)
-
bigInt
private static java.math.BigInteger bigInt(java.lang.String s)
-
-