Package org.apache.geronimo.crypto.asn1

Examples of org.apache.geronimo.crypto.asn1.ASN1EncodableVector


        // This will be the certificate in DER encoded form
        DEREncodableVector certDerVec = new DEREncodableVector();
        certDerVec.add(tbsCert);
        certDerVec.add(algId);
        certDerVec.add(new DERBitString(signature));
        DERSequence certDerSeq = new DERSequence(certDerVec);
        byte[] certData = certDerSeq.getEncoded();
       
        // Create a java.security.cert.Certificate object
        Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(certData));

        return certificate;
View Full Code Here


                        {
                            buf.append(new KeyUsage((DERBitString)dIn.readObject()) + nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.netscapeCertType))
                        {
                            buf.append(new NetscapeCertType((DERBitString)dIn.readObject()) + nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.netscapeRevocationURL))
                        {
                            buf.append(new NetscapeRevocationURL((DERIA5String)dIn.readObject()) + nl);
                        }
View Full Code Here

                        {
                            buf.append(new NetscapeCertType((DERBitString)dIn.readObject()) + nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.netscapeRevocationURL))
                        {
                            buf.append(new NetscapeRevocationURL((DERIA5String)dIn.readObject()) + nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.verisignCzagExtension))
                        {
                            buf.append(new VerisignCzagExtension((DERIA5String)dIn.readObject()) + nl);
                        }
View Full Code Here

                        {
                            buf.append(new NetscapeRevocationURL((DERIA5String)dIn.readObject()) + nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.verisignCzagExtension))
                        {
                            buf.append(new VerisignCzagExtension((DERIA5String)dIn.readObject()) + nl);
                        }
                        else
                        {
                            buf.append(oid.getId());
                            buf.append(" value = " + ASN1Dump.dumpAsString(dIn.readObject()) + nl);
View Full Code Here

       
        PKCS10CertificationRequest pkcs10certreq = new PKCS10CertificationRequest(data);
        if(!pkcs10certreq.verify()) {
            throw new Exception("CSR verification failed.");
        }
        CertificationRequestInfo certReqInfo = pkcs10certreq.getCertificationRequestInfo();
        Map map = new HashMap();
        map.put(CERT_REQ_SUBJECT, certReqInfo.getSubject());
        map.put(CERT_REQ_PUBLICKEY, certReqInfo.getSubjectPublicKeyInfo());
        map.put(CERT_REQ_PUBLICKEY_OBJ, getPublicKeyObject(certReqInfo.getSubjectPublicKeyInfo()));
        map.put(CERT_REQ_VERSION, certReqInfo.getVersion());
        return map;
    }
View Full Code Here

       
        PKCS10CertificationRequest pkcs10certreq = new PKCS10CertificationRequest(data);
        if(!pkcs10certreq.verify()) {
            throw new Exception("CSR verification failed.");
        }
        CertificationRequestInfo certReqInfo = pkcs10certreq.getCertificationRequestInfo();
        Map map = new HashMap();
        map.put(CERT_REQ_SUBJECT, certReqInfo.getSubject());
        map.put(CERT_REQ_PUBLICKEY, certReqInfo.getSubjectPublicKeyInfo());
        map.put(CERT_REQ_PUBLICKEY_OBJ, getPublicKeyObject(certReqInfo.getSubjectPublicKeyInfo()));
        map.put(CERT_REQ_VERSION, certReqInfo.getVersion());
        return map;
    }
View Full Code Here

       
        PKCS10CertificationRequest pkcs10certreq = new PKCS10CertificationRequest(data);
        if(!pkcs10certreq.verify()) {
            throw new Exception("CSR verification failed.");
        }
        CertificationRequestInfo certReqInfo = pkcs10certreq.getCertificationRequestInfo();
        Map map = new HashMap();
        map.put(CERT_REQ_SUBJECT, certReqInfo.getSubject());
        map.put(CERT_REQ_PUBLICKEY, certReqInfo.getSubjectPublicKeyInfo());
        map.put(CERT_REQ_PUBLICKEY_OBJ, getPublicKeyObject(certReqInfo.getSubjectPublicKeyInfo()));
        map.put(CERT_REQ_VERSION, certReqInfo.getVersion());
        return map;
    }
View Full Code Here

     */
    public byte[] getEncoded()
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        DEROutputStream         dOut = new DEROutputStream(bOut);
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, new DERNull()), new RSAPrivateKeyStructure(getModulus(), getPublicExponent(), getPrivateExponent(), getPrimeP(), getPrimeQ(), getPrimeExponentP(), getPrimeExponentQ(), getCrtCoefficient()).getDERObject());

        try
        {
            dOut.writeObject(info);
            dOut.close();
View Full Code Here

     * construct an RSA key from a private key info object.
     */
    JCERSAPrivateCrtKey(
        PrivateKeyInfo  info)
    {
        this(new RSAPrivateKeyStructure((ASN1Sequence)info.getPrivateKey()));
    }
View Full Code Here

     */
    public byte[] getEncoded()
    {
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        DEROutputStream         dOut = new DEROutputStream(bOut);
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, new DERNull()), new RSAPrivateKeyStructure(getModulus(), getPublicExponent(), getPrivateExponent(), getPrimeP(), getPrimeQ(), getPrimeExponentP(), getPrimeExponentQ(), getCrtCoefficient()).getDERObject());

        try
        {
            dOut.writeObject(info);
            dOut.close();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.crypto.asn1.ASN1EncodableVector

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.