Package org.bouncycastle.sasn1

Examples of org.bouncycastle.sasn1.DerSequenceGenerator.addObject()


    BigInteger[] signature = signer.generateSignature (hash);
    ByteArrayOutputStream s = new ByteArrayOutputStream ();
    try
    {
      DERSequenceGenerator seq = new DERSequenceGenerator (s);
      seq.addObject (new ASN1Integer (signature[0]));
      seq.addObject (new ASN1Integer (signature[1]));
      seq.close ();
      return s.toByteArray ();
    }
    catch ( IOException e )
View Full Code Here


    ByteArrayOutputStream s = new ByteArrayOutputStream ();
    try
    {
      DERSequenceGenerator seq = new DERSequenceGenerator (s);
      seq.addObject (new ASN1Integer (signature[0]));
      seq.addObject (new ASN1Integer (signature[1]));
      seq.close ();
      return s.toByteArray ();
    }
    catch ( IOException e )
    {
View Full Code Here

        //
        // AlgorithmIdentifier
        //
        DERSequenceGenerator algGen = new DERSequenceGenerator(cGen.getRawOutputStream());
       
        algGen.addObject(new DERObjectIdentifier(ZLIB));

        algGen.close();
       
        //
        // Encapsulated ContentInfo
View Full Code Here

        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();
      
View Full Code Here

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

        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());
      
View Full Code Here

       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)));
      
View Full Code Here

        throws Exception
    {
       ByteArrayOutputStream bOut = new ByteArrayOutputStream();
       BerSequenceGenerator  seqGen1 = new BerSequenceGenerator(bOut);
      
       seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0)));
      
       seqGen1.addObject(new Asn1ObjectIdentifier("1.1"));
      
       BerSequenceGenerator seqGen2 = new BerSequenceGenerator(seqGen1.getRawOutputStream());
      
View Full Code Here

       ByteArrayOutputStream bOut = new ByteArrayOutputStream();
       BerSequenceGenerator  seqGen1 = new BerSequenceGenerator(bOut);
      
       seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0)));
      
       seqGen1.addObject(new Asn1ObjectIdentifier("1.1"));
      
       BerSequenceGenerator seqGen2 = new BerSequenceGenerator(seqGen1.getRawOutputStream());
      
       seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1)));
      
View Full Code Here

      
       seqGen1.addObject(new Asn1ObjectIdentifier("1.1"));
      
       BerSequenceGenerator seqGen2 = new BerSequenceGenerator(seqGen1.getRawOutputStream());
      
       seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1)));
      
       seqGen2.close();
      
       seqGen1.close();
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.