diff options
author | bouncy <bouncy> | 2012-03-18 23:01:27 +0000 |
---|---|---|
committer | bouncy <bouncy> | 2012-03-18 23:01:27 +0000 |
commit | c0e361516a537a822a8912f4ca9a54aec2e60629 (patch) | |
tree | 590f39c9e12ebe958525e33b53a1b7a244678111 | |
parent | b97e59700cd4224636e5c9e0b21a5dc6912a2fbb (diff) | |
download | android_external_spongycastle-c0e361516a537a822a8912f4ca9a54aec2e60629.tar.gz android_external_spongycastle-c0e361516a537a822a8912f4ca9a54aec2e60629.tar.bz2 android_external_spongycastle-c0e361516a537a822a8912f4ca9a54aec2e60629.zip |
extra mods to simplify back porting.
6 files changed, 27 insertions, 27 deletions
diff --git a/crypto/test/jdk1.3/org/bouncycastle/cert/test/AttrCertTest.java b/crypto/test/jdk1.3/org/bouncycastle/cert/test/AttrCertTest.java index de02eadd1..f4723f885 100644 --- a/crypto/test/jdk1.3/org/bouncycastle/cert/test/AttrCertTest.java +++ b/crypto/test/jdk1.3/org/bouncycastle/cert/test/AttrCertTest.java @@ -282,7 +282,7 @@ public class AttrCertTest X509v2AttributeCertificateBuilder gen = new X509v2AttributeCertificateBuilder( new AttributeCertificateHolder(new JcaX509CertificateHolder(iCert)), new AttributeCertificateIssuer(new X500Name("cn=test")), - BigInteger.ONE, + BigInteger.valueOf(1), new Date(System.currentTimeMillis() - 50000), new Date(System.currentTimeMillis() + 50000)); @@ -396,7 +396,7 @@ public class AttrCertTest X509v2AttributeCertificateBuilder gen = new X509v2AttributeCertificateBuilder( new AttributeCertificateHolder(new JcaX509CertificateHolder(iCert).getSubject()), new AttributeCertificateIssuer(new X500Name("cn=test")), - BigInteger.ONE, + BigInteger.valueOf(1), new Date(System.currentTimeMillis() - 50000), new Date(System.currentTimeMillis() + 50000)); diff --git a/crypto/test/jdk1.3/org/bouncycastle/cert/test/CertTest.java b/crypto/test/jdk1.3/org/bouncycastle/cert/test/CertTest.java index fc5863025..28b02fe3e 100644 --- a/crypto/test/jdk1.3/org/bouncycastle/cert/test/CertTest.java +++ b/crypto/test/jdk1.3/org/bouncycastle/cert/test/CertTest.java @@ -1905,7 +1905,7 @@ public class CertTest crlGen.setNextUpdate(new Date(now.getTime() + 100000)); - crlGen.addCRLEntry(BigInteger.ONE, now, CRLReason.privilegeWithdrawn); + crlGen.addCRLEntry(BigInteger.valueOf(1), now, CRLReason.privilegeWithdrawn); crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic())); @@ -1925,14 +1925,14 @@ public class CertTest AuthorityKeyIdentifier authId = new AuthorityKeyIdentifierStructure(authExt); - X509CRLEntryHolder entry = crl.getRevokedCertificate(BigInteger.ONE); + X509CRLEntryHolder entry = crl.getRevokedCertificate(BigInteger.valueOf(1)); if (entry == null) { fail("failed to find CRL entry"); } - if (!entry.getSerialNumber().equals(BigInteger.ONE)) + if (!entry.getSerialNumber().equals(BigInteger.valueOf(1))) { fail("CRL cert serial number does not match"); } @@ -1987,7 +1987,7 @@ public class CertTest X509Extensions entryExtensions = new X509Extensions(extOids, extValues); - crlGen.addCRLEntry(BigInteger.ONE, now, entryExtensions); + crlGen.addCRLEntry(BigInteger.valueOf(1), now, entryExtensions); crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic())); @@ -2009,14 +2009,14 @@ public class CertTest AuthorityKeyIdentifier authId = new AuthorityKeyIdentifierStructure(authExt); - X509CRLEntry entry = crl.getRevokedCertificate(BigInteger.ONE); + X509CRLEntry entry = crl.getRevokedCertificate(BigInteger.valueOf(1)); if (entry == null) { fail("failed to find CRL entry"); } - if (!entry.getSerialNumber().equals(BigInteger.ONE)) + if (!entry.getSerialNumber().equals(BigInteger.valueOf(1))) { fail("CRL cert serial number does not match"); } @@ -2070,7 +2070,7 @@ public class CertTest X509Extensions entryExtensions = new X509Extensions(extOids, extValues); - crlGen.addCRLEntry(BigInteger.ONE, now, entryExtensions); + crlGen.addCRLEntry(BigInteger.valueOf(1), now, entryExtensions); crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic())); @@ -2092,14 +2092,14 @@ public class CertTest AuthorityKeyIdentifier authId = new AuthorityKeyIdentifierStructure(authExt); - X509CRLEntry entry = crl.getRevokedCertificate(BigInteger.ONE); + X509CRLEntry entry = crl.getRevokedCertificate(BigInteger.valueOf(1)); if (entry == null) { fail("failed to find CRL entry"); } - if (!entry.getSerialNumber().equals(BigInteger.ONE)) + if (!entry.getSerialNumber().equals(BigInteger.valueOf(1))) { fail("CRL cert serial number does not match"); } diff --git a/crypto/test/jdk1.3/org/bouncycastle/cert/test/PKCS10Test.java b/crypto/test/jdk1.3/org/bouncycastle/cert/test/PKCS10Test.java index f18927b06..8de23c6a2 100644 --- a/crypto/test/jdk1.3/org/bouncycastle/cert/test/PKCS10Test.java +++ b/crypto/test/jdk1.3/org/bouncycastle/cert/test/PKCS10Test.java @@ -109,7 +109,7 @@ public class PKCS10Test kpg.initialize(keySize); - KeyPair kp = kpg.genKeyPair(); + KeyPair kp = kpg.generateKeyPair(); X500NameBuilder x500NameBld = new X500NameBuilder(BCStyle.INSTANCE); @@ -422,15 +422,15 @@ public class PKCS10Test Vector oids = new Vector(); Vector values = new Vector(); - oids.add(X509Extension.basicConstraints); - values.add(new X509Extension(true, new DEROctetString(new BasicConstraints(true)))); - oids.add(X509Extension.keyUsage); - values.add(new X509Extension(true, new DEROctetString( + oids.addElement(X509Extension.basicConstraints); + values.addElement(new X509Extension(true, new DEROctetString(new BasicConstraints(true)))); + oids.addElement(X509Extension.keyUsage); + values.addElement(new X509Extension(true, new DEROctetString( new KeyUsage(KeyUsage.keyCertSign | KeyUsage.cRLSign)))); SubjectKeyIdentifier subjectKeyIdentifier = new SubjectKeyIdentifierStructure(pair.getPublic()); X509Extension ski = new X509Extension(false, new DEROctetString(subjectKeyIdentifier)); - oids.add(X509Extension.subjectKeyIdentifier); - values.add(ski); + oids.addElement(X509Extension.subjectKeyIdentifier); + values.addElement(ski); PKCS10CertificationRequest p1 = new JcaPKCS10CertificationRequestBuilder( new X500Name("cn=csr"), diff --git a/crypto/test/src/org/bouncycastle/cert/test/AttrCertSelectorTest.java b/crypto/test/src/org/bouncycastle/cert/test/AttrCertSelectorTest.java index a7ed270f7..3fe3694db 100644 --- a/crypto/test/src/org/bouncycastle/cert/test/AttrCertSelectorTest.java +++ b/crypto/test/src/org/bouncycastle/cert/test/AttrCertSelectorTest.java @@ -126,7 +126,7 @@ public class AttrCertSelectorTest X509v2AttributeCertificateBuilder gen = new X509v2AttributeCertificateBuilder( new AttributeCertificateHolder(iCertHolder.getSubject()), new AttributeCertificateIssuer(new X500Name("cn=test")), - BigInteger.ONE, + BigInteger.valueOf(1), new Date(System.currentTimeMillis() - 50000), new Date(System.currentTimeMillis() + 50000)); diff --git a/crypto/test/src/org/bouncycastle/jce/provider/test/AttrCertSelectorTest.java b/crypto/test/src/org/bouncycastle/jce/provider/test/AttrCertSelectorTest.java index 8b1a95ed6..cc556d4fb 100644 --- a/crypto/test/src/org/bouncycastle/jce/provider/test/AttrCertSelectorTest.java +++ b/crypto/test/src/org/bouncycastle/jce/provider/test/AttrCertSelectorTest.java @@ -137,7 +137,7 @@ public class AttrCertSelectorTest "cn=test"))); gen.setNotBefore(new Date(System.currentTimeMillis() - 50000)); gen.setNotAfter(new Date(System.currentTimeMillis() + 50000)); - gen.setSerialNumber(BigInteger.ONE); + gen.setSerialNumber(BigInteger.valueOf(1)); gen.setSignatureAlgorithm("SHA1WithRSAEncryption"); Target targetName = new Target(Target.targetName, new GeneralName(GeneralName.dNSName, diff --git a/crypto/test/src/org/bouncycastle/ocsp/test/OCSPTestUtil.java b/crypto/test/src/org/bouncycastle/ocsp/test/OCSPTestUtil.java index beabff23b..e753d3bdc 100644 --- a/crypto/test/src/org/bouncycastle/ocsp/test/OCSPTestUtil.java +++ b/crypto/test/src/org/bouncycastle/ocsp/test/OCSPTestUtil.java @@ -70,7 +70,7 @@ public class OCSPTestUtil public static X509Certificate makeCertificate(KeyPair _subKP, String _subDN, KeyPair _issKP, String _issDN) - throws GeneralSecurityException, IOException + throws Exception { return makeCertificate(_subKP, _subDN, _issKP, _issDN, false); @@ -78,7 +78,7 @@ public class OCSPTestUtil public static X509Certificate makeECDSACertificate(KeyPair _subKP, String _subDN, KeyPair _issKP, String _issDN) - throws GeneralSecurityException, IOException + throws Exception { return makeECDSACertificate(_subKP, _subDN, _issKP, _issDN, false); @@ -86,7 +86,7 @@ public class OCSPTestUtil public static X509Certificate makeCACertificate(KeyPair _subKP, String _subDN, KeyPair _issKP, String _issDN) - throws GeneralSecurityException, IOException + throws Exception { return makeCertificate(_subKP, _subDN, _issKP, _issDN, true); @@ -94,21 +94,21 @@ public class OCSPTestUtil public static X509Certificate makeCertificate(KeyPair _subKP, String _subDN, KeyPair _issKP, String _issDN, boolean _ca) - throws GeneralSecurityException, IOException + throws Exception { return makeCertificate(_subKP,_subDN, _issKP, _issDN, "MD5withRSA", _ca); } public static X509Certificate makeECDSACertificate(KeyPair _subKP, String _subDN, KeyPair _issKP, String _issDN, boolean _ca) - throws GeneralSecurityException, IOException + throws Exception { return makeCertificate(_subKP,_subDN, _issKP, _issDN, "SHA1WithECDSA", _ca); } public static X509Certificate makeCertificate(KeyPair _subKP, String _subDN, KeyPair _issKP, String _issDN, String algorithm, boolean _ca) - throws GeneralSecurityException, IOException + throws Exception { PublicKey _subPub = _subKP.getPublic(); @@ -176,7 +176,7 @@ public class OCSPTestUtil private static BigInteger allocateSerialNumber() { BigInteger _tmp = serialNumber; - serialNumber = serialNumber.add(BigInteger.ONE); + serialNumber = serialNumber.add(BigInteger.valueOf(1)); return _tmp; } } |