Class JavaSha1ChecksumGenerator
- java.lang.Object
-
- org.spdx.utility.verificationcode.JavaSha1ChecksumGenerator
-
- All Implemented Interfaces:
IFileChecksumGenerator
public class JavaSha1ChecksumGenerator extends Object implements IFileChecksumGenerator
Java SHA1 checksum generator using MessageDigest- Author:
- Gary O'Neall
-
-
Constructor Summary
Constructors Constructor Description JavaSha1ChecksumGenerator()Create a SHA1 based checksum generator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFileChecksum(File file)Generate a checksum for the file using SHA1
-
-
-
Constructor Detail
-
JavaSha1ChecksumGenerator
public JavaSha1ChecksumGenerator() throws NoSuchAlgorithmExceptionCreate a SHA1 based checksum generator- Throws:
NoSuchAlgorithmException- if the SHA1 algorithm does not exist
-
-
Method Detail
-
getFileChecksum
public String getFileChecksum(File file) throws IOException
Generate a checksum for the file using SHA1- Specified by:
getFileChecksumin interfaceIFileChecksumGenerator- Parameters:
file- File to generate the checksum for- Returns:
- file checksum
- Throws:
IOException- on IO errors
-
-