Examples of DHParameterSpec


Examples of javax.crypto.spec.DHParameterSpec

            params = dhDefaultParams;
        }

        if (params instanceof DHParameterSpec)
        {
            DHParameterSpec spec = (DHParameterSpec)params;

            if (spec.getP().bitLength() == keySize)
            {
                return spec;
            }
        }
        else if (params instanceof DHParameterSpec[])
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

   
    JCEDHPublicKey(
        DHPublicKeySpec    spec)
    {
        this.y = spec.getY();
        this.dhSpec = new DHParameterSpec(spec.getP(), spec.getG());
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

    JCEDHPublicKey(
        DHPublicKeyParameters  params)
    {
        this.y = params.getY();
        this.dhSpec = new DHParameterSpec(params.getParameters().getP(), params.getParameters().getG(), params.getParameters().getL());
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

        {
            DHParameter             params = DHParameter.getInstance(seq);

            if (params.getL() != null)
            {
                this.dhSpec = new DHParameterSpec(params.getP(), params.getG(), params.getL().intValue());
            }
            else
            {
                this.dhSpec = new DHParameterSpec(params.getP(), params.getG());
            }
        }
        else if (id.equals(X9ObjectIdentifiers.dhpublicnumber))
        {
            DHDomainParameters params = DHDomainParameters.getInstance(seq);

            this.dhSpec = new DHParameterSpec(params.getP().getValue(), params.getG().getValue());
        }
        else
        {
            throw new IllegalArgumentException("unknown algorithm type: " + id);
        }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

    private void readObject(
        ObjectInputStream   in)
        throws IOException, ClassNotFoundException
    {
        this.y = (BigInteger)in.readObject();
        this.dhSpec = new DHParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), in.readInt());
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

        return elSpec;
    }

    public DHParameterSpec getParams()
    {
        return new DHParameterSpec(elSpec.getP(), elSpec.getG());
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

        {
            return currentSpec;
        }
        else if (paramSpec == DHParameterSpec.class)
        {
            return new DHParameterSpec(currentSpec.getP(), currentSpec.getG());
        }

        throw new InvalidParameterSpecException("unknown parameter spec passed to ElGamal parameters object.");
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

        {
            this.currentSpec = (ElGamalParameterSpec)paramSpec;
        }
        else
        {
            DHParameterSpec s = (DHParameterSpec)paramSpec;

            this.currentSpec = new ElGamalParameterSpec(s.getP(), s.getG());
        }
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

        return elSpec;
    }
   
    public DHParameterSpec getParams()
    {
        return new DHParameterSpec(elSpec.getP(), elSpec.getG());
    }
View Full Code Here

Examples of javax.crypto.spec.DHParameterSpec

        AlgorithmParameters params;

        try
        {
            params = AlgorithmParameters.getInstance("ElGamal", BouncyCastleProvider.PROVIDER_NAME);
            params.init(new DHParameterSpec(p.getP(), p.getG(), l));
        }
        catch (Exception e)
        {
            throw new RuntimeException(e.getMessage());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.