Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update EncryptionCore.java
  • Loading branch information
cyberphone committed Apr 4, 2019
1 parent 08775c8 commit b1ebf19
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions app/src/main/java/org/webpki/json/EncryptionCore.java
Expand Up @@ -31,16 +31,13 @@
import java.security.interfaces.ECPublicKey;

import java.security.spec.ECGenParameterSpec;
import java.security.spec.MGF1ParameterSpec;

import javax.crypto.Cipher;
import javax.crypto.KeyAgreement;
import javax.crypto.Mac;

import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.OAEPParameterSpec;
import javax.crypto.spec.PSource;
import javax.crypto.spec.SecretKeySpec;

import org.webpki.crypto.CryptoRandom;
Expand Down Expand Up @@ -212,12 +209,7 @@ private static byte[] rsaCore(int mode,
Cipher.getInstance(keyEncryptionAlgorithm.jceName)
:
Cipher.getInstance(keyEncryptionAlgorithm.jceName, rsaProviderName);
if (keyEncryptionAlgorithm == KeyEncryptionAlgorithms.JOSE_RSA_OAEP_256_ALG_ID) {
cipher.init(mode, key, new OAEPParameterSpec(
"SHA-256", "MGF1", MGF1ParameterSpec.SHA256, PSource.PSpecified.DEFAULT));
} else {
cipher.init(mode, key);
}
cipher.init(mode, key);
return cipher.doFinal(data);
}

Expand Down

0 comments on commit b1ebf19

Please sign in to comment.