Package org.apache.geronimo.util.asn1.x509

Examples of org.apache.geronimo.util.asn1.x509.CertificateList


        }
    }

    private String generateCSR(X509Certificate cert, PrivateKey signingKey) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException, KeyStoreException, IOException {
        String sigalg = cert.getSigAlgName();
        X509Name subject;
        try{
            ASN1InputStream ais = new ASN1InputStream(cert.getEncoded());
            X509CertificateStructure x509Struct = new X509CertificateStructure((ASN1Sequence)ais.readObject());
            ais.close();
            subject = x509Struct.getSubject();
        } catch(CertificateEncodingException e) {
            log.warn(e.toString()+" while retrieving subject from certificate to create CSR.  Using subjectDN instead.");
            subject = new X509Name(cert.getSubjectDN().toString());
        }
        PublicKey publicKey = cert.getPublicKey();
        ASN1Set attributes = null;

        PKCS10CertificationRequest csr = new PKCS10CertificationRequest(sigalg,
View Full Code Here


        return (DERObjectIdentifier) dIn.readObject();
    }

    public static byte[] encodeGeneralName(String name) throws IOException {
        return encodeGeneralName(new X509Name(name));
    }
View Full Code Here

    /**
     * This method returns a X509Name object corresponding to a given principal
     */
    public static X509Name getX509Name(X500Principal principal) throws CertificateEncodingException, IOException {
        ASN1InputStream ais = new ASN1InputStream(principal.getEncoded());
        X509Name name = new X509Name((ASN1Sequence)ais.readObject());
        ais.close();
        return name;
    }
View Full Code Here

        if (cn != null) {
            attrmap.put(X509Name.CN, cn);
            order.add(X509Name.CN);
        }

        return new X509Name(order, attrmap);
    }
View Full Code Here

        v.add(tbsCrl);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CRLObject(new CertificateList(new DERSequence(v)));
    }
View Full Code Here

        InputStream in)
        throws IOException
    {
        DERInputStream  dIn = new DERInputStream(in);

        return new X509CRLObject(new CertificateList((ASN1Sequence)dIn.readObject()));
    }
View Full Code Here

        v.add(tbsCrl);
        v.add(sigAlgId);
        v.add(new DERBitString(signature));

        return new X509CRLObject(new CertificateList(new DERSequence(v)));
    }
View Full Code Here

        v.add(tbsCrl);
        v.add(sigAlgId);
        v.add(new DERBitString(signature));

        return new X509CRLObject(new CertificateList(new DERSequence(v)));
    }
View Full Code Here

        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        try
        {
            return new X509CRLObject(new CertificateList(new DERSequence(v)));
        }
        catch (CRLException e)
        {
            throw new IllegalStateException("attempt to create malformed CRL: " + e.getMessage());
        }
View Full Code Here

    {
        // use BC X509CRLObject so that indirect CRLs are supported
        X509CRLObject bcCRL = null;
        try
        {
            bcCRL = new X509CRLObject(new CertificateList((ASN1Sequence) ASN1Sequence.fromByteArray(crl.getEncoded())));
        }
        catch (Exception exception)
        {
            throw new AnnotatedException("Bouncy Castle X509CRLObject could not be created.", exception);
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.util.asn1.x509.CertificateList

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.