FileDocCategorySizeDatePackage
ElGamalUtil.javaAPI DocAzureus 3.0.3.41679Tue Jun 08 05:12:56 BST 2004org.bouncycastle.jce.provider

ElGamalUtil

public class ElGamalUtil extends Object
utility class for converting jce/jca ElGamal objects objects into their org.bouncycastle.crypto counterparts.

Fields Summary
Constructors Summary
Methods Summary
public static org.bouncycastle.crypto.params.AsymmetricKeyParametergeneratePrivateKeyParameter(java.security.PrivateKey key)

        if (key instanceof ElGamalPrivateKey)
        {
            ElGamalPrivateKey    k = (ElGamalPrivateKey)key;

            return new ElGamalPrivateKeyParameters(k.getX(),
                new ElGamalParameters(k.getParams().getP(), k.getParams().getG()));
        }
                        
        throw new InvalidKeyException("can't identify ElGamal private key.");
    
public static org.bouncycastle.crypto.params.AsymmetricKeyParametergeneratePublicKeyParameter(java.security.PublicKey key)

        if (key instanceof ElGamalPublicKey)
        {
            ElGamalPublicKey    k = (ElGamalPublicKey)key;

            return new ElGamalPublicKeyParameters(k.getY(),
                new ElGamalParameters(k.getParams().getP(), k.getParams().getG()));
        }

        throw new InvalidKeyException("can't identify ElGamal public key.");