Tabnine Logo
KeyStoreUtils.newInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
newInstance
method
in
org.ldaptive.ssl.KeyStoreUtils

Best Java code snippets using org.ldaptive.ssl.KeyStoreUtils.newInstance (Showing top 20 results out of 315)

origin: com.floragunn/ldaptive

/**
 * Creates a new {@link KeyStore} with the default keystore type and initializes it.
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance()
 throws GeneralSecurityException
{
 return newInstance(DEFAULT_TYPE);
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new {@link KeyStore} with the default keystore type and initializes it.
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance()
 throws GeneralSecurityException
{
 return newInstance(DEFAULT_TYPE);
}
origin: vt-middleware/ldaptive

/**
 * Creates a new {@link KeyStore} with the default keystore type and initializes it.
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance()
 throws GeneralSecurityException
{
 return newInstance(DEFAULT_TYPE);
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new {@link KeyStore} and initializes it.
 *
 * @param  type  of keystore instance
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance(final String type)
 throws GeneralSecurityException
{
 return newInstance(type, null);
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new {@link KeyStore} with the default keystore type and initializes it.
 *
 * @param  password  to protect the keystore
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance(final char[] password)
 throws GeneralSecurityException
{
 return newInstance(DEFAULT_TYPE, password);
}
origin: com.floragunn/ldaptive

/**
 * Creates a new {@link KeyStore} with the default keystore type and initializes it.
 *
 * @param  password  to protect the keystore
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance(final char[] password)
 throws GeneralSecurityException
{
 return newInstance(DEFAULT_TYPE, password);
}
origin: vt-middleware/ldaptive

/**
 * Creates a new {@link KeyStore} with the default keystore type and initializes it.
 *
 * @param  password  to protect the keystore
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance(final char[] password)
 throws GeneralSecurityException
{
 return newInstance(DEFAULT_TYPE, password);
}
origin: com.floragunn/ldaptive

/**
 * Creates a new {@link KeyStore} and initializes it.
 *
 * @param  type  of keystore instance
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance(final String type)
 throws GeneralSecurityException
{
 return newInstance(type, null);
}
origin: vt-middleware/ldaptive

/**
 * Creates a new {@link KeyStore} and initializes it.
 *
 * @param  type  of keystore instance
 *
 * @return  initialized keystore
 *
 * @throws  GeneralSecurityException  if the keystore cannot be initialized
 */
public static KeyStore newInstance(final String type)
 throws GeneralSecurityException
{
 return newInstance(type, null);
}
origin: com.floragunn/ldaptive

@Override
protected TrustManager[] createTrustManagers()
 throws GeneralSecurityException
{
 TrustManager[] tm = null;
 if (trustCerts != null && trustCerts.length > 0) {
  final KeyStore ks = KeyStoreUtils.newInstance();
  KeyStoreUtils.setCertificateEntry("ldap_trust_", ks, trustCerts);
  final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  tmf.init(ks);
  tm = tmf.getTrustManagers();
 }
 return tm;
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new trust manager factory.
 *
 * @param  certs  to add as trusted material
 *
 * @return  trust manager factory
 *
 * @throws  GeneralSecurityException  if the trust manager factory cannot be initialized
 */
protected TrustManagerFactory getTrustManagerFactory(final X509Certificate[] certs)
 throws GeneralSecurityException
{
 final KeyStore ks = KeyStoreUtils.newInstance();
 KeyStoreUtils.setCertificateEntry("ldap_trust_", ks, certs);
 final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
 tmf.init(ks);
 return tmf;
}
origin: vt-middleware/ldaptive

/**
 * Creates a new trust manager factory.
 *
 * @param  certs  to add as trusted material
 *
 * @return  trust manager factory
 *
 * @throws  GeneralSecurityException  if the trust manager factory cannot be initialized
 */
protected TrustManagerFactory getTrustManagerFactory(final X509Certificate[] certs)
 throws GeneralSecurityException
{
 final KeyStore ks = KeyStoreUtils.newInstance();
 KeyStoreUtils.setCertificateEntry("ldap_trust_", ks, certs);
 final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
 tmf.init(ks);
 return tmf;
}
origin: com.floragunn/ldaptive

@Override
public KeyManager[] getKeyManagers()
 throws GeneralSecurityException
{
 KeyManager[] km = null;
 if (authenticationCert != null && authenticationKey != null) {
  final KeyStore ks = KeyStoreUtils.newInstance();
  KeyStoreUtils.setKeyEntry(
   "ldap_client_auth",
   ks,
   "changeit".toCharArray(),
   authenticationKey,
   authenticationCert);
  final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
  kmf.init(ks, "changeit".toCharArray());
  km = kmf.getKeyManagers();
 }
 return km;
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new key manager factory.
 *
 * @param  cert  to initialize the key manager factory
 * @param  key  to initialize the key manager factory
 *
 * @return  key manager factory
 *
 * @throws  GeneralSecurityException  if the key manager factory cannot be initialized
 */
protected KeyManagerFactory getKeyManagerFactory(final X509Certificate cert, final PrivateKey key)
 throws GeneralSecurityException
{
 final KeyStore ks = KeyStoreUtils.newInstance();
 KeyStoreUtils.setKeyEntry("ldap_client_auth", ks, "changeit".toCharArray(), key, cert);
 final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
 kmf.init(ks, "changeit".toCharArray());
 return kmf;
}
origin: vt-middleware/ldaptive

/**
 * Creates a new key manager factory.
 *
 * @param  cert  to initialize the key manager factory
 * @param  key  to initialize the key manager factory
 *
 * @return  key manager factory
 *
 * @throws  GeneralSecurityException  if the key manager factory cannot be initialized
 */
protected KeyManagerFactory getKeyManagerFactory(final X509Certificate cert, final PrivateKey key)
 throws GeneralSecurityException
{
 final KeyStore ks = KeyStoreUtils.newInstance();
 KeyStoreUtils.setKeyEntry("ldap_client_auth", ks, "changeit".toCharArray(), key, cert);
 final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
 kmf.init(ks, "changeit".toCharArray());
 return kmf;
}
origin: com.floragunn/ldaptive

@Override
protected TrustManager[] createTrustManagers()
 throws GeneralSecurityException
{
 TrustManager[] tm = null;
 if (trustKeystore != null) {
  final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  if (trustAliases != null) {
   final KeyStore ks = KeyStoreUtils.newInstance();
   for (String alias : trustAliases) {
    final KeyStore.Entry entry = KeyStoreUtils.getEntry(alias, trustKeystore, null);
    KeyStoreUtils.setEntry(alias, entry, ks, null);
   }
   tmf.init(ks);
  } else {
   tmf.init(trustKeystore);
  }
  tm = tmf.getTrustManagers();
 }
 return tm;
}
origin: com.floragunn/ldaptive

@Override
public KeyManager[] getKeyManagers()
 throws GeneralSecurityException
{
 KeyManager[] km = null;
 if (authenticationKeystore != null && authenticationPassword != null) {
  final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
  if (authenticationAliases != null) {
   final KeyStore ks = KeyStoreUtils.newInstance(authenticationPassword);
   for (String alias : authenticationAliases) {
    final KeyStore.Entry entry = KeyStoreUtils.getEntry(alias, authenticationKeystore, authenticationPassword);
    KeyStoreUtils.setEntry(alias, entry, ks, authenticationPassword);
   }
   kmf.init(ks, authenticationPassword);
  } else {
   kmf.init(authenticationKeystore, authenticationPassword);
  }
  km = kmf.getKeyManagers();
 }
 return km;
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new trust manager factory.
 *
 * @param  keystore  to initialize the trust manager factory
 * @param  aliases  to include from the supplied keystore or null to include all entries
 *
 * @return  trust manager factory
 *
 * @throws  GeneralSecurityException  if the trust manager factory cannot be initialized
 */
protected TrustManagerFactory getTrustManagerFactory(final KeyStore keystore, final String... aliases)
 throws GeneralSecurityException
{
 final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
 if (aliases != null && aliases.length > 0) {
  final KeyStore ks = KeyStoreUtils.newInstance();
  for (String alias : aliases) {
   final KeyStore.Entry entry = KeyStoreUtils.getEntry(alias, keystore, null);
   KeyStoreUtils.setEntry(alias, entry, ks, null);
  }
  tmf.init(ks);
 } else {
  tmf.init(keystore);
 }
 return tmf;
}
origin: vt-middleware/ldaptive

/**
 * Creates a new trust manager factory.
 *
 * @param  keystore  to initialize the trust manager factory
 * @param  aliases  to include from the supplied keystore or null to include all entries
 *
 * @return  trust manager factory
 *
 * @throws  GeneralSecurityException  if the trust manager factory cannot be initialized
 */
protected TrustManagerFactory getTrustManagerFactory(final KeyStore keystore, final String... aliases)
 throws GeneralSecurityException
{
 final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
 if (aliases != null && aliases.length > 0) {
  final KeyStore ks = KeyStoreUtils.newInstance();
  for (String alias : aliases) {
   final KeyStore.Entry entry = KeyStoreUtils.getEntry(alias, keystore, null);
   KeyStoreUtils.setEntry(alias, entry, ks, null);
  }
  tmf.init(ks);
 } else {
  tmf.init(keystore);
 }
 return tmf;
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new key manager factory.
 *
 * @param  keystore  to initialize the key manager factory
 * @param  password  to unlock the supplied keystore
 * @param  aliases  to include from the supplied keystore or null to include all entries
 *
 * @return  key manager factory
 *
 * @throws  GeneralSecurityException  if the key manager factory cannot be initialized
 */
protected KeyManagerFactory getKeyManagerFactory(
 final KeyStore keystore,
 final char[] password,
 final String... aliases)
 throws GeneralSecurityException
{
 final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
 if (aliases != null && aliases.length > 0) {
  final KeyStore ks = KeyStoreUtils.newInstance(password);
  for (String alias : aliases) {
   final KeyStore.Entry entry = KeyStoreUtils.getEntry(alias, keystore, password);
   KeyStoreUtils.setEntry(alias, entry, ks, password);
  }
  kmf.init(ks, password);
 } else {
  kmf.init(keystore, password);
 }
 return kmf;
}
org.ldaptive.sslKeyStoreUtilsnewInstance

Javadoc

Creates a new KeyStore with the default keystore type and initializes it.

Popular methods of KeyStoreUtils

  • getEntry
    Returns a keystore entry from the supplied keystore.
  • setCertificateEntry
    Sets certificate entries on the supplied keystore. For certificate arrays of size greater than 1, th
  • setEntry
    Sets a keystore entry on the supplied keystore.
  • setKeyEntry
    Sets a key entry on the supplied keystore.

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • findViewById (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top plugins for Android Studio
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