java.security.KeyStore.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(192)

本文整理了Java中java.security.KeyStore.<init>()方法的一些代码示例,展示了KeyStore.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyStore.<init>()方法的具体详情如下:
包路径:java.security.KeyStore
类名称:KeyStore
方法名:<init>

KeyStore.<init>介绍

[英]Constructs a new instance of KeyStore with the given arguments.
[中]使用给定的参数构造密钥库的新实例。

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: robovm/robovm

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

代码示例来源:origin: stackoverflow.com

  1. String keyStorePath = "keystore.jks";
  2. String keyStorePassword = "password";
  3. KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
  4. KeyStore keyStore = new KeyStore();
  5. keyStore.load(new FileInputStream(keyStorePath), keyStorePassword);
  6. keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
  7. sslContext = SSLContext.getInstance("TLS");
  8. sslContext.init(keyManagerFactory.getKeyManagers(), null, new SecureRandom());
  9. SSLContext sslContext = getServerSSLContext(namespace.getUuid());
  10. SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory();
  11. // Create sockets as necessary

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: MobiVM/robovm

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Returns a new instance of {@code KeyStore} with the specified type.
  3. *
  4. * @param type
  5. * the type of the returned {@code KeyStore}.
  6. * @return a new instance of {@code KeyStore} with the specified type.
  7. * @throws KeyStoreException
  8. * if an error occurred during the creation of the new {@code
  9. * KeyStore}.
  10. * @throws NullPointerException if {@code type == null}
  11. * @see #getDefaultType
  12. */
  13. public static KeyStore getInstance(String type) throws KeyStoreException {
  14. if (type == null) {
  15. throw new NullPointerException("type == null");
  16. }
  17. try {
  18. Engine.SpiAndProvider sap = ENGINE.getInstance(type, null);
  19. return new KeyStore((KeyStoreSpi) sap.spi, sap.provider, type);
  20. } catch (NoSuchAlgorithmException e) {
  21. throw new KeyStoreException(e);
  22. }
  23. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

代码示例来源:origin: ibinti/bugvm

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

代码示例来源:origin: com.gluonhq/robovm-rt

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

代码示例来源:origin: FlexoVM/flexovm

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

代码示例来源:origin: com.bugvm/bugvm-rt

  1. return new KeyStore((KeyStoreSpi) spi, provider, type);
  2. } catch (Exception e) {

相关文章