Code example for DHParameterSpec

0
 
    JCEDHPublicKey( 
        DHPublicKeySpec    spec)
    { 
        this.y = spec.getY();
        this.dhSpec = new DHParameterSpec(spec.getP(), spec.getG());
    } 
 
    JCEDHPublicKey( 
        DHPublicKey    key)
    { 
        this.y = key.getY();
        this.dhSpec = key.getParams();
    } 
 
    JCEDHPublicKey( 
        DHPublicKeyParameters  params)
    { 
        this.y = params.getY();
        this.dhSpec = new DHParameterSpec(params.getParameters().getP(), params.getParameters().getG(), 0);
    }