Class DigestInfoEncoder

java.lang.Object
eu.europa.esig.dss.token.digest.DigestInfoEncoder

public class DigestInfoEncoder extends Object
This class is used to encode given digest to its ASN.1 DigestInfo representation. NOTE: This class is used on RSA signing.
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    encode(String algorithmOid, byte[] digest)
    This method encodes the algorithmOid and digest combination into ASN.1 DigestInfo representation DigestInfo ::= SEQUENCE { digestAlgorithm DigestAlgorithmIdentifier, digest Digest }
    static boolean
    isEncoded(byte[] data)
    This method verifies whether the data is ASN.1 DigestInfo encoded

    Methods inherited from class java.lang.Object

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

    • encode

      public static byte[] encode(String algorithmOid, byte[] digest)
      This method encodes the algorithmOid and digest combination into ASN.1 DigestInfo representation DigestInfo ::= SEQUENCE { digestAlgorithm DigestAlgorithmIdentifier, digest Digest }
      Parameters:
      algorithmOid - String OID of the digest algorithm
      digest - the digest to be encoded
      Returns:
      byte array containing a DER-encoded DigestInfo sequence
    • isEncoded

      public static boolean isEncoded(byte[] data)
      This method verifies whether the data is ASN.1 DigestInfo encoded
      Parameters:
      data - byte array to verify
      Returns:
      TRUE if the data is ASN.1 DigestInfo encoded, FALSE otherwise