Package org.apache.geronimo.util.asn1

Examples of org.apache.geronimo.util.asn1.ASN1OutputStream


                return tmp;
            }
            else if (format.equals("ASN.1"))
            {
                ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
                ASN1OutputStream        dOut = new ASN1OutputStream(bOut);

                try
                {
                    dOut.writeObject(new DEROctetString(engineGetEncoded("RAW")));
                }
                catch (IOException e)
                {
                    return null;
                }
View Full Code Here


                return tmp;
            }
            else if (format.equals("ASN.1"))
            {
                ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
                ASN1OutputStream        dOut = new ASN1OutputStream(bOut);

                try
                {
                    dOut.writeObject(new IDEACBCPar(engineGetEncoded("RAW")));
                }
                catch (IOException e)
                {
                    return null;
                }
View Full Code Here

                return engineGetEncoded();
            }
            else if (format.equals("ASN.1"))
            {
                ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
                ASN1OutputStream        dOut = new ASN1OutputStream(bOut);

                try
                {
                    if (parameterVersion == -1)
                    {
                        dOut.writeObject(new RC2CBCParameter(engineGetEncoded()));
                    }
                    else
                    {
                        dOut.writeObject(new RC2CBCParameter(parameterVersion, engineGetEncoded()));
                    }
                }
                catch (IOException e)
                {
                    return null;
View Full Code Here

                return engineGetEncoded();
            }
            else if (format.equals("ASN.1"))
            {
                ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
                ASN1OutputStream        dOut = new ASN1OutputStream(bOut);

                try
                {
                    dOut.writeObject(new CAST5CBCParameters(engineGetEncoded(), keyLength));
                }
                catch (IOException e)
                {
                    return null;
                }
View Full Code Here

        String provider)
        throws OCSPException, NoSuchProviderException
    {
        List                  certs = new ArrayList();
        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
        ASN1OutputStream      aOut = new ASN1OutputStream(bOut);
        CertificateFactory    cf;

        try
        {
            cf = CertificateFactory.getInstance("X.509", provider);
        }
        catch (CertificateException ex)
        {
            throw new OCSPException("can't get certificate factory.", ex);
        }

        //
        // load the certificates if we have any
        //
        ASN1Sequence s = req.getOptionalSignature().getCerts();

        if (s != null)
        {
            Enumeration e = s.getObjects();

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

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

            java.security.Signature signature = java.security.Signature.getInstance(this.getSignatureAlgOID(), sigProvider);

            signature.initVerify(key);

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

            aOut.writeObject(req.getTbsRequest());

            signature.update(bOut.toByteArray());

            return signature.verify(this.getSignature());
        }
View Full Code Here

     */
    public byte[] getEncoded()
        throws IOException
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        ASN1OutputStream        aOut = new ASN1OutputStream(bOut);

        aOut.writeObject(req);

        return bOut.toByteArray();
    }
View Full Code Here

                                    new ByteArrayInputStream(issuerKey.getEncoded()));
            SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(
                                                            aIn.readObject());

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

            aOut.writeObject(info.getPublicKey());

            digest.update(bOut.toByteArray());

            ASN1OctetString issuerKeyHash = new DEROctetString(digest.digest());
View Full Code Here

    public X500Principal getIssuerX500Principal()
    {
        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

            DERBitString    bitSig = null;

            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

TOP

Related Classes of org.apache.geronimo.util.asn1.ASN1OutputStream

Copyright © 2018 www.massapicom. 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.