Java 8 DHPrivateKey - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DHPrivateKey class.

This code example shows how to use the following methods:getParams, getX
    { 
        if (key instanceof DHPrivateKey)
        { 
            DHPrivateKey    k = (DHPrivateKey)key;
 
            return new DHPrivateKeyParameters(k.getX(),
                new DHParameters(k.getParams().getP(), k.getParams().getG(), null, k.getParams().getL()));
        } 
                         
        throw new InvalidKeyException("can't identify DH private key.");
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
            DHPublicKey k = (DHPublicKey)key;
 
            return new DHPublicKeySpec(k.getY(), k.getParams().getP(), k.getParams().getG());
        } 
 
        return super.engineGetKeySpec(key, spec);
    } 
 
    protected Key engineTranslateKey(
        Key key)
        throws InvalidKeyException 
    { 
        if (key instanceof DHPublicKey)
        { 
            return new BCDHPublicKey((DHPublicKey)key);
        } 
        else if (key instanceof DHPrivateKey)
        { 
            return new BCDHPrivateKey((DHPrivateKey)key);
        } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
    { 
        if (key instanceof DHPrivateKey)
        { 
            DHPrivateKey    k = (DHPrivateKey)key;
 
            return new DHPrivateKeyParameters(k.getX(),
                new DHParameters(k.getParams().getP(), k.getParams().getG(), null, k.getParams().getL()));
        } 
                         
        throw new InvalidKeyException("can't identify DH private key.");
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
        } 
        else if (key instanceof DHPrivateKey)
        { 
            DHPrivateKey    k = (DHPrivateKey)key;
 
            return new ElGamalPrivateKeyParameters(k.getX(),
                new ElGamalParameters(k.getParams().getP(), k.getParams().getG()));
        } 
                         
        throw new InvalidKeyException("can't identify private key for El Gamal.");
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
    } 
 
    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)
        throws IOException 
    { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
            this.p = p.getP();
            this.g = p.getG();
        } 
        else 
        { 
            this.p = privKey.getParams().getP();
            this.g = privKey.getParams().getG();
        } 
 
        this.x = this.result = privKey.getX();
    } 
 
    protected void engineInit( 
        Key             key,
        SecureRandom    random) 
        throws InvalidKeyException 
    { 
        if (!(key instanceof DHPrivateKey))
        { 
            throw new InvalidKeyException("DHKeyAgreement requires DHPrivateKey");
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
    } 
 
    BCDHPrivateKey( 
        DHPrivateKey key)
    { 
        this.x = key.getX();
        this.dhSpec = key.getParams();
    } 
 
    BCDHPrivateKey( 
        DHPrivateKeySpec spec)
    { 
        this.x = spec.getX();
        this.dhSpec = new DHParameterSpec(spec.getP(), spec.getG());
    } 
 
    public BCDHPrivateKey( 
        PrivateKeyInfo info)
        throws IOException 
    { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
    { 
        if (spec.isAssignableFrom(DHPrivateKeySpec.class) && key instanceof DHPrivateKey)
        { 
            DHPrivateKey k = (DHPrivateKey)key;
 
            return new DHPrivateKeySpec(k.getX(), k.getParams().getP(), k.getParams().getG());
        } 
        else if (spec.isAssignableFrom(DHPublicKeySpec.class) && key instanceof DHPublicKey)
        { 
            DHPublicKey k = (DHPublicKey)key;
 
            return new DHPublicKeySpec(k.getY(), k.getParams().getP(), k.getParams().getG());
        } 
 
        return super.engineGetKeySpec(key, spec);
    } 
 
    protected Key engineTranslateKey(
        Key key)
        throws InvalidKeyException 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
    } 
 
    JCEElGamalPrivateKey( 
        DHPrivateKey    key)
    { 
        this.x = key.getX();
        this.elSpec = new ElGamalParameterSpec(key.getParams().getP(), key.getParams().getG());
    } 
     
    JCEElGamalPrivateKey( 
        ElGamalPrivateKeySpec    spec)
    { 
        this.x = spec.getX();
        this.elSpec = new ElGamalParameterSpec(spec.getParams().getP(), spec.getParams().getG());
    } 
 
    JCEElGamalPrivateKey( 
        DHPrivateKeySpec    spec)
    { 
        this.x = spec.getX();
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParams, getX
    } 
 
    BCElGamalPrivateKey( 
        DHPrivateKey key)
    { 
        this.x = key.getX();
        this.elSpec = new ElGamalParameterSpec(key.getParams().getP(), key.getParams().getG());
    } 
     
    BCElGamalPrivateKey( 
        ElGamalPrivateKeySpec spec)
    { 
        this.x = spec.getX();
        this.elSpec = new ElGamalParameterSpec(spec.getParams().getP(), spec.getParams().getG());
    } 
 
    BCElGamalPrivateKey( 
        DHPrivateKeySpec spec)
    { 
        this.x = spec.getX();
6
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 DHPrivateKey Methods: