Package org.bouncycastle2.asn1

Examples of org.bouncycastle2.asn1.ASN1OutputStream.writeObject()


        try
        {
            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);

            aOut.writeObject(c.getIssuer());

            return new X500Principal(bOut.toByteArray());
        }
        catch (IOException e)
        {
View Full Code Here


            try
            {
                ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
                ASN1OutputStream        aOut = new ASN1OutputStream(bOut);

                aOut.writeObject(tbsReq);

                sig.update(bOut.toByteArray());

                bitSig = new DERBitString(sig.sign());
            }
View Full Code Here

            while (e.hasMoreElements())
            {
                try
                {
                    aOut.writeObject(e.nextElement());

                    certs.add(cf.generateCertificate(
                        new ByteArrayInputStream(bOut.toByteArray())));
                }
                catch (IOException ex)
View Full Code Here

        throws IOException
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        ASN1OutputStream        aOut = new ASN1OutputStream(bOut);

        aOut.writeObject(resp);

        return bOut.toByteArray();
    }
   
    public boolean equals(Object o)
View Full Code Here

           
            if (o instanceof RSAPrivateKey)
            {
                type = "RSA PRIVATE KEY";
               
                aOut.writeObject(info.getPrivateKey());
            }
            else if (o instanceof DSAPrivateKey)
            {
                type = "DSA PRIVATE KEY";
               
View Full Code Here

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

      
            // convert to bytearray
            ByteArrayOutputStream bOut = new ByteArrayOutputStream();
            ASN1OutputStream      aOut = new ASN1OutputStream(bOut);
           
            aOut.writeObject(keyStruct);
            aOut.close();
           
            keyData = bOut.toByteArray();
        }
      
View Full Code Here

        throws IOException
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        ASN1OutputStream        aOut = new ASN1OutputStream(bOut);

        aOut.writeObject(resp);

        return bOut.toByteArray();
    }
   
    public boolean equals(Object o)
View Full Code Here

            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);
           
            for (int i = 0; i != values.length; i++)
            {
                aOut.writeObject(values[i]);
            }
           
            DERObject[] readValues = new DERObject[values.length];
           
            ByteArrayInputStream    bIn = new ByteArrayInputStream(bOut.toByteArray());
View Full Code Here

            n = new X509Name("C=AU, O=The Legion of the Bouncy Castle, L=Melbourne + OU=Ascot Vale");
           
            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);
           
            aOut.writeObject(n);
           
            byte[]  enc2 = bOut.toByteArray();
           
            if (enc.length != enc2.length)
            {
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.