/** * Identifying certificate for this host. {@code keyCertChainInputStream} and {@code keyInputStream} may * be {@code null} for client contexts, which disables mutual authentication. * * @param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format * @param keyInputStream an input stream for a PKCS#8 private key in PEM format */ public SslContextBuilder keyManager(InputStream keyCertChainInputStream, InputStream keyInputStream) { return keyManager(keyCertChainInputStream, keyInputStream, null); }
/** * Identifying certificate for this host. {@code keyCertChain} and {@code key} may * be {@code null} for client contexts, which disables mutual authentication. * * @param key a PKCS#8 private key * @param keyCertChain an X.509 certificate chain */ public SslContextBuilder keyManager(PrivateKey key, X509Certificate... keyCertChain) { return keyManager(key, null, keyCertChain); }
/** * Identifying certificate for this host. {@code keyCertChainFile} and {@code keyFile} may * be {@code null} for client contexts, which disables mutual authentication. * * @param keyCertChainFile an X.509 certificate chain file in PEM format * @param keyFile a PKCS#8 private key file in PEM format */ public SslContextBuilder keyManager(File keyCertChainFile, File keyFile) { return keyManager(keyCertChainFile, keyFile, null); }
/** * Identifying certificate for this host. {@code keyCertChainInputStream} and {@code keyInputStream} may * be {@code null} for client contexts, which disables mutual authentication. * * @param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format * @param keyInputStream an input stream for a PKCS#8 private key in PEM format */ public SslContextBuilder keyManager(InputStream keyCertChainInputStream, InputStream keyInputStream) { return keyManager(keyCertChainInputStream, keyInputStream, null); }
private static void setupKeyManager(SslContextBuilder builder, PrivateKey privateKey, X509Certificate[] certificates) { builder.keyManager(privateKey, (X509Certificate[]) certificates); }
/** * Identifying certificate for this host. {@code keyCertChainFile} and {@code keyFile} may * be {@code null} for client contexts, which disables mutual authentication. * * @param keyCertChainFile an X.509 certificate chain file in PEM format * @param keyFile a PKCS#8 private key file in PEM format */ public SslContextBuilder keyManager(File keyCertChainFile, File keyFile) { return keyManager(keyCertChainFile, keyFile, null); }
/** * Identifying certificate for this host. {@code keyCertChain} and {@code key} may * be {@code null} for client contexts, which disables mutual authentication. * * @param key a PKCS#8 private key * @param keyCertChain an X.509 certificate chain */ public SslContextBuilder keyManager(PrivateKey key, X509Certificate... keyCertChain) { return keyManager(key, null, keyCertChain); }
/** * Creates a builder for new server-side {@link SslContext}. * * If you use {@link SslProvider#OPENSSL} or {@link SslProvider#OPENSSL_REFCNT} consider using * {@link OpenSslX509KeyManagerFactory} or {@link OpenSslCachingX509KeyManagerFactory}. * * @param keyManagerFactory non-{@code null} factory for server's private key * @see #keyManager(KeyManagerFactory) */ public static SslContextBuilder forServer(KeyManagerFactory keyManagerFactory) { return new SslContextBuilder(true).keyManager(keyManagerFactory); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainFile an X.509 certificate chain file in PEM format * @param keyFile a PKCS#8 private key file in PEM format * @see #keyManager(File, File) */ public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) { return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format * @param keyInputStream an input stream for a PKCS#8 private key in PEM format * @see #keyManager(InputStream, InputStream) */ public static SslContextBuilder forServer(InputStream keyCertChainInputStream, InputStream keyInputStream) { return new SslContextBuilder(true).keyManager(keyCertChainInputStream, keyInputStream); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param key a PKCS#8 private key * @param keyCertChain the X.509 certificate chain * @see #keyManager(PrivateKey, X509Certificate[]) */ public static SslContextBuilder forServer(PrivateKey key, X509Certificate... keyCertChain) { return new SslContextBuilder(true).keyManager(key, keyCertChain); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param key a PKCS#8 private key * @param keyCertChain the X.509 certificate chain * @param keyPassword the password of the {@code keyFile}, or {@code null} if it's not * password-protected * @see #keyManager(File, File, String) */ public static SslContextBuilder forServer( PrivateKey key, String keyPassword, X509Certificate... keyCertChain) { return new SslContextBuilder(true).keyManager(key, keyPassword, keyCertChain); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainFile an X.509 certificate chain file in PEM format * @param keyFile a PKCS#8 private key file in PEM format * @param keyPassword the password of the {@code keyFile}, or {@code null} if it's not * password-protected * @see #keyManager(File, File, String) */ public static SslContextBuilder forServer( File keyCertChainFile, File keyFile, String keyPassword) { return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile, keyPassword); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format * @param keyInputStream an input stream for a PKCS#8 private key in PEM format * @param keyPassword the password of the {@code keyFile}, or {@code null} if it's not * password-protected * @see #keyManager(InputStream, InputStream, String) */ public static SslContextBuilder forServer( InputStream keyCertChainInputStream, InputStream keyInputStream, String keyPassword) { return new SslContextBuilder(true).keyManager(keyCertChainInputStream, keyInputStream, keyPassword); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format * @param keyInputStream an input stream for a PKCS#8 private key in PEM format * @see #keyManager(InputStream, InputStream) */ public static SslContextBuilder forServer(InputStream keyCertChainInputStream, InputStream keyInputStream) { return new SslContextBuilder(true).keyManager(keyCertChainInputStream, keyInputStream); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainFile an X.509 certificate chain file in PEM format * @param keyFile a PKCS#8 private key file in PEM format * @see #keyManager(File, File) */ public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) { return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param key a PKCS#8 private key * @param keyCertChain the X.509 certificate chain * @see #keyManager(PrivateKey, X509Certificate[]) */ public static SslContextBuilder forServer(PrivateKey key, X509Certificate... keyCertChain) { return new SslContextBuilder(true).keyManager(key, keyCertChain); }
/** * Creates a builder for new server-side {@link SslContext}. * * If you use {@link SslProvider#OPENSSL} or {@link SslProvider#OPENSSL_REFCNT} consider using * {@link OpenSslX509KeyManagerFactory} or {@link OpenSslCachingX509KeyManagerFactory}. * * @param keyManagerFactory non-{@code null} factory for server's private key * @see #keyManager(KeyManagerFactory) */ public static SslContextBuilder forServer(KeyManagerFactory keyManagerFactory) { return new SslContextBuilder(true).keyManager(keyManagerFactory); }
/** * Creates a builder for new server-side {@link SslContext}. * * @param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format * @param keyInputStream an input stream for a PKCS#8 private key in PEM format * @param keyPassword the password of the {@code keyFile}, or {@code null} if it's not * password-protected * @see #keyManager(InputStream, InputStream, String) */ public static SslContextBuilder forServer( InputStream keyCertChainInputStream, InputStream keyInputStream, String keyPassword) { return new SslContextBuilder(true).keyManager(keyCertChainInputStream, keyInputStream, keyPassword); }
public SslContext nettyClientContext() throws SSLException { return SslContextBuilder.forClient() .sslProvider( sslProvider ) .keyManager( privateKey, keyCertChain ) .protocols( tlsVersions ) .ciphers( ciphers ) .trustManager( trustManagerFactory ) .build(); }