Java 8 DHPublicKey - 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 DHPublicKey class.

This code example shows how to use the following methods:getParams, getY
    { 
        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;
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
            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 
    { 
        if (key instanceof DHPublicKey)
        { 
            return new BCDHPublicKey((DHPublicKey)key);
        } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
    { 
        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;
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
    } 
 
    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(), params.getParameters().getL());
    } 
 
    JCEDHPublicKey( 
        BigInteger        y,
        DHParameterSpec   dhSpec)
    { 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
        } 
        else if (key instanceof DHPublicKey)
        { 
            DHPublicKey    k = (DHPublicKey)key;
 
            return new ElGamalPublicKeyParameters(k.getY(),
                new ElGamalParameters(k.getParams().getP(), k.getParams().getG()));
        } 
 
        throw new InvalidKeyException("can't identify public key for El Gamal.");
    } 
 
    static public AsymmetricKeyParameter generatePrivateKeyParameter( 
        PrivateKey    key)
        throws InvalidKeyException 
    { 
        if (key instanceof ElGamalPrivateKey)
        { 
            ElGamalPrivateKey    k = (ElGamalPrivateKey)key;
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
    } 
 
    JCEElGamalPublicKey( 
        DHPublicKey    key)
    { 
        this.y = key.getY();
        this.elSpec = new ElGamalParameterSpec(key.getParams().getP(), key.getParams().getG());
    } 
     
    JCEElGamalPublicKey( 
        ElGamalPublicKeyParameters  params)
    { 
        this.y = params.getY();
        this.elSpec = new ElGamalParameterSpec(params.getParameters().getP(), params.getParameters().getG());
    } 
 
    JCEElGamalPublicKey( 
        BigInteger              y,
        ElGamalParameterSpec    elSpec)
    { 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
    } 
 
    BCElGamalPublicKey( 
        DHPublicKey key)
    { 
        this.y = key.getY();
        this.elSpec = new ElGamalParameterSpec(key.getParams().getP(), key.getParams().getG());
    } 
     
    BCElGamalPublicKey( 
        ElGamalPublicKeyParameters params)
    { 
        this.y = params.getY();
        this.elSpec = new ElGamalParameterSpec(params.getParameters().getP(), params.getParameters().getG());
    } 
 
    BCElGamalPublicKey( 
        BigInteger y,
        ElGamalParameterSpec elSpec)
    { 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
    } 
 
    BCDHPublicKey( 
        DHPublicKey key)
    { 
        this.y = key.getY();
        this.dhSpec = key.getParams();
    } 
 
    BCDHPublicKey( 
        DHPublicKeyParameters params)
    { 
        this.y = params.getY();
        this.dhSpec = new DHParameterSpec(params.getParameters().getP(), params.getParameters().getG(), params.getParameters().getL());
    } 
 
    BCDHPublicKey( 
        BigInteger y,
        DHParameterSpec dhSpec)
    { 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
            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 
    { 
        if (key instanceof DHPublicKey)
        { 
            return new BCDHPublicKey((DHPublicKey)key);
        } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getParams, getY
        } 
        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 
    { 
        if (key instanceof DHPublicKey)
        { 
            return new BCElGamalPublicKey((DHPublicKey)key);
        } 
        else if (key instanceof DHPrivateKey)
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 DHPublicKey Methods: