Class ECDSAUtils


  • public final class ECDSAUtils
    extends java.lang.Object
    • Constructor Detail

      • ECDSAUtils

        private ECDSAUtils()
    • 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)