java.security.spec.RSAMultiPrimePrivateCrtKeySpec Java Examples
The following examples show how to use
java.security.spec.RSAMultiPrimePrivateCrtKeySpec.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #2 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if modulus is null */ public final void testRSAMultiPrimePrivateCrtKeySpec02() { try { new RSAMultiPrimePrivateCrtKeySpec( null, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #2
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #3 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if publicExponent is null */ public final void testRSAMultiPrimePrivateCrtKeySpec03() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, null, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #3
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #4 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if privateExponent is null */ public final void testRSAMultiPrimePrivateCrtKeySpec04() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, null, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #4
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #5 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if primeP is null */ public final void testRSAMultiPrimePrivateCrtKeySpec05() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #5
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #6 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if primeQ is null */ public final void testRSAMultiPrimePrivateCrtKeySpec06() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #6
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #7 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if primeExponentP is null */ public final void testRSAMultiPrimePrivateCrtKeySpec07() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null, BigInteger.ONE, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #7
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #8 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if primeExponentQ is null */ public final void testRSAMultiPrimePrivateCrtKeySpec08() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null, BigInteger.ONE, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #8
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #9 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: NullPointerException if crtCoefficient is null */ public final void testRSAMultiPrimePrivateCrtKeySpec09() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null, opi); fail("Expected NPE not thrown"); } catch (NullPointerException e) { } }
Example #9
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #10 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: otherPrimeInfo can be null */ public final void testRSAMultiPrimePrivateCrtKeySpec10() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null); } catch (Exception e) { fail("Unexpected exception is thrown"); } }
Example #10
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Test #11 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: IllegalArgumentException if otherPrimeInfo length is 0 */ public final void testRSAMultiPrimePrivateCrtKeySpec11() { try { new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, new RSAOtherPrimeInfo[0]); fail("Expected IAE not thrown"); } catch (IllegalArgumentException e) { } }
Example #11
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * Tests that internal state of the object * can not be modified by modifying initial array */ public final void testIsStatePreserved1() { // Create initial array RSAOtherPrimeInfo[] opi1 = opi.clone(); RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi1); // Modify initial array opi1[2] = new RSAOtherPrimeInfo(BigInteger.ZERO, BigInteger.ZERO, BigInteger.ZERO); // Check that above modification // does not affect internal state assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo())); }
Example #12
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getPublicExponent()</code> method<br> * Assertion: returns public exponent */ public final void testGetPublicExponent() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getPublicExponent())); }
Example #13
Source File: ConstantPasswords.java From Android_Code_Arbiter with GNU Lesser General Public License v3.0 | 5 votes |
public void bad10() throws Exception { BigInteger bigInteger = new BigInteger("12345", 5); new DSAPrivateKeySpec(bigInteger, null, null, null); new DSAPublicKeySpec(bigInteger, null, bigInteger, null); // report once new DHPrivateKeySpec(bigInteger, null, null); new DHPublicKeySpec(bigInteger, null, null); new ECPrivateKeySpec(bigInteger, null); new RSAPrivateKeySpec(bigInteger, null); new RSAMultiPrimePrivateCrtKeySpec(bigInteger, null, null, null, null, null, null, null, null); new RSAPrivateCrtKeySpec(bigInteger, null, null, null, null, null, null, null); new RSAPublicKeySpec(bigInteger, null); new DSAPublicKeyImpl(bigInteger, null, null, null); }
Example #14
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test #1 for <code>getOtherPrimeInfo()</code> method<br> * Assertion: returns array of RSAOtherPrimeInfo */ public final void testGetOtherPrimeInfo01() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo())); }
Example #15
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test #2 for <code>getOtherPrimeInfo()</code> method<br> * Assertion: returns null if null has been passed to the * constructor as otherPrimeInfo parameter */ public final void testGetOtherPrimeInfo02() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null); assertNull(ks.getOtherPrimeInfo()); }
Example #16
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Tests that internal state of the object * can not be modified using array reference * returned by <code>getOtherPrimeInfo()</code> * method */ public final void testIsStatePreserved2() { // Create initial array RSAOtherPrimeInfo[] opi1 = opi.clone(); RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi1); RSAOtherPrimeInfo[] ret = ks.getOtherPrimeInfo(); // Modify returned array ret[2] = new RSAOtherPrimeInfo(BigInteger.ZERO, BigInteger.ZERO, BigInteger.ZERO); // Check that above modification // does not affect internal state assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo())); }
Example #17
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getModulus()</code> method<br> * Assertion: returns modulus */ public final void testGetModulus() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getModulus())); }
Example #18
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getPrimeQ()</code> method<br> * Assertion: returns prime Q */ public final void testGetPrimeQ() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getPrimeQ())); }
Example #19
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getPrimeP()</code> method<br> * Assertion: returns prime P */ public final void testGetPrimeP() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getPrimeP())); }
Example #20
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getPrimeExponentQ()</code> method<br> * Assertion: returns prime exponent Q */ public final void testGetPrimeExponentQ() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getPrimeExponentQ())); }
Example #21
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getPrimeExponentP()</code> method<br> * Assertion: returns prime exponent P */ public final void testGetPrimeExponentP() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getPrimeExponentP())); }
Example #22
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getCrtCoefficient()</code> method<br> * Assertion: returns crt coefficient */ public final void testGetCrtCoefficient() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getCrtCoefficient())); }
Example #23
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test for <code>getPrivateExponent()</code> method<br> * Assertion: returns private exponent */ public final void testGetPrivateExponent() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(BigInteger.ONE.equals(ks.getPrivateExponent())); }
Example #24
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 3 votes |
/** * Test #12 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: constructs <code>RSAMultiPrimePrivateCrtKeySpec</code> * object using valid parameters. Constructed object must be * instance of RSAPrivateKeySpec. */ public final void testRSAMultiPrimePrivateCrtKeySpec12() { KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(ks instanceof RSAPrivateKeySpec); }
Example #25
Source File: RSAMultiPrimePrivateCrtKeySpecTest.java From j2objc with Apache License 2.0 | 3 votes |
/** * Test #1 for * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, * BigInteger publicExponent, * BigInteger privateExponent, * BigInteger primeP, * BigInteger primeQ, * BigInteger primeExponentP, * BigInteger primeExponentQ, * BigInteger crtCoefficient, * RSAOtherPrimeInfo[] otherPrimeInfo) * </code> ctor<br> * Assertion: constructs <code>RSAMultiPrimePrivateCrtKeySpec</code> * object using valid parameters */ public final void testRSAMultiPrimePrivateCrtKeySpec01() { KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi); assertTrue(ks instanceof RSAMultiPrimePrivateCrtKeySpec); }