Skip to content

Commit

Permalink
Added private constructor to CryptographicAlgorithmKey
Browse files Browse the repository at this point in the history
  • Loading branch information
exceptionfactory committed May 22, 2024
1 parent 70ae60d commit 05abe74
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class CryptographicAlgorithmKey implements SecretKey {
* @param cryptographicAlgorithm Cryptographic Algorithm
*/
CryptographicAlgorithmKey(final byte[] key, final CryptographicKeyType cryptographicKeyType, final CryptographicAlgorithm cryptographicAlgorithm) {
this.key = getValidatedKey(key, cryptographicKeyType);
this(getValidatedKey(key, cryptographicKeyType), cryptographicAlgorithm);
}

private CryptographicAlgorithmKey(final byte[] validatedKey, final CryptographicAlgorithm cryptographicAlgorithm) {
this.key = validatedKey;
this.cryptographicAlgorithm = Objects.requireNonNull(cryptographicAlgorithm, "Algorithm required");
}

Expand Down

0 comments on commit 05abe74

Please sign in to comment.