Search in sources :

Example 1 with ByteArray

use of com.intel.mtwilson.util.io.ByteArray in project OpenAttestation by OpenAttestation.

the class Document method getEtag.

public String getEtag() {
    if (etag != null) {
        return etag;
    }
    if (modifiedOn != null) {
        String hex = Long.toHexString(modifiedOn.getTime());
        ByteArray byteArray = ByteArray.fromHex(hex);
        Sha1Digest digest = Sha1Digest.digestOf(byteArray.getBytes());
        return digest.toHexString();
    }
    return null;
}
Also used : Sha1Digest(com.intel.mtwilson.util.crypto.Sha1Digest) ByteArray(com.intel.mtwilson.util.io.ByteArray)

Aggregations

Sha1Digest (com.intel.mtwilson.util.crypto.Sha1Digest)1 ByteArray (com.intel.mtwilson.util.io.ByteArray)1