EncryptedContentInfo ::= SEQUENCE { contentType ContentType, contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL }
109110111112113114115116117118119120121122123124125126127
out.close(); sGen.close(); Asn1InputStream aIn = new Asn1InputStream(bOut.toByteArray()); BerSequence sq = (BerSequence)aIn.readObject(); BerOctetString s = (BerOctetString)sq.readObject(); Asn1InputStream aIn2 = new Asn1InputStream(s.getOctetStream()); BerSequence sq2 = (BerSequence)aIn2.readObject(); BerOctetString inS = (BerOctetString)sq2.readObject(); InputStream in = inS.getOctetStream(); int count = 0;
180181182183184185186187188189190191192
sGen.close(); // // reading back // Asn1InputStream aIn = new Asn1InputStream(bOut.toByteArray()); ContentInfoParser cp = new ContentInfoParser((Asn1Sequence)aIn.readObject()); CompressedDataParser comData = new CompressedDataParser((Asn1Sequence)cp.getContent(BerTag.SEQUENCE)); ContentInfoParser content = comData.getEncapContentInfo(); Asn1OctetString bytes = (Asn1OctetString)content.getContent(BerTag.OCTET_STRING);
3839404142434445464748
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DerSequenceGenerator seqGen = new DerSequenceGenerator(bOut); seqGen.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen.addObject(new Asn1ObjectIdentifier("1.1")); seqGen.close();
5354555657585960616263646566676869
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DerSequenceGenerator seqGen1 = new DerSequenceGenerator(bOut); seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen1.addObject(new Asn1ObjectIdentifier("1.1")); DerSequenceGenerator seqGen2 = new DerSequenceGenerator(seqGen1.getRawOutputStream()); seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1))); seqGen2.close(); seqGen1.close();
7475767778798081828384
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DerSequenceGenerator seqGen = new DerSequenceGenerator(bOut, 1, true); seqGen.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen.addObject(new Asn1ObjectIdentifier("1.1")); seqGen.close();
8990919293949596979899
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DerSequenceGenerator seqGen = new DerSequenceGenerator(bOut, 1, false); seqGen.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen.addObject(new Asn1ObjectIdentifier("1.1")); seqGen.close();
104105106107108109110111112113114115116117118119120
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DerSequenceGenerator seqGen1 = new DerSequenceGenerator(bOut); seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen1.addObject(new Asn1ObjectIdentifier("1.1")); DerSequenceGenerator seqGen2 = new DerSequenceGenerator(seqGen1.getRawOutputStream(), 1, true); seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1))); seqGen2.close(); seqGen1.close();
125126127128129130131132133134135136137138139140141
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DerSequenceGenerator seqGen1 = new DerSequenceGenerator(bOut); seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen1.addObject(new Asn1ObjectIdentifier("1.1")); DerSequenceGenerator seqGen2 = new DerSequenceGenerator(seqGen1.getRawOutputStream(), 1, false); seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1))); seqGen2.close(); seqGen1.close();
146147148149150151152153154155156
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); BerSequenceGenerator seqGen = new BerSequenceGenerator(bOut); seqGen.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen.addObject(new Asn1ObjectIdentifier("1.1")); seqGen.close();
161162163164165166167168169170171172173174175176177
throws Exception { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); BerSequenceGenerator seqGen1 = new BerSequenceGenerator(bOut); seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0))); seqGen1.addObject(new Asn1ObjectIdentifier("1.1")); DerSequenceGenerator seqGen2 = new DerSequenceGenerator(seqGen1.getRawOutputStream()); seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1))); seqGen2.close(); seqGen1.close();