Package org.bouncycastle.crypto.params

Examples of org.bouncycastle.crypto.params.ParametersWithRandom


    {
        if (forSigning)
        {
            if (param instanceof ParametersWithRandom)
            {
                ParametersWithRandom    rParam = (ParametersWithRandom)param;

                this.random = rParam.getRandom();
                this.key = (ECPrivateKeyParameters)rParam.getParameters();
            }
            else
            {
                this.random = new SecureRandom();
                this.key = (ECPrivateKeyParameters)param;
View Full Code Here


        RSAKeyParameters    kParam = null;
        int                    lengthOfSalt = saltLength;

        if (param instanceof ParametersWithRandom)
        {
            ParametersWithRandom    p = (ParametersWithRandom)param;

            kParam = (RSAKeyParameters)p.getParameters();
            random = p.getRandom();
        }
        else if (param instanceof ParametersWithSalt)
        {
            ParametersWithSalt    p = (ParametersWithSalt)param;

            kParam = (RSAKeyParameters)p.getParameters();
            standardSalt = p.getSalt();
            lengthOfSalt = standardSalt.length;
        }
        else
        {
            kParam = (RSAKeyParameters)param;
View Full Code Here

        dsaKeyGen.init(genParam);

        AsymmetricCipherKeyPair  pair = dsaKeyGen.generateKeyPair();

        ParametersWithRandom param = new ParametersWithRandom(pair.getPrivate(), keyRandom);

        DSASigner dsa = new DSASigner();

        dsa.init(true, param);
View Full Code Here

            ECPrivateKeyParameters priKey = new ECPrivateKeyParameters(
                new BigInteger("651056770906015076056810763456358567190100156695615665659"), // d
                params);

            ParametersWithRandom param = new ParametersWithRandom(priKey, k);

            ECDSASigner ecdsa = new ECDSASigner();

            ecdsa.init(true, param);
View Full Code Here

            ECPrivateKeyParameters priKey = new ECPrivateKeyParameters(
                new BigInteger("876300101507107567501066130761671078357010671067781776716671676178726717"), // d
                params);

            ECDSASigner ecdsa = new ECDSASigner();
            ParametersWithRandom param = new ParametersWithRandom(priKey, k);

            ecdsa.init(true, param);

            byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").toByteArray();
            BigInteger[] sig = ecdsa.generateSignature(message);
View Full Code Here

            pGen.init(genParam);

            AsymmetricCipherKeyPair  pair = pGen.generateKeyPair();
       
            ParametersWithRandom param = new ParametersWithRandom(pair.getPrivate(), random);

            ECDSASigner ecdsa = new ECDSASigner();

            ecdsa.init(true, param);
View Full Code Here

                                                        privStruct.getExponent2(),
                                                        privStruct.getCoefficient());
   
            AsymmetricBlockCipher   cipher = new OAEPEncoding(new RSAEngine());
   
            cipher.init(true, new ParametersWithRandom(pubParameters, new Rand()));
   
            byte[]  out;
            byte[]  input = new byte[]
                { (byte)0x54, (byte)0x85, (byte)0x9b, (byte)0x34, (byte)0x2c, (byte)0x49, (byte)0xea, (byte)0x2a };
   
View Full Code Here

    {
        AsymmetricKeyParameter  kParam;

        if (param instanceof ParametersWithRandom)
        {
            ParametersWithRandom  rParam = (ParametersWithRandom)param;

            this.random = rParam.getRandom();
            kParam = (AsymmetricKeyParameter)rParam.getParameters();
        }
        else
        {  
            this.random = new SecureRandom();
            kParam = (AsymmetricKeyParameter)param;
View Full Code Here

        byte[]              msg,
        byte[]              sig)
    {
        PSSSigner           eng = new PSSSigner(new RSAEngine(), new SHA1Digest(), 20);

        eng.init(true, new ParametersWithRandom(prv, new FixedRandom(slt)));

        try
        {
            eng.update(msg, 0, msg.length);
View Full Code Here

        SecureRandom    random = new SecureRandom();
        random.nextBytes(data);
       
        for (int j = 0; j < NUM_TESTS; j++)
        {
            eng.init(true, new ParametersWithRandom(prv8, new SecureRandom()));
       
            try
            {
                eng.update(data, 0, data.length);
       
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.params.ParametersWithRandom

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.