224225226227228229230231232233234
ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new DERInteger(r)); v.add(new DERInteger(s)); dOut.writeObject(new DERSequence(v)); return bOut.toByteArray(); } private BigInteger[] derDecode(
302303304305306307308309310311312
ByteArrayOutputStream baos = new ByteArrayOutputStream(); DEROutputStream k = new DEROutputStream(baos); k.writeObject(obj); recipientsField[i] = baos.toByteArray(); i++; }
4243444546474849505152
Pfx pfx = Pfx.getInstance(berPKCS12File); bOut.reset(); dOut.writeObject(pfx); return bOut.toByteArray(); } /**
7172737475767778798081
DEROutputStream dOut = new DEROutputStream(bOut); ASN1InputStream contentIn = new ASN1InputStream(content.getOctets()); ASN1Primitive obj = contentIn.readObject(); dOut.writeObject(obj); info = new ContentInfo(info.getContentType(), new DEROctetString(bOut.toByteArray())); MacData mData = pfx.getMacData(); try
96979899100101102103104105106
pfx = new Pfx(info, mData); bOut.reset(); dOut.writeObject(pfx); return bOut.toByteArray(); } private static byte[] calculatePbeMac(
15131514151515161517151815191520152115221523
else { asn1Out = new BEROutputStream(bOut); } asn1Out.writeObject(auth); byte[] pkg = bOut.toByteArray(); ContentInfo mainInfo = new ContentInfo(data, new BEROctetString(pkg));
15591560156115621563156415651566156715681569
else { asn1Out = new BEROutputStream(stream); } asn1Out.writeObject(pfx); } private static byte[] calculatePbeMac( ASN1ObjectIdentifier oid, byte[] salt,
379380381382383384385386387388389
366367368369370371372373374375376
ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DEROutputStream dOut = new DEROutputStream(bOut); try { dOut.writeObject(params); } catch (IOException e) { throw new RuntimeException("Oooops! " + e.toString()); }
467468469470471472473474475476477
DEROutputStream dOut = new DEROutputStream(bOut); DHParameter dhP = new DHParameter(currentSpec.getP(), currentSpec.getG(), currentSpec.getL()); try { dOut.writeObject(dhP); dOut.close(); } catch (IOException e) { throw new RuntimeException("Error encoding DHParameters");