Class ECDSAUtils


  • public final class ECDSAUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] convertASN1toXMLDSIG​(byte[] asn1Bytes)
      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 java.security.spec.ECPoint decodePoint​(byte[] encodedBytes, java.security.spec.EllipticCurve elliptiCcurve)  
      static byte[] encodePoint​(java.security.spec.ECPoint ecPoint, java.security.spec.EllipticCurve ellipticCurve)  
      static ECDSAUtils.ECCurveDefinition getECCurveDefinition​(java.lang.String oid)  
      static java.lang.String getOIDFromPublicKey​(java.security.interfaces.ECPublicKey ecPublicKey)  
      static byte[] stripLeadingZeros​(byte[] bytes)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • convertASN1toXMLDSIG

        public static byte[] convertASN1toXMLDSIG​(byte[] asn1Bytes)
                                           throws java.io.IOException
        Converts 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 -
        Returns:
        the decode bytes
        Throws:
        java.io.IOException
        See Also:
        6.4.1 DSA, 3.3. ECDSA Signatures
      • convertXMLDSIGtoASN1

        public static byte[] convertXMLDSIGtoASN1​(byte[] xmldsigBytes)
                                           throws java.io.IOException
        Converts 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:
        java.io.IOException
        See Also:
        6.4.1 DSA, 3.3. ECDSA Signatures
      • getOIDFromPublicKey

        public static java.lang.String getOIDFromPublicKey​(java.security.interfaces.ECPublicKey ecPublicKey)
      • encodePoint

        public static byte[] encodePoint​(java.security.spec.ECPoint ecPoint,
                                         java.security.spec.EllipticCurve ellipticCurve)
      • decodePoint

        public static java.security.spec.ECPoint decodePoint​(byte[] encodedBytes,
                                                             java.security.spec.EllipticCurve elliptiCcurve)
      • stripLeadingZeros

        public static byte[] stripLeadingZeros​(byte[] bytes)