Package org.bouncycastle.asn1

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


                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

                X509Name    name = new X509Name(subjects[i]);

                bOut = new ByteArrayOutputStream();
                aOut = new ASN1OutputStream(bOut);
           
                aOut.writeObject(name);

                aIn = new ASN1InputStream(new ByteArrayInputStream(bOut.toByteArray()));

                name = X509Name.getInstance(aIn.readObject());
View Full Code Here

            b = new SafeBag(PKCSObjectIdentifiers.pkcs8ShroudedKeyBag, encInfo.toASN1Object(), b.getBagAttributes());
           
            ByteArrayOutputStream abOut = new ByteArrayOutputStream();
            ASN1OutputStream      berOut = new ASN1OutputStream(abOut);
           
            berOut.writeObject(new DERSequence(b));
           
            c[0] = new ContentInfo(PKCSObjectIdentifiers.data, new BERConstructedOctetString(abOut.toByteArray()));
           
            //
            // certificates
View Full Code Here

            authSafe = new AuthenticatedSafe(c);
           
            abOut = new ByteArrayOutputStream();
            berOut = new ASN1OutputStream(abOut);

            berOut.writeObject(authSafe);
           
            info = new ContentInfo(PKCSObjectIdentifiers.data, new BERConstructedOctetString(abOut.toByteArray()));
           
            mData = new MacData(new DigestInfo(algId, dInfo.getDigest()), salt, itCount);
           
View Full Code Here

            //
           
            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);
           
            aOut.writeObject(bag);
           
            if (!isSameAs(bOut.toByteArray(), pkcs12))
            {
                return new SimpleTestResult(false, getName() + ": failed comparison test");
            }
View Full Code Here

            info = new ContentInfo(CMSObjectIdentifiers.compressedData, data);
           
            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            ASN1OutputStream        aOut = new ASN1OutputStream(bOut);
           
            aOut.writeObject(info);
           
            if (!isSameAs(bOut.toByteArray(), compData))
            {
                return new SimpleTestResult(false, getName() + ": CMS compression failed to re-encode");
            }
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.