io.github.chains_project.maven_lockfile.checksum.AbstractChecksumCalculator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-lockfile Show documentation
Show all versions of maven-lockfile Show documentation
This plugin is a state-of-the-art solution that can be used to validate the integrity
of a maven repository.
It does this by generating a lock file that contains the checksums of all the artifacts in the
repository.
The lock file can then be used to validate the integrity of the repository.
This guards the supply chain against malicious actors that might tamper with the artifacts in
the repository.
The newest version!
package io.github.chains_project.maven_lockfile.checksum;
import org.apache.maven.artifact.Artifact;
public abstract class AbstractChecksumCalculator {
protected String checksumAlgorithm;
AbstractChecksumCalculator(String checksumAlgorithm) {
if (checksumAlgorithm == null || checksumAlgorithm.isEmpty()) {
this.checksumAlgorithm = getDefaultChecksumAlgorithm();
} else {
this.checksumAlgorithm = checksumAlgorithm;
}
}
/**
* @return the checksumAlgorithm
*/
public String getChecksumAlgorithm() {
return checksumAlgorithm;
}
public abstract String calculateChecksum(Artifact artifact);
public abstract String getDefaultChecksumAlgorithm();
}