Package com.sun.enterprise.security.ssl

Examples of com.sun.enterprise.security.ssl.SSLUtils


    protected final SecuritySupport secSup;
    protected final MasterPassword masterPasswordHelper;
   
    protected BaseContainerCallbackHandler() {
        if(Globals.getDefaultHabitat() == null){
            sslUtils = new SSLUtils();
            secSup = SecuritySupport.getDefaultInstance();
            masterPasswordHelper = null;
            sslUtils.postConstruct();
        } else {
            sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
View Full Code Here


    {
        if (initialized) {
            return;
        }
        Habitat habitat = Globals.getDefaultHabitat();
        SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);

        keyManagers = sslUtils.getKeyManagers();
        trustManagers = sslUtils.getTrustManagers();
 
        // Creating a default SSLContext and HttpsURLConnection for clients
        // that use Https
        SSLContext ctx = SSLContext.getInstance("TLS");
        String keyAlias = System.getProperty(SSLUtils.HTTPS_OUTBOUND_KEY_ALIAS);
        KeyManager[] kMgrs = sslUtils.getKeyManagers();
        if (keyAlias != null && keyAlias.length() > 0 && kMgrs != null) {
            for (int i = 0; i < kMgrs.length; i++) {
                kMgrs[i] = new J2EEKeyManager((X509KeyManager)kMgrs[i], keyAlias);
            }
        }
  ctx.init(kMgrs, sslUtils.getTrustManagers(), null);
        HttpsURLConnection.setDefaultSSLSocketFactory(ctx.getSocketFactory());
        initialized = true;
    }
View Full Code Here

                    /* Get the keystore password to see if the user is
                     * authorized to see the list of certificates
                     */
                    String lbl = (localStrings.getLocalString("enterprise.security.keystore",
                            "Enter the KeyStore Password "));
                    SSLUtils sslUtils = Globals.get(SSLUtils.class);
                    System.out.println(lbl
                            + " : (max 3 tries)");
                    int cnt = 0;
                    for (cnt = 0; cnt < 3; cnt++) {
                        // Let the user try putting password thrice
                        System.out.println(lbl + " : ");
                        char[] kp =
                                (new BufferedReader(new InputStreamReader(System.in))).readLine().toCharArray();
                        if (sslUtils.verifyMasterPassword(kp)) {
                            break;
                        } else {
                            String errmessage = localStrings.getLocalString("enterprise.security.IncorrectKeystorePassword", "Incorrect Keystore Password");
                            System.err.println(errmessage);
                        }
View Full Code Here

      // adding the password field
      keystorePassword = new JPasswordField (20);
      kpPanel.add (lbl);
      kpPanel.add (keystorePassword);
      /* get the keystore password */
      final SSLUtils sslUtils = Globals.get(SSLUtils.class);
      // ok button For keystore password
      okForKP = new
    JButton(localStrings.getLocalString
      ( "enterprise.security.ok", " OK "));
      okForKP.setActionCommand ("ok");
 
      okForKP.addActionListener (new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
        char[] passKPFromUser = keystorePassword.getPassword();
        if (sslUtils.verifyMasterPassword(passKPFromUser)) {
      okForKP.setEnabled (false);
      cancelForKP.setEnabled (false);
      keystorePassword.setEditable (false);
      CardLayout cl = (CardLayout) (getContentPane ()).getLayout ();
      cl.show (getContentPane (), pnlCertificateList);
View Full Code Here

    protected final SecuritySupport secSup;
    protected final MasterPassword masterPasswordHelper;
   
    protected BaseContainerCallbackHandler() {
        if(Globals.getDefaultHabitat() == null){
            sslUtils = new SSLUtils();
            secSup = SecuritySupport.getDefaultInstance();
            masterPasswordHelper = null;
            sslUtils.postConstruct();
        } else {
            sslUtils = Globals.getDefaultHabitat().getComponent(SSLUtils.class);
View Full Code Here

    protected static final StringManager sm =
        StringManager.getManager(CustomSocketFactory.class);

    public  CustomSocketFactory() {
        Habitat habitat = Globals.getDefaultHabitat();
        SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
        SSLContext sc = null;
        try {
            sc = SSLContext.getInstance(SSL);
            sc.init(sslUtils.getKeyManagers(), sslUtils.getTrustManagers(), SharedSecureRandom.get());
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "security.exception", ex);
        }       
        socketFactory = sc.getSocketFactory();
    }
View Full Code Here

    public String[] getSupportedCipherSuites()
    {
        try
        {
            final SSLUtils sslUtils = mHabitat.getService(SSLUtils.class);
            return sslUtils.getSupportedCipherSuites();
        }
        catch (final Exception ex)
        {
            ImplUtil.getLogger().log( Level.INFO, "Can't get cipher suites", ex);
            return new String[0];
View Full Code Here

    protected static final StringManager sm =
        StringManager.getManager(CustomSocketFactory.class);
    private static final  CustomSocketFactory customSocketFactory = new CustomSocketFactory();

    public  CustomSocketFactory() {
        SSLUtils sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
        SSLContext sc = null;
        try {
            sc = SSLContext.getInstance(SSL);
            sc.init(sslUtils.getKeyManagers(), sslUtils.getTrustManagers(), SharedSecureRandom.get());
            socketFactory = sc.getSocketFactory();
        } catch (Exception ex) {
            _logger.log(Level.WARNING, SecurityLoggerInfo.securityExceptionError, ex);
        }       
    }
View Full Code Here

                    /* Get the keystore password to see if the user is
                     * authorized to see the list of certificates
                     */
                    String lbl = (localStrings.getLocalString("enterprise.security.keystore",
                            "Enter the KeyStore Password "));
                    SSLUtils sslUtils = Globals.get(SSLUtils.class);
                    System.out.println(lbl
                            + " : (max 3 tries)");
                    int cnt = 0;
                    for (cnt = 0; cnt < 3; cnt++) {
                        // Let the user try putting password thrice
                        System.out.println(lbl + " : ");
      String s = (new BufferedReader(new InputStreamReader(System.in))).readLine();
      if (s != null) {
                            char[] kp = s.toCharArray();
                            if (sslUtils.verifyMasterPassword(kp)) {
                                break;
                            } else {
                                String errmessage = localStrings.getLocalString("enterprise.security.IncorrectKeystorePassword", "Incorrect Keystore Password");
                                System.err.println(errmessage);
                            }
View Full Code Here

      // adding the password field
      keystorePassword = new JPasswordField (20);
      kpPanel.add (lbl);
      kpPanel.add (keystorePassword);
      /* get the keystore password */
      final SSLUtils sslUtils = Globals.get(SSLUtils.class);
      // ok button For keystore password
      okForKP = new
    JButton(localStrings.getLocalString
      ( "enterprise.security.ok", " OK "));
      okForKP.setActionCommand ("ok");
 
      okForKP.addActionListener (new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
        char[] passKPFromUser = keystorePassword.getPassword();
        if (sslUtils.verifyMasterPassword(passKPFromUser)) {
      okForKP.setEnabled (false);
      cancelForKP.setEnabled (false);
      keystorePassword.setEditable (false);
      CardLayout cl = (CardLayout) (getContentPane ()).getLayout ();
      cl.show (getContentPane (), pnlCertificateList);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.ssl.SSLUtils

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.