|
1 | 1 | package org.jfrog.build.api.util;
|
2 | 2 |
|
3 |
| -import com.amazon.corretto.crypto.provider.AmazonCorrettoCryptoProvider; |
4 |
| - |
5 | 3 | import java.io.File;
|
6 | 4 | import java.io.FileInputStream;
|
7 | 5 | import java.io.IOException;
|
8 | 6 | import java.security.MessageDigest;
|
9 | 7 | import java.security.NoSuchAlgorithmException;
|
10 | 8 | import java.util.HashMap;
|
11 | 9 | import java.util.Map;
|
12 |
| -import java.util.concurrent.atomic.AtomicBoolean; |
13 | 10 |
|
14 | 11 | /**
|
15 | 12 | * File checksum calculator class
|
|
18 | 15 | */
|
19 | 16 | public abstract class FileChecksumCalculator {
|
20 | 17 |
|
21 |
| - private static final AtomicBoolean ACCP_INITIALIZED = new AtomicBoolean(); |
22 | 18 | public static final String SHA256_ALGORITHM = "SHA-256";
|
23 | 19 | public static final String SHA1_ALGORITHM = "SHA1";
|
24 | 20 | public static final String MD5_ALGORITHM = "MD5";
|
25 | 21 | private static final int BUFFER_SIZE = 32768;
|
26 | 22 |
|
27 |
| - /** |
28 |
| - * Installs the AmazonCorrettoCryptoProvider provider as the highest-priority (i.e. default) provider systemwide. |
29 |
| - */ |
30 |
| - private static void initAmazonCorrettoCryptoProvider() { |
31 |
| - AmazonCorrettoCryptoProvider.install(); |
32 |
| - } |
33 |
| - |
34 | 23 | /**
|
35 | 24 | * Calculates the given file's checksums
|
36 | 25 | *
|
@@ -82,9 +71,6 @@ public static Map<String, String> calculateChecksums(File fileToCalculate, Strin
|
82 | 71 | */
|
83 | 72 | private static Map<String, String> calculate(File fileToCalculate, String... algorithms)
|
84 | 73 | throws NoSuchAlgorithmException, IOException {
|
85 |
| - if (ACCP_INITIALIZED.compareAndSet(false, true)) { |
86 |
| - initAmazonCorrettoCryptoProvider(); |
87 |
| - } |
88 | 74 | Map<String, MessageDigest> digestMap = new HashMap<>();
|
89 | 75 | Map<String, String> checksumMap = new HashMap<>();
|
90 | 76 |
|
|
0 commit comments