Skip to content

Commit

Permalink
removed use of ElGamalPublicKey (reduce portability issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Jul 28, 2024
1 parent 310b30a commit 2827a0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import org.bouncycastle.jcajce.util.DefaultJcaJceHelper;
import org.bouncycastle.jcajce.util.NamedJcaJceHelper;
import org.bouncycastle.jcajce.util.ProviderJcaJceHelper;
import org.bouncycastle.jce.interfaces.ElGamalPublicKey;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.math.ec.rfc7748.X25519;
Expand Down Expand Up @@ -560,8 +559,8 @@ private BCPGKey getPublicBCPGKey(int algorithm, PGPAlgorithmParameters algorithm
case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT:
case PublicKeyAlgorithmTags.ELGAMAL_GENERAL:
{
ElGamalPublicKey egK = (ElGamalPublicKey) pubKey;
return new ElGamalPublicBCPGKey(egK.getParameters().getP(), egK.getParameters().getG(), egK.getY());
DHPublicKey egK = (DHPublicKey) pubKey;
return new ElGamalPublicBCPGKey(egK.getParams().getP(), egK.getParams().getG(), egK.getY());
}
case PublicKeyAlgorithmTags.DSA:
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import javax.crypto.interfaces.DHPublicKey;

/**
* @deprecated just use DHPublicKey.
*/
public interface ElGamalPublicKey
extends ElGamalKey, DHPublicKey
{
Expand Down

0 comments on commit 2827a0b

Please sign in to comment.