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

DSAUtil

public class DSAUtil extends Object
utility class for converting jce/jca DSA 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 DSAPrivateKey)
        {
            DSAPrivateKey    k = (DSAPrivateKey)key;

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

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

            return new DSAPublicKeyParameters(k.getY(),
                new DSAParameters(k.getParams().getP(), k.getParams().getQ(), k.getParams().getG()));
        }

        throw new InvalidKeyException("can't identify DSA public key: " + key.getClass().getName());