Package org.bouncycastle.crypto.signers

Examples of org.bouncycastle.crypto.signers.ISO9796d2Signer


    protected ISOSignatureSpi(
        Digest digest,
        AsymmetricBlockCipher cipher)
    {
        signer = new ISO9796d2Signer(cipher, digest, true);
    }
View Full Code Here


    protected JDKISOSignature(
        Digest digest,
        AsymmetricBlockCipher cipher)
    {
        signer = new ISO9796d2Signer(cipher, digest, true);
    }
View Full Code Here

        byte[]              data;

        //
        // ISO 9796-2 - Signing
        //
        ISO9796d2Signer eng = new ISO9796d2Signer(rsa, new RIPEMD128Digest());

        eng.init(true, privParameters);

        try
        {
            eng.update(msg4[0]);
            eng.update(msg4, 1, msg4.length - 1);

            data = eng.generateSignature();
        }
        catch (Exception e)
        {
            return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
        }

        eng.init(false, pubParameters);

        if (!isSameAs(sig4, 0, data))
        {
            return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 generation Test 4");
        }

        eng.update(msg4[0]);
        eng.update(msg4, 1, msg4.length - 1);

        if (!eng.verifySignature(sig4))
        {
            return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 verify Test 4");
        }

        return new SimpleTestResult(true, "ISO9796: Okay");
View Full Code Here

        byte[]              data;

        //
        // ISO 9796-2 - Signing
        //
        ISO9796d2Signer eng = new ISO9796d2Signer(rsa, new RIPEMD160Digest(), true);

        eng.init(true, privParameters);

        try
        {
            eng.update(msg5[0]);
            eng.update(msg5, 1, msg5.length - 1);

            data = eng.generateSignature();
        }
        catch (Exception e)
        {
            return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
        }

        eng.init(false, pubParameters);

        if (!isSameAs(sig5, 0, data))
        {
            return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 generation Test 5");
        }

        eng.update(msg5[0]);
        eng.update(msg5, 1, msg5.length - 1);

        if (!eng.verifySignature(sig5))
        {
            return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 verify Test 5");
        }

        return new SimpleTestResult(true, "ISO9796: Okay");
View Full Code Here

        Digest                  digest,
        AsymmetricBlockCipher   cipher)
    {
        super(name);

        signer = new ISO9796d2Signer(cipher, digest, true);
    }
View Full Code Here

        Digest                  digest,
        AsymmetricBlockCipher   cipher)
    {
        super(name);

        signer = new ISO9796d2Signer(cipher, digest, true);
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.signers.ISO9796d2Signer

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.