Package eu.europa.esig.dss.token.digest
Class DigestInfoEncoder
java.lang.Object
eu.europa.esig.dss.token.digest.DigestInfoEncoder
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 TypeMethodDescriptionstatic byte[]
This method encodes thealgorithmOid
anddigest
combination into ASN.1 DigestInfo representationDigestInfo ::= SEQUENCE { digestAlgorithm DigestAlgorithmIdentifier, digest Digest }
static boolean
isEncoded
(byte[] data) This method verifies whether thedata
is ASN.1 DigestInfo encoded
-
Method Details
-
encode
This method encodes thealgorithmOid
anddigest
combination into ASN.1 DigestInfo representationDigestInfo ::= SEQUENCE { digestAlgorithm DigestAlgorithmIdentifier, digest Digest }
- Parameters:
algorithmOid
-String
OID of the digest algorithmdigest
- 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 thedata
is ASN.1 DigestInfo encoded- Parameters:
data
- byte array to verify- Returns:
- TRUE if the data is ASN.1 DigestInfo encoded, FALSE otherwise
-