Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.BERSequenceGenerator.addObject()


        throws Exception
    {
       ByteArrayOutputStream bOut = new ByteArrayOutputStream();
       BerSequenceGenerator  seqGen = new BerSequenceGenerator(bOut, 1, true);
      
       seqGen.addObject(new Asn1Integer(BigInteger.valueOf(0)));
      
       seqGen.addObject(new Asn1ObjectIdentifier("1.1"));
      
       seqGen.close();
     
View Full Code Here


       ByteArrayOutputStream bOut = new ByteArrayOutputStream();
       BerSequenceGenerator  seqGen = new BerSequenceGenerator(bOut, 1, true);
      
       seqGen.addObject(new Asn1Integer(BigInteger.valueOf(0)));
      
       seqGen.addObject(new Asn1ObjectIdentifier("1.1"));
      
       seqGen.close();
     
       assertTrue("explicit BER tag writing test failed.", Arrays.equals(berExpTagSeqData, bOut.toByteArray()));
    }
View Full Code Here

    {
        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
       
        BerSequenceGenerator sGen = new BerSequenceGenerator(bOut);
       
        sGen.addObject(new Asn1ObjectIdentifier(CMSObjectIdentifiers.compressedData.getId()));
       
        BerSequenceGenerator cGen = new BerSequenceGenerator(sGen.getRawOutputStream(), 0, true);
       
        cGen.addObject(new Asn1Integer(0));
       
View Full Code Here

       
        sGen.addObject(new Asn1ObjectIdentifier(CMSObjectIdentifiers.compressedData.getId()));
       
        BerSequenceGenerator cGen = new BerSequenceGenerator(sGen.getRawOutputStream(), 0, true);
       
        cGen.addObject(new Asn1Integer(0));
       
        //
        // AlgorithmIdentifier
        //
        DerSequenceGenerator algGen = new DerSequenceGenerator(cGen.getRawOutputStream());
View Full Code Here

        //
        // Encapsulated ContentInfo
        //
        BerSequenceGenerator eiGen = new BerSequenceGenerator(cGen.getRawOutputStream());
       
        eiGen.addObject(new Asn1ObjectIdentifier("1.1"));
       
        BerOctetStringGenerator octGen = new BerOctetStringGenerator(eiGen.getRawOutputStream(), 0, true);
       
        //
        // output containing zeroes
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.