Package org.bouncycastle.jce.interfaces

Examples of org.bouncycastle.jce.interfaces.ElGamalKey


    protected int engineGetKeySize(
        Key     key)
    {
        if (key instanceof ElGamalKey)
        {
            ElGamalKey   k = (ElGamalKey)key;

            return k.getParameters().getP().bitLength();
        }
        else if (key instanceof DHKey)
        {
            DHKey   k = (DHKey)key;

            return k.getParams().getP().bitLength();
        }

        throw new IllegalArgumentException("not an ElGamal key!");
    }
View Full Code Here


    protected int engineGetKeySize(
        Key     key)
    {
        if (key instanceof ElGamalKey)
        {
            ElGamalKey   k = (ElGamalKey)key;

            return k.getParameters().getP().bitLength();
        }
        else if (key instanceof DHKey)
        {
            DHKey   k = (DHKey)key;

            return k.getParams().getP().bitLength();
        }

        throw new IllegalArgumentException("not an ElGamal key!");
    }
View Full Code Here

                c1.update(bi);
            }
        }
        else
        {
            ElGamalKey k = (ElGamalKey)privKey.getKey();
            int           size = (k.getParameters().getP().bitLength() + 7) / 8;
            byte[]        tmp = new byte[size];

            byte[]        bi = keyD[0].toByteArray();
            if (bi.length > size)
            {
View Full Code Here

    protected int engineGetKeySize(
        Key     key)
    {
        if (key instanceof ElGamalKey)
        {
            ElGamalKey   k = (ElGamalKey)key;

            return k.getParameters().getP().bitLength();
        }
        else if (key instanceof DHKey)
        {
            DHKey   k = (DHKey)key;

            return k.getParams().getP().bitLength();
        }

        throw new IllegalArgumentException("not an ElGamal key!");
    }
View Full Code Here

                c1.update(bi);
            }
        }
        else
        {
            ElGamalKey k = (ElGamalKey)privKey;
            int size = (k.getParameters().getP().bitLength() + 7) / 8;
            byte[] tmp = new byte[size];

            byte[] bi = secKeyData[0].toByteArray();
            if (bi.length > size)
            {
View Full Code Here

                c1.update(bi);
            }
        }
        else
        {
            ElGamalKey k = (ElGamalKey)privKey.getKey();
            int           size = (k.getParameters().getP().bitLength() + 7) / 8;
            byte[]        tmp = new byte[size];

            byte[]        bi = keyD[0].toByteArray();
            if (bi.length > size)
            {
View Full Code Here

    protected int engineGetKeySize(
        Key     key)
    {
        if (key instanceof ElGamalKey)
        {
            ElGamalKey   k = (ElGamalKey)key;

            return k.getParameters().getP().bitLength();
        }
        else if (key instanceof DHKey)
        {
            DHKey   k = (DHKey)key;

            return k.getParams().getP().bitLength();
        }

        throw new IllegalArgumentException("not an ElGamal key!");
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.jce.interfaces.ElGamalKey

Copyright © 2018 www.massapicom. 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.