Code example for DHPublicKey

Methods: getParams, getY

0
    { 
        if (key instanceof DHPublicKey)
        { 
            DHPublicKey    k = (DHPublicKey)key;
 
            return new DHPublicKeyParameters(k.getY(),
                new DHParameters(k.getParams().getP(), k.getParams().getG(), null, k.getParams().getL()));
        } 
 
        throw new InvalidKeyException("can't identify DH public key.");
    } 
 
    static public AsymmetricKeyParameter generatePrivateKeyParameter( 
        PrivateKey    key)
        throws InvalidKeyException 
    { 
        if (key instanceof DHPrivateKey)
        { 
            DHPrivateKey    k = (DHPrivateKey)key;
 
            return new DHPrivateKeyParameters(k.getX(),