Tabnine Logo
SSLUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
SSLUtils
in
com.sun.enterprise.security.ssl

Best Java code snippets using com.sun.enterprise.security.ssl.SSLUtils (Showing top 20 results out of 315)

origin: org.glassfish.security/realms

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(), new SecureRandom());
  } catch (Exception ex) {
    _logger.log(Level.WARNING, "security.exception", ex);
  }        
  socketFactory = sc.getSocketFactory();
}
 
origin: org.glassfish.main.security/security

public KeyStore getKeyStore() throws IOException{
  return getKeyStores()[0];
}
origin: org.glassfish.security/security

public KeyStore getTrustStore() throws IOException{
  return getTrustStores()[0];
}
origin: org.glassfish.security/securitycommon

public void postConstruct() {
  try {
    initDate = new Date();
    KeyStore[] keyStores = getKeyStores();
    initKeyManagers(keyStores, secSupp.getKeyStorePasswords());
    initTrustManagers(getTrustStores());
    if (keyStores != null) {
      for (KeyStore keyStore : keyStores) {
    mergedTrustStore = mergingTrustStores(secSupp.getTrustStores());
  } catch(Exception ex) {
    if (_logger.isLoggable(Level.FINE)) {
    KeyManager[] kMgrs = getKeyManagers();
    if (keyAlias != null && keyAlias.length() > 0 && kMgrs != null) {
      for (int i = 0; i < kMgrs.length; i++) {
    ctx.init(kMgrs, getTrustManagers(), null);
origin: org.glassfish.main.security/security

  private void initSSLUtils() {
    if (sslUtils == null) {
      if (Globals.getDefaultHabitat() != null) {
        sslUtils = Globals.getDefaultHabitat().getService(SSLUtils.class);
      } else {
        sslUtils = new SSLUtils();
        sslUtils.postConstruct();
      }
    }
  }
}
origin: org.glassfish.security/security

public KeyManager[] getKeyManagers() throws Exception{
  return getKeyManagers(null);
}
public KeyManager[] getKeyManagers(String algorithm) throws IOException,
origin: org.glassfish.main.security/security

    secSupp = SecuritySupport.getDefaultInstance();
  KeyStore[] keyStores = getKeyStores();
  if (keyStores != null) {
    for (KeyStore keyStore : keyStores) {
  mergedTrustStore = mergingTrustStores(secSupp.getTrustStores());
  getSSLContext(null, null, null);
} catch(Exception ex) {
  if (_logger.isLoggable(Level.FINE)) {
origin: org.glassfish.main.security/security

public TrustManager[] getTrustManagers() throws Exception{
  return getTrustManagers(null);
}
public TrustManager[] getTrustManagers(String algorithm) throws IOException,
origin: org.glassfish.main.security/ejb.security

public KeyManager[] getKeyManagers(String alias) {
  KeyManager[] mgrs = null;
  try {
    if (alias != null && !sslUtils.isTokenKeyAlias(alias)) {
      throw new IllegalStateException(getFormatMessage(
          "iiop.cannot_find_keyalias", new Object[]{alias}));
    }
    mgrs = sslUtils.getKeyManagers();
    if (alias != null && mgrs != null && mgrs.length > 0) {
      KeyManager[] newMgrs = new KeyManager[mgrs.length];
      for (int i = 0; i < mgrs.length; i++) {
        if (_logger.isLoggable(Level.FINE)) {
          StringBuffer msg = new StringBuffer("Setting J2EEKeyManager for ");
          msg.append(" alias : " + alias);
          _logger.log(Level.FINE, msg.toString());
        }
        newMgrs[i] = new J2EEKeyManager((X509KeyManager) mgrs[i], alias);
      }
      mgrs = newMgrs;
    }
  } catch (Exception e) {
    //TODO: log here
    throw new RuntimeException(e);
  }
  return mgrs;
}
public TrustManager[] getTrustManagers() {
origin: org.glassfish.security/security

checkPermission(SecuritySupport.KEYSTORE_PASS_PROP);
PrivateKeyEntry privKeyEntry = null;
if (certNickname != null) {
  int ind = certNickname.indexOf(':');
  KeyStore[] kstores = getKeyStores();
  int count = -1;
  String aliasName = certNickname;
origin: org.glassfish.security/security

/**
 * Logout the user.
 *
 * <p> This method removes the <code>PrincipalImpl</code>
 * that was added by the <code>commit</code> method.
 *
 * <p>
 *
 * @exception LoginException if the logout fails.
 *
 * @return true in all cases since this <code>LoginModule</code>
 *          should not be ignored.
 */
public boolean logout() throws LoginException {
// unset the alias
  ssl = null;
  sslUtils.setAppclientSsl(ssl);
subject.getPrincipals().remove(userPrincipal);
succeeded = false;
succeeded = commitSucceeded;
alias = null;
userPrincipal = null;
return true;
}
origin: org.glassfish.main.common/amx-core

public String[] getSupportedCipherSuites()
{
  try
  {
    final SSLUtils sslUtils = mHabitat.getService(SSLUtils.class);
    return sslUtils.getSupportedCipherSuites();
  }
  catch (final Exception ex)
  {
    AMXLoggerInfo.getLogger().log( Level.INFO, AMXLoggerInfo.cantGetCipherSuites, ex);
    return new String[0];
  }
}
origin: org.glassfish.main.security/security-ee

private boolean checkProperty(String key) {
  if(key.equals("javax.net.ssl.keyStorePassword") || key.equals("javax.net.ssl.trustStorePassword")){
    SSLUtils.checkPermission(key);
  }
if (cacheEnabled()) {
  return cache.checkPermission(new PropertyPermission(key, "read"));
} 
return false;
}
origin: org.glassfish.security/security

  private void initSSLUtils() {
    if (sslUtils == null) {
      if (Globals.getDefaultHabitat() != null) {
        sslUtils = Globals.getDefaultHabitat().getByType(SSLUtils.class);
      } else {
        sslUtils = new SSLUtils();
        sslUtils.postConstruct();
      }
    }
  }
}
origin: org.glassfish.main.security/security

public KeyManager[] getKeyManagers() throws Exception{
  return getKeyManagers(null);
}
public KeyManager[] getKeyManagers(String algorithm) throws IOException,
origin: org.glassfish.security/security

    secSupp = SecuritySupport.getDefaultInstance();
  KeyStore[] keyStores = getKeyStores();
  if (keyStores != null) {
    for (KeyStore keyStore : keyStores) {
  mergedTrustStore = mergingTrustStores(secSupp.getTrustStores());
  getSSLContext(null, null, null);
} catch(Exception ex) {
  if (_logger.isLoggable(Level.FINE)) {
origin: org.glassfish.security/security

public TrustManager[] getTrustManagers() throws Exception{
  return getTrustManagers(null);
}
public TrustManager[] getTrustManagers(String algorithm) throws IOException,
origin: org.glassfish.main.security/security

checkPermission(SecuritySupport.KEYSTORE_PASS_PROP);
PrivateKeyEntry privKeyEntry = null;
if (certNickname != null) {
  int ind = certNickname.indexOf(':');
  KeyStore[] kstores = getKeyStores();
  int count = -1;
  String aliasName = certNickname;
origin: org.glassfish.main.security/security

/**
 * Logout the user.
 *
 * <p> This method removes the <code>PrincipalImpl</code>
 * that was added by the <code>commit</code> method.
 *
 * <p>
 *
 * @exception LoginException if the logout fails.
 *
 * @return true in all cases since this <code>LoginModule</code>
 *          should not be ignored.
 */
public boolean logout() throws LoginException {
// unset the alias
  ssl = null;
  sslUtils.setAppclientSsl(ssl);
subject.getPrincipals().remove(userPrincipal);
succeeded = false;
commitSucceeded = false;
alias = null;
userPrincipal = null;
return true;
}
origin: org.glassfish.security/security

  @Override
  public void execute(AdminCommandContext context) {
    final ActionReport report = context.getActionReport();
    String[] cipherSuites = sslutils.getSupportedCipherSuites();

    for (String cipherSuite : cipherSuites) {
      if (!cipherSuite.contains("_KRB5_")) {
        ActionReport.MessagePart part = report.getTopMessagePart().addChild();
        part.setMessage(cipherSuite);
      }
    }

    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);

  }
}
com.sun.enterprise.security.sslSSLUtils

Javadoc

Handy class containing static functions.

Most used methods

  • getKeyManagers
  • getTrustManagers
  • <init>
  • checkPermission
  • getKeyStores
  • getSupportedCipherSuites
  • getTrustStores
  • mergingTrustStores
  • postConstruct
  • setAppclientSsl
  • getAdminSSLContext
  • getAdminSocketFactory
  • getAdminSSLContext,
  • getAdminSocketFactory,
  • getKeyStore,
  • getMergedTrustStore,
  • getPrivateKeyEntryFromTokenAlias,
  • getSSLContext,
  • getTrustStore,
  • verifyMasterPassword,
  • checkCertificateDates,
  • getKeyStorePass

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Collectors (java.util.stream)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now