Search in sources :

Example 6 with InvalidCertificate

use of com.vmware.vim.vasa._1_0.InvalidCertificate in project coprhd-controller by CoprHD.

the class ContextManagerImpl method unregisterVASACertificate.

/**
 * vasaService interface
 */
@Override
public void unregisterVASACertificate(String existingCertificate) throws InvalidCertificate, InvalidSession, StorageFault {
    final String methodName = "unregisterVASACertificate(): ";
    log.debug(methodName + "Entry with input existingCertificate[" + (existingCertificate != null ? "***" : null) + "]");
    try {
        /*
             * Need to have a valid SSL session, but VASA session not required
             */
        _sslUtil.checkHttpRequest(true, true);
        X509Certificate x509Cert = (X509Certificate) _sslUtil.buildCertificate(existingCertificate);
        SimpleTimeCounter counter = new SimpleTimeCounter("unregisterVASACertificate");
        unregisterCertificate(x509Cert);
        counter.stop();
    } catch (InvalidSession is) {
        // thrown by unregisterCertificate()
        log.error(methodName + "invalid session", is);
        throw is;
    } catch (InvalidCertificate ic) {
        // thrown by sslUtil.buildCertificate()
        // thrown by unregisterCertificate()
        log.error(methodName + "invalid certificate", ic);
        throw ic;
    } catch (StorageFault sf) {
        log.error(methodName + "storage fault occured ", sf);
        throw sf;
    } catch (Exception e) {
        log.error(methodName + "unknown exception", e);
        throw FaultUtil.StorageFault("runtime ", e);
    }
    log.debug(methodName + "Exit");
}
Also used : SimpleTimeCounter(com.emc.storageos.vasa.util.internal.SimpleTimeCounter) InvalidCertificate(com.vmware.vim.vasa._1_0.InvalidCertificate) StorageFault(com.vmware.vim.vasa._1_0.StorageFault) X509Certificate(java.security.cert.X509Certificate) InvalidSession(com.vmware.vim.vasa._1_0.InvalidSession) CertificateNotYetValidException(java.security.cert.CertificateNotYetValidException) CertificateExpiredException(java.security.cert.CertificateExpiredException)

Aggregations

InvalidCertificate (com.vmware.vim.vasa._1_0.InvalidCertificate)5 CertificateExpiredException (java.security.cert.CertificateExpiredException)5 CertificateNotYetValidException (java.security.cert.CertificateNotYetValidException)5 X509Certificate (java.security.cert.X509Certificate)4 InvalidSession (com.vmware.vim.vasa._1_0.InvalidSession)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 CertificateEncodingException (java.security.cert.CertificateEncodingException)3 FileInputStream (java.io.FileInputStream)2 Certificate (java.security.cert.Certificate)2 SimpleTimeCounter (com.emc.storageos.vasa.util.internal.SimpleTimeCounter)1 InvalidLogin (com.vmware.vim.vasa._1_0.InvalidLogin)1 StorageFault (com.vmware.vim.vasa._1_0.StorageFault)1 VasaProviderInfo (com.vmware.vim.vasa._1_0.data.xsd.VasaProviderInfo)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 KeyStore (java.security.KeyStore)1 CertificateFactory (java.security.cert.CertificateFactory)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 MessageContext (org.apache.axis2.context.MessageContext)1