Module org.apache.santuario.xmlsec
Class ECDSAUtils
- java.lang.Object
-
- org.apache.xml.security.algorithms.implementations.ECDSAUtils
-
public final class ECDSAUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classECDSAUtils.ECCurveDefinition
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]convertASN1toXMLDSIG(byte[] asn1Bytes, int rawLen)Converts an ASN.1 ECDSA value to a XML Signature ECDSA Value.static byte[]convertXMLDSIGtoASN1(byte[] xmldsigBytes)Converts a XML Signature ECDSA Value to an ASN.1 DSA value.static ECPointdecodePoint(byte[] encodedBytes, EllipticCurve elliptiCcurve)static byte[]encodePoint(ECPoint ecPoint, EllipticCurve ellipticCurve)static ECDSAUtils.ECCurveDefinitiongetECCurveDefinition(String oid)static StringgetOIDFromPublicKey(ECPublicKey ecPublicKey)static byte[]stripLeadingZeros(byte[] bytes)
-
-
-
Method Detail
-
convertASN1toXMLDSIG
public static byte[] convertASN1toXMLDSIG(byte[] asn1Bytes, int rawLen) throws IOExceptionConverts an ASN.1 ECDSA value to a XML Signature ECDSA Value. The JAVA JCE ECDSA Signature algorithm creates ASN.1 encoded (r, s) value pairs; the XML Signature requires the core BigInteger values.- Parameters:
asn1Bytes- the ASN.1 encoded bytesrawLen- the intended length of decoded bytes for an integer. If -1, choose one automatically.- Returns:
- the decoded bytes
- Throws:
IOException- See Also:
- 6.4.1 DSA, 3.3. ECDSA Signatures
-
convertXMLDSIGtoASN1
public static byte[] convertXMLDSIGtoASN1(byte[] xmldsigBytes) throws IOExceptionConverts a XML Signature ECDSA Value to an ASN.1 DSA value. The JAVA JCE ECDSA Signature algorithm creates ASN.1 encoded (r, s) value pairs; the XML Signature requires the core BigInteger values.- Parameters:
xmldsigBytes-- Returns:
- the encoded ASN.1 bytes
- Throws:
IOException- See Also:
- 6.4.1 DSA, 3.3. ECDSA Signatures
-
getOIDFromPublicKey
public static String getOIDFromPublicKey(ECPublicKey ecPublicKey)
-
getECCurveDefinition
public static ECDSAUtils.ECCurveDefinition getECCurveDefinition(String oid)
-
encodePoint
public static byte[] encodePoint(ECPoint ecPoint, EllipticCurve ellipticCurve)
-
decodePoint
public static ECPoint decodePoint(byte[] encodedBytes, EllipticCurve elliptiCcurve)
-
stripLeadingZeros
public static byte[] stripLeadingZeros(byte[] bytes)
-
-