Examples of KeyAgreement


Examples of javax.crypto.KeyAgreement

        if (!DEFSupported) {
            fail(NotSupportMsg);
            return;
        }
        KeyAgreementSpi spi = new MyKeyAgreementSpi();
        KeyAgreement keyA = new myKeyAgreement(spi, defaultProvider,
                defaultAlgorithm);
        assertEquals("Incorrect algorithm", keyA.getAlgorithm(),
                defaultAlgorithm);
        assertEquals("Incorrect provider", keyA.getProvider(), defaultProvider);
        assertNull("Incorrect result", keyA.doPhase(null, true));
        assertEquals("Incorrect result", keyA.generateSecret().length, 0);

        keyA = new myKeyAgreement(null, null, null);
        assertNull("Algorithm must be null", keyA.getAlgorithm());
        assertNull("Provider must be null", keyA.getProvider());
        try {
            keyA.doPhase(null, true);
            fail("NullPointerException must be thrown");
        } catch (NullPointerException e) {
        }
    }
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.