Package org.bouncycastle.bcpg

Examples of org.bouncycastle.bcpg.MPInteger


           
            try
            {
                MessageDigest   digest = MessageDigest.getInstance("MD5");
           
                byte[]  bytes = new MPInteger(rK.getModulus()).getEncoded();
                digest.update(bytes, 2, bytes.length - 2);
           
                bytes = new MPInteger(rK.getPublicExponent()).getEncoded();
                digest.update(bytes, 2, bytes.length - 2);
           
                this.fingerprint = digest.digest();
            }
            catch (NoSuchAlgorithmException e)
View Full Code Here


            throw new PGPException("exception encoding signature", e);
        }

        MPInteger[] values = new MPInteger[2];
       
        values[0] = new MPInteger(i1.getValue());
        values[1] = new MPInteger(i2.getValue());
       
        return values;
    }
View Full Code Here

        if (keyAlgorithm == PublicKeyAlgorithmTags.RSA_SIGN
            || keyAlgorithm == PublicKeyAlgorithmTags.RSA_GENERAL)
            // an RSA signature
        {
            sigValues = new MPInteger[1];
            sigValues[0] = new MPInteger(new BigInteger(1, sig.sign()));
        }
        else
        {
            sigValues = PGPUtil.dsaSigToMpi(sig.sign());
        }
View Full Code Here

        if (contentSigner.getKeyAlgorithm() == PublicKeyAlgorithmTags.RSA_SIGN
            || contentSigner.getKeyAlgorithm() == PublicKeyAlgorithmTags.RSA_GENERAL)
            // an RSA signature
        {
            sigValues = new MPInteger[1];
            sigValues[0] = new MPInteger(new BigInteger(1, contentSigner.getSignature()));
        }
        else
        {
            sigValues = PGPUtil.dsaSigToMpi(contentSigner.getSignature());
        }
View Full Code Here

            throw new PGPException("exception encoding signature", e);
        }

        MPInteger[] values = new MPInteger[2];
       
        values[0] = new MPInteger(i1.getValue());
        values[1] = new MPInteger(i2.getValue());
       
        return values;
    }
View Full Code Here

            try
            {
                digest = new MD5Digest();

                byte[]  bytes = new MPInteger(rK.getModulus()).getEncoded();
                digest.update(bytes, 2, bytes.length - 2);

                bytes = new MPInteger(rK.getPublicExponent()).getEncoded();
                digest.update(bytes, 2, bytes.length - 2);
            }
            catch (IOException e)
            {
                throw new PGPException("can't encode key components: " + e.getMessage(), e);
View Full Code Here

            try
            {
                MessageDigest digest = MessageDigest.getInstance("MD5");

                byte[]  bytes = new MPInteger(rK.getModulus()).getEncoded();
                digest.update(bytes, 2, bytes.length - 2);

                bytes = new MPInteger(rK.getPublicExponent()).getEncoded();
                digest.update(bytes, 2, bytes.length - 2);

                return digest.digest();
            }
            catch (NoSuchAlgorithmException e)
View Full Code Here

        if (contentSigner.getKeyAlgorithm() == PublicKeyAlgorithmTags.RSA_SIGN
            || contentSigner.getKeyAlgorithm() == PublicKeyAlgorithmTags.RSA_GENERAL)    // an RSA signature
        {
            sigValues = new MPInteger[1];
            sigValues[0] = new MPInteger(new BigInteger(1, contentSigner.getSignature()));
        }
        else
        {  
            sigValues = PGPUtil.dsaSigToMpi(contentSigner.getSignature());
        }
View Full Code Here

        if (keyAlgorithm == PublicKeyAlgorithmTags.RSA_SIGN
            || keyAlgorithm == PublicKeyAlgorithmTags.RSA_GENERAL)
            // an RSA signature
        {
            sigValues = new MPInteger[1];
            sigValues[0] = new MPInteger(new BigInteger(1, sig.sign()));
        }
        else
        {
            sigValues = PGPUtil.dsaSigToMpi(sig.sign());
        }
View Full Code Here

            throw new PGPException("exception encoding signature", e);
        }

        MPInteger[] values = new MPInteger[2];
       
        values[0] = new MPInteger(i1.getValue());
        values[1] = new MPInteger(i2.getValue());
       
        return values;
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.bcpg.MPInteger

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.