Skip to content

Commit 4dfe3c6

Browse files
committed
Remove not needed stuff
1 parent 1e35af6 commit 4dfe3c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/mastercard/developer/encryption/EncryptionConfigBuilder.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ void computeEncryptionKeyFingerprintWhenNeeded() throws EncryptionException {
2929
// No encryption certificate / encryption key set or key fingerprint already provided
3030
return;
3131
}
32-
final PublicKey publicKey;
3332
if (encryptionKey != null && encryptionCertificate != null) {
3433
throw new IllegalArgumentException("You can only supply either an encryption key or an encryption certificate");
3534
}
35+
final PublicKey publicKey;
3636
if (encryptionKey != null) {
3737
publicKey = encryptionKey;
38-
} else if (encryptionCertificate != null) {
39-
publicKey = encryptionCertificate.getPublicKey();
4038
} else {
41-
throw new IllegalArgumentException("You need to supply either one of the encryption key or the encryption certificate");
39+
publicKey = encryptionCertificate.getPublicKey();
4240
}
4341
byte[] keyFingerprintBytes = sha256digestBytes(publicKey.getEncoded());
4442
encryptionKeyFingerprint = encodeBytes(keyFingerprintBytes, FieldLevelEncryptionConfig.FieldValueEncoding.HEX);

0 commit comments

Comments
 (0)