public Certificate(InputStream is) throws IOException {
int i;
RecordingInputStream certIS = new RecordingInputStream(is);
- DER.InputStream certSequence = new DER.InputStream(certIS).getSequenceStream();
+ DER.InputStream certSequence = DER.InputStream.New(certIS).getSequenceStream();
RecordingInputStream tbsCertIS = new RecordingInputStream(certSequence);
try {
- Vector tbsSequence = (Vector) new DER.InputStream(tbsCertIS).readObject();
+ Vector tbsSequence = (Vector) DER.InputStream.New(tbsCertIS).readObject();
tbsCertBytes = tbsCertIS.getBytes();
signatureAlgorithm = new AlgorithmIdentifier(certSequence.readObject());
signature = (DER.BitString) certSequence.readObject();
String oid = (String) extension.elementAt(0);
byte[] data = (byte[]) extension.elementAt(extension.size()-1);
if(oid.equals(BASIC_CONSTRAINTS))
- bc = new BC(new DER.InputStream(new ByteArrayInputStream(data)).readObject());
+ bc = new BC(DER.InputStream.New(new ByteArrayInputStream(data)).readObject());
}
}
basicContraints = bc;
public RSA.PublicKey getRSAPublicKey() throws DER.Exception {
if(!RSA_ENCRYPTION.equals(publicKeyAlgorithm.id)) throw new DER.Exception("This isn't an RSA public key");
try {
- return new RSA.PublicKey(new DER.InputStream(new ByteArrayInputStream(publicKey.data)).readObject());
+ return new RSA.PublicKey(DER.InputStream.New(new ByteArrayInputStream(publicKey.data)).readObject());
} catch(IOException e) {
throw new DER.Exception(e.getMessage());
} catch(RuntimeException e) {
PKCS1 pkcs1 = new PKCS1(new RSA(rsapk.modulus,rsapk.exponent,true));
byte[] d = pkcs1.decode(signature.data);
- Vector v = (Vector) new DER.InputStream(new ByteArrayInputStream(d)).readObject();
+ Vector v = (Vector) DER.InputStream.New(new ByteArrayInputStream(d)).readObject();
byte[] signedDigest = (byte[]) v.elementAt(1);
if(signedDigest.length != digest.getDigestSize()) return false;