Package org.apache.geronimo.management.geronimo

Examples of org.apache.geronimo.management.geronimo.CertificationAuthorityException


     * @param validToDate Certificate validity period end date
     * @param algorithm Signature algorithm for the certificate
     * @return newly issued certificate
     */
    public Certificate issueCertificate(X500Principal subject, PublicKey publicKey, BigInteger sNo, Date validFromDate, Date validToDate, String algorithm) throws CertificationAuthorityException{
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        try {
            X509Name subName = CaUtils.getX509Name(subject);
            Certificate cert = issueCertificate(subName, caName, sNo, publicKey, caPrivateKey, validFromDate, validToDate, algorithm);
            cert.verify(caPublicKey);
            certStore.storeCertificate(cert);
            return cert;
        } catch(Exception e) {
            throw new CertificationAuthorityException("Error in issuing certificate.", e);
        }
    }
View Full Code Here


   
    /**
     * This method returns the highest serial number used by the CA.
     */
    public BigInteger getHighestSerialNumber() throws CertificationAuthorityException {
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        try {
            return certStore.getHighestSerialNumber();
        } catch (CertificateStoreException e) {
            throw new CertificationAuthorityException("Error in getting highest serial number for CA.", e);
        }
    }
View Full Code Here

     * This method checks if a Certificate with a given serial number is already issued.
     * @param sNo The serial number of the the certificate to be looked for
     * @return true if a certificate with the specified serial number has already been issued
     */
    public boolean isCertificateIssued(BigInteger sNo) throws CertificationAuthorityException {
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        return certStore.containsCertificate(sNo);
    }
View Full Code Here

    /**
     * This method returns the next serial number that can be used to issue a certificate and increments the
     * highest serial number.
     */
    public BigInteger getNextSerialNumber() throws CertificationAuthorityException {
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        try {
            return certStore.getNextSerialNumber();
        } catch (CertificateStoreException e) {
            throw new CertificationAuthorityException("Error in getting next serial number for CA.", e);
        }
    }
View Full Code Here

     * This method retrieves a certificate with the specified serial number.
     * @param sNo The serial number of the certificate to be retrieved
     * @return java.security.cert.Certificate instance of the certificate
     */
    public Certificate getCertificate(BigInteger sNo) throws CertificationAuthorityException {
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        try {
            return certStore.getCertificate(sNo);
        } catch (CertificateStoreException e) {
            throw new CertificationAuthorityException("Error getting certificate. serial number = "+sNo, e);
        }
    }
View Full Code Here

     * This method retrieves a certificate with the specified serial number.
     * @param sNo The serial number of the certificate to be retrieved
     * @return base64 encoded certificate text
     */
     public String getCertificateBase64Text(BigInteger sNo) throws CertificationAuthorityException {
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        try {
            return certStore.getCertificateBase64Text(sNo);
        } catch (CertificateStoreException e) {
            throw new CertificationAuthorityException("Error getting certificate. serial number = "+sNo, e);
        }
    }
View Full Code Here

        else if("MD5withRSA".equalsIgnoreCase(algorithm))
            algId = new AlgorithmIdentifier(PKCSObjectIdentifiers.md5WithRSAEncryption);
        else if("SHA1withRSA".equalsIgnoreCase(algorithm))
            algId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha1WithRSAEncryption);
        else
            throw new CertificationAuthorityException("Signature algorithm "+algorithm+" is not supported.");
       
        ASN1InputStream ais = new ASN1InputStream(subPubKey.getEncoded());
        DERObject subPubkeyDerObj = ais.readObject();
        SubjectPublicKeyInfo subPubKeyInfo = SubjectPublicKeyInfo.getInstance(subPubkeyDerObj);
       
View Full Code Here

TOP

Related Classes of org.apache.geronimo.management.geronimo.CertificationAuthorityException

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.