311312313314315316317318319320321
throws IOException { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(req); return bOut.toByteArray(); } /**
6465666768697071727374
aIn.readObject()); ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(info.getPublicKey()); digest.update(bOut.toByteArray()); ASN1OctetString issuerKeyHash = new DEROctetString(digest.digest());
193194195196197198199200201202203
try { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(c.getIssuer()); return new X500Principal(bOut.toByteArray()); } catch (IOException e) {
try { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(tbsReq); sig.update(bOut.toByteArray()); bitSig = new DERBitString(sig.sign()); }
236237238239240241242243244245246
while (e.hasMoreElements()) { try { aOut.writeObject(e.nextElement()); certs.add(cf.generateCertificate( new ByteArrayInputStream(bOut.toByteArray()))); } catch (IOException ex)
335336337338339340341342343344345
throws IOException { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(resp); return bOut.toByteArray(); } public boolean equals(Object o)
129130131132133134135136137138139
if (o instanceof RSAPrivateKey) { type = "RSA PRIVATE KEY"; aOut.writeObject(info.getPrivateKey()); } else if (o instanceof DSAPrivateKey) { type = "DSA PRIVATE KEY";
149150151152153154155156157158159
BigInteger y = p.getG().modPow(x, p.getP()); v.add(new DERInteger(y)); v.add(new DERInteger(x)); aOut.writeObject(new DERSequence(v)); } else { throw new IOException("Cannot identify private key"); }
242243244245246247248249250251252
// convert to bytearray ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ASN1OutputStream aOut = new ASN1OutputStream(bOut); aOut.writeObject(keyStruct); aOut.close(); keyData = bOut.toByteArray(); }
7778798081828384858687