Examples of PKCS1Encoding


Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    static public class MD5WithRSAEncryption
        extends JDKDigestSignature
    {
        public MD5WithRSAEncryption()
        {
            super(md5, new MD5Digest(), new PKCS1Encoding(new RSABlindedEngine()));
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    static public class RIPEMD160WithRSAEncryption
        extends JDKDigestSignature
    {
        public RIPEMD160WithRSAEncryption()
        {
            super(TeleTrusTObjectIdentifiers.ripemd160, new RIPEMD160Digest(), new PKCS1Encoding(new RSABlindedEngine()));
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    static public class RIPEMD128WithRSAEncryption
        extends JDKDigestSignature
    {
        public RIPEMD128WithRSAEncryption()
        {
            super(TeleTrusTObjectIdentifiers.ripemd128, new RIPEMD128Digest(), new PKCS1Encoding(new RSABlindedEngine()));
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    static public class RIPEMD256WithRSAEncryption
        extends JDKDigestSignature
    {
        public RIPEMD256WithRSAEncryption()
        {
            super(TeleTrusTObjectIdentifiers.ripemd256, new RIPEMD256Digest(), new PKCS1Encoding(new RSABlindedEngine()));
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    static public class PKCS1v1_5Padding
        extends JCEElGamalCipher
    {
        public PKCS1v1_5Padding()
        {
            super(new PKCS1Encoding(new ElGamalEngine()));
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

        {
            cipher = new BufferedAsymmetricBlockCipher(new ElGamalEngine());
        }
        else if (pad.equals("PKCS1PADDING"))
        {
            cipher = new BufferedAsymmetricBlockCipher(new PKCS1Encoding(new ElGamalEngine()));
        }
        else if (pad.equals("ISO9796-1PADDING"))
        {
            cipher = new BufferedAsymmetricBlockCipher(new ISO9796d1Encoding(new ElGamalEngine()));
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    return this.mod;
  }

  private String generate() throws Exception{
    RSAKeyParameters pubParameters = new RSAKeyParameters(false, mod, exp);
    AsymmetricBlockCipher eng = new PKCS1Encoding(new RSAEngine());
    eng.init(true, pubParameters);
    byte[] data = Base16.fromHexString(this.sessionKey);
    data = eng.processBlock(data, 0, data.length);
    return Base16.toHexString(data);
  }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

        }

        //
        // PKCS1 - public encrypt, private decrypt
        //
        eng = new PKCS1Encoding(eng);

        eng.init(true, pubParameters);

        try
        {
            data = eng.processBlock(data, 0, data.length);
        }
        catch (Exception e)
        {
            return new SimpleTestResult(false, "RSA: failed - exception " + e.toString());
        }

        eng.init(false, privParameters);

        try
        {
            data = eng.processBlock(data, 0, data.length);
        }
        catch (Exception e)
        {
            return new SimpleTestResult(false, "RSA: failed - exception " + e.toString());
        }

        if (!input.equals(new String(Hex.encode(data))))
        {
            return new SimpleTestResult(false, "RSA: failed PKCS1 public/private Test");
        }

        //
        // PKCS1 - private encrypt, public decrypt
        //
        eng = new PKCS1Encoding(((PKCS1Encoding)eng).getUnderlyingCipher());

        eng.init(true, privParameters);

        try
        {
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

                                            *
                                            * Prepare an PKCS1Encoding with good random
                                            * padding.
                                            */
                                            RSABlindedEngine rsa = new RSABlindedEngine();
                                            PKCS1Encoding encoding = new PKCS1Encoding(rsa);
                                            encoding.init(true, new ParametersWithRandom(this.serverPublicKey, this.random));
                                            byte[] encrypted = null;
                                            try
                                            {
                                                encrypted = encoding.processBlock(pms, 0, pms.length);
                                            }
                                            catch (InvalidCipherTextException e)
                                            {
                                                /*
                                                * This should never happen, only during decryption.
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding

    static public class SHA1WithRSAEncryption
        extends JDKDigestSignature
    {
        public SHA1WithRSAEncryption()
        {
            super(X509ObjectIdentifiers.id_SHA1, new SHA1Digest(), new PKCS1Encoding(new RSABlindedEngine()));
        }
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.