Package com.citrix.netscaler.nitro.resource.config.ssl

Examples of com.citrix.netscaler.nitro.resource.config.ssl.sslcertkey$statusEnum


        public static void linkCerts(nitro_service ns, String userCertName, String caCertName) throws ExecutionException {
            try {

                // the assumption is that that both userCertName and caCertName are present on NS

                sslcertkey caCert = sslcertkey.get(ns, caCertName);
                sslcertkey userCert = sslcertkey.get(ns, userCertName);

                sslcertkey linkResource = new sslcertkey();

                // link user cert to CA cert
                linkResource.set_certkey(userCert.get_certkey());
                linkResource.set_linkcertkeyname(caCert.get_certkey());
                sslcertkey.link(ns, linkResource);

            } catch (nitro_exception e) {
                throw new ExecutionException("Failed to check cert link on load balancer to " + e.getMessage());
            } catch (Exception e) {
View Full Code Here


        }

       private static void deleteSslCertKey(nitro_service ns, String certKeyName) throws ExecutionException {
            try {

                sslcertkey certkey = new sslcertkey();
                certkey.set_certkey(certKeyName);
                sslcertkey.delete(ns, certkey);

            } catch (nitro_exception e){
                throw new ExecutionException("Failed to delete certkey " + e.getMessage());
            } catch (Exception e){
View Full Code Here

        }

        private static void createSslCertKey(nitro_service ns, String certFilename, String keyFilename, String certKeyName, String password) throws ExecutionException {
            s_logger.debug("Adding cert to netscaler");
            try {
                sslcertkey certkey = new sslcertkey();
                certkey.set_certkey(certKeyName);
                certkey.set_cert(SSL_CERT_PATH + certFilename);

                if ( keyFilename != null )
                    certkey.set_key(SSL_CERT_PATH + keyFilename);

                if( password != null ) {
                    certkey.set_passplain(password);
                }

                certkey.perform_operation(ns);

            } catch (nitro_exception e){
                throw new ExecutionException("Failed to add certkey binding " + e.getMessage());
            } catch (Exception e){
                throw new ExecutionException("Failed to add certkey binding " + e.getMessage());
View Full Code Here

        }

        public static void updateCertKey(nitro_service ns, String certKeyName, String cert, String key, String password) throws ExecutionException {
            try{
                sslcertkey certkey = sslcertkey.get(ns, certKeyName);
                if ( cert != null )
                    certkey.set_cert(cert);
                if ( key != null )
                    certkey.set_key(cert);
                if ( password != null )
                    certkey.set_passplain(cert);

                sslcertkey.change(ns,certkey);

            } catch (nitro_exception e){
                throw new ExecutionException("Failed to update ssl on load balancer due to " + e.getMessage());
View Full Code Here

        public static boolean certLinkExists(nitro_service ns, String userCertName, String caCertName) throws ExecutionException {
            try {
                // check if there is a link from userCertName to caCertName

                sslcertkey userCert = sslcertkey.get(ns,userCertName);
                String nsCaCert = userCert.get_linkcertkeyname();

                if (nsCaCert != null && nsCaCert.equals(caCertName))
                    return true;

            } catch (nitro_exception e) {
View Full Code Here

        }

        private static void deleteSslCertKey(nitro_service ns, String certKeyName) throws ExecutionException {
            try {

                sslcertkey certkey = new sslcertkey();
                certkey.set_certkey(certKeyName);
                sslcertkey.delete(ns, certkey);

            } catch (nitro_exception e) {
                throw new ExecutionException("Failed to delete certkey " + e.getMessage());
            } catch (Exception e) {
View Full Code Here

        }

        private static void createSslCertKey(nitro_service ns, String certFilename, String keyFilename, String certKeyName, String password) throws ExecutionException {
            s_logger.debug("Adding cert to netscaler");
            try {
                sslcertkey certkey = new sslcertkey();
                certkey.set_certkey(certKeyName);
                certkey.set_cert(SSL_CERT_PATH + certFilename);

                if (keyFilename != null)
                    certkey.set_key(SSL_CERT_PATH + keyFilename);

                if (password != null) {
                    certkey.set_passplain(password);
                }

                certkey.perform_operation(ns);

            } catch (nitro_exception e) {
                throw new ExecutionException("Failed to add certkey binding " + e.getMessage());
            } catch (Exception e) {
                throw new ExecutionException("Failed to add certkey binding " + e.getMessage());
View Full Code Here

        }

        public static void updateCertKey(nitro_service ns, String certKeyName, String cert, String key, String password) throws ExecutionException {
            try {
                sslcertkey certkey = sslcertkey.get(ns, certKeyName);
                if (cert != null)
                    certkey.set_cert(cert);
                if (key != null)
                    certkey.set_key(cert);
                if (password != null)
                    certkey.set_passplain(cert);

                sslcertkey.change(ns, certkey);

            } catch (nitro_exception e) {
                throw new ExecutionException("Failed to update ssl on load balancer due to " + e.getMessage());
View Full Code Here

        public static boolean certLinkExists(nitro_service ns, String userCertName, String caCertName) throws ExecutionException {
            try {
                // check if there is a link from userCertName to caCertName

                sslcertkey userCert = sslcertkey.get(ns, userCertName);
                String nsCaCert = userCert.get_linkcertkeyname();

                if (nsCaCert != null && nsCaCert.equals(caCertName))
                    return true;

            } catch (nitro_exception e) {
View Full Code Here

        public static void linkCerts(nitro_service ns, String userCertName, String caCertName) throws ExecutionException {
            try {

                // the assumption is that that both userCertName and caCertName are present on NS

                sslcertkey caCert = sslcertkey.get(ns, caCertName);
                sslcertkey userCert = sslcertkey.get(ns, userCertName);

                sslcertkey linkResource = new sslcertkey();

                // link user cert to CA cert
                linkResource.set_certkey(userCert.get_certkey());
                linkResource.set_linkcertkeyname(caCert.get_certkey());
                sslcertkey.link(ns, linkResource);

            } catch (nitro_exception e) {
                throw new ExecutionException("Failed to check cert link on load balancer to " + e.getMessage());
            } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.citrix.netscaler.nitro.resource.config.ssl.sslcertkey$statusEnum

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.