no.difi.asic.AbstractAsicManifest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-asic Show documentation
Show all versions of commons-asic Show documentation
Generic implementation of ASiC-E archives in accordance with ETSI 102 918 v1.3.1.
package no.difi.asic;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
abstract class AbstractAsicManifest {
protected MessageDigestAlgorithm messageDigestAlgorithm;
protected MessageDigest messageDigest;
public AbstractAsicManifest(MessageDigestAlgorithm messageDigestAlgorithm) {
this.messageDigestAlgorithm = messageDigestAlgorithm;
// Create message digest
try {
messageDigest = MessageDigest.getInstance(messageDigestAlgorithm.getAlgorithm());
messageDigest.reset();
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException(String.format("Algorithm %s not supported", messageDigestAlgorithm.getAlgorithm()), e);
}
}
/**
* @inheritDoc
*/
public MessageDigest getMessageDigest() {
messageDigest.reset();
return messageDigest;
}
/**
* @inheritDoc
*/
public abstract void add(String filename, MimeType mimeType);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy