Java 类java.security.spec.RSAOtherPrimeInfo 实例源码
项目:j2objc
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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) {
}
}
项目:j2objc
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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()));
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test #2 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if prime is null
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAOtherPrimeInfo",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
)
public final void testRSAOtherPrimeInfo02() {
try {
new RSAOtherPrimeInfo(null,
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test #3 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if primeExponent is null
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAOtherPrimeInfo",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
)
public final void testRSAOtherPrimeInfo03() {
try {
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
null,
BigInteger.valueOf(3L));
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test #4 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if crtCoefficient is null
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAOtherPrimeInfo",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
)
public final void testRSAOtherPrimeInfo04() {
try {
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
null);
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test #5 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if prime and crtCoefficient is null
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAOtherPrimeInfo",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
)
public final void testRSAOtherPrimeInfo05() {
try {
new RSAOtherPrimeInfo(null,
BigInteger.valueOf(2L),
null);
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies constructor with valid parameters.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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);
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies NullPointerException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies null otherPrimeInfo.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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");
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies IllegalArgumentException.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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) {
}
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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.
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies constructor using valid parameters. Constructed object must be instance of RSAPrivateKeySpec.",
method = "RSAMultiPrimePrivateCrtKeySpec",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
)
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);
}
项目:cn1
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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) {
}
}
项目:cn1
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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()));
}
项目:freeVM
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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) {
}
}
项目:freeVM
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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()));
}
项目:freeVM
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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) {
}
}
项目:freeVM
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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()));
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test #1 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: constructs <code>RSAOtherPrimeInfo</code>
* object using valid parameter
*/
public final void testRSAOtherPrimeInfo01() {
Object o =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertTrue(o instanceof RSAOtherPrimeInfo);
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test #2 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if prime is null
*/
public final void testRSAOtherPrimeInfo02() {
try {
new RSAOtherPrimeInfo(null,
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test #3 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if primeExponent is null
*/
public final void testRSAOtherPrimeInfo03() {
try {
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
null,
BigInteger.valueOf(3L));
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test #4 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if crtCoefficient is null
*/
public final void testRSAOtherPrimeInfo04() {
try {
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
null);
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test #5 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: NullPointerException if prime and crtCoefficient is null
*/
public final void testRSAOtherPrimeInfo05() {
try {
new RSAOtherPrimeInfo(null,
BigInteger.valueOf(2L),
null);
fail("Expected NPE not thrown");
} catch (NullPointerException e) {
}
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test for <code>getCrtCoefficient()</code> method<br>
* Assertion: returns CRT coefficient value
*/
public final void testGetCrtCoefficient() {
RSAOtherPrimeInfo ropi =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertEquals(3L, ropi.getCrtCoefficient().longValue());
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test for <code>getPrime()</code> method<br>
* Assertion: returns prime value
*/
public final void testGetPrime() {
RSAOtherPrimeInfo ropi =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertEquals(1L, ropi.getPrime().longValue());
}
项目:j2objc
文件:RSAOtherPrimeInfoTest.java
/**
* Test for <code>getExponent()</code> method<br>
* Assertion: returns prime exponent value
*/
public final void testGetExponent() {
RSAOtherPrimeInfo ropi =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertEquals(2L, ropi.getExponent().longValue());
}
项目:j2objc
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* 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()));
}
项目:j2objc
文件:RSAMultiPrimePrivateCrtKeySpecTest.java
/**
* Compares array passed as a parameter with reference one<br>
*
* <code>private static final RSAOtherPrimeInfo[] opi</code>
*
* @param toBeChecked
* Array to be compared
* @return
* true if arrays are equal
*/
private boolean checkOtherPrimeInfo(RSAOtherPrimeInfo[] toBeChecked) {
if (toBeChecked == null || toBeChecked.length != opi.length) {
return false;
}
for (int i=0; i<opi.length; i++) {
if (opi[i].getPrime().equals(toBeChecked[i].getPrime()) &&
opi[i].getExponent().equals(toBeChecked[i].getExponent()) &&
opi[i].getCrtCoefficient().equals(toBeChecked[i].getCrtCoefficient())) {
continue;
}
return false;
}
return true;
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeyImpl.java
public RSAMultiPrimePrivateCrtKeyImpl(BigInteger publicExp,
BigInteger primeExpP,
BigInteger primeExpQ,
BigInteger prP,
BigInteger prQ,
BigInteger crtCft,
RSAOtherPrimeInfo[] otherPrmInfo) {
publicExponent = publicExp;
primeExponentP = primeExpP;
primeExponentQ = primeExpQ;
primeP = prP;
primeQ = prQ;
crtCoefficient = crtCft;
otherPrimeInfo = otherPrmInfo;
}
项目:In-the-Box-Fork
文件:RSAMultiPrimePrivateCrtKeyTest.java
public RSAMulti(BigInteger publicExp,
BigInteger primeExpP,
BigInteger primeExpQ,
BigInteger prP,
BigInteger prQ,
BigInteger crtCft,
RSAOtherPrimeInfo[] otherPrmInfo) {
super(publicExp, primeExpP, primeExpQ, prP, prQ, crtCft, otherPrmInfo);
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test #1 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
* Assertion: constructs <code>RSAOtherPrimeInfo</code>
* object using valid parameter
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies constructor with valid parameters.",
method = "RSAOtherPrimeInfo",
args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
)
public final void testRSAOtherPrimeInfo01() {
Object o =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertTrue(o instanceof RSAOtherPrimeInfo);
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test for <code>getCrtCoefficient()</code> method<br>
* Assertion: returns CRT coefficient value
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getCrtCoefficient",
args = {}
)
public final void testGetCrtCoefficient() {
RSAOtherPrimeInfo ropi =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertEquals(3L, ropi.getCrtCoefficient().longValue());
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test for <code>getPrime()</code> method<br>
* Assertion: returns prime value
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getPrime",
args = {}
)
public final void testGetPrime() {
RSAOtherPrimeInfo ropi =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertEquals(1L, ropi.getPrime().longValue());
}
项目:In-the-Box-Fork
文件:RSAOtherPrimeInfoTest.java
/**
* Test for <code>getExponent()</code> method<br>
* Assertion: returns prime exponent value
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getExponent",
args = {}
)
public final void testGetExponent() {
RSAOtherPrimeInfo ropi =
new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
BigInteger.valueOf(2L),
BigInteger.valueOf(3L));
assertEquals(2L, ropi.getExponent().longValue());
}