Code example for DHPrivateKey

Methods: getParams, getX

0
    } 
 
    JCEDHPrivateKey( 
        DHPrivateKey    key)
    { 
        this.x = key.getX();
        this.dhSpec = key.getParams();
    } 
 
    JCEDHPrivateKey( 
        DHPrivateKeySpec    spec)
    { 
        this.x = spec.getX();
        this.dhSpec = new DHParameterSpec(spec.getP(), spec.getG());
    } 
 
    JCEDHPrivateKey( 
        PrivateKeyInfo  info)
    { 
        DHParameter     params = new DHParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
        DERInteger      derX = (DERInteger)info.getPrivateKey();