本文整理了Java中java.security.KeyStore.<init>()
方法的一些代码示例,展示了KeyStore.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyStore.<init>()
方法的具体详情如下:
包路径:java.security.KeyStore
类名称:KeyStore
方法名:<init>
[英]Constructs a new instance of KeyStore with the given arguments.
[中]使用给定的参数构造密钥库的新实例。
代码示例来源:origin: robovm/robovm
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: robovm/robovm
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
代码示例来源:origin: stackoverflow.com
String keyStorePath = "keystore.jks";
String keyStorePassword = "password";
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
KeyStore keyStore = new KeyStore();
keyStore.load(new FileInputStream(keyStorePath), keyStorePassword);
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), null, new SecureRandom());
SSLContext sslContext = getServerSSLContext(namespace.getUuid());
SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory();
// Create sockets as necessary
代码示例来源:origin: FlexoVM/flexovm
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: MobiVM/robovm
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: ibinti/bugvm
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: MobiVM/robovm
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Returns a new instance of {@code KeyStore} with the specified type.
*
* @param type
* the type of the returned {@code KeyStore}.
* @return a new instance of {@code KeyStore} with the specified type.
* @throws KeyStoreException
* if an error occurred during the creation of the new {@code
* KeyStore}.
* @throws NullPointerException if {@code type == null}
* @see #getDefaultType
*/
public static KeyStore getInstance(String type) throws KeyStoreException {
if (type == null) {
throw new NullPointerException("type == null");
}
try {
Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
代码示例来源:origin: ibinti/bugvm
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
代码示例来源:origin: com.gluonhq/robovm-rt
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
代码示例来源:origin: FlexoVM/flexovm
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
代码示例来源:origin: com.bugvm/bugvm-rt
return new KeyStore((KeyStoreSpi) spi, provider, type);
} catch (Exception e) {
内容来源于网络,如有侵权,请联系作者删除!