public class SecurityUtility extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BC |
static String |
BC_FIPS |
static String |
BC_FIPS_PROVIDER_CLASS |
static String |
BC_NON_FIPS_PROVIDER_CLASS |
static Provider |
BC_PROVIDER |
| Constructor and Description |
|---|
SecurityUtility() |
| Modifier and Type | Method and Description |
|---|---|
static io.netty.handler.ssl.SslContext |
createNettySslContextForClient(boolean allowInsecureConnection,
InputStream trustCertsStream,
Certificate[] certificates,
PrivateKey privateKey) |
static io.netty.handler.ssl.SslContext |
createNettySslContextForClient(boolean allowInsecureConnection,
String trustCertsFilePath) |
static io.netty.handler.ssl.SslContext |
createNettySslContextForClient(boolean allowInsecureConnection,
String trustCertsFilePath,
Certificate[] certificates,
PrivateKey privateKey) |
static io.netty.handler.ssl.SslContext |
createNettySslContextForClient(boolean allowInsecureConnection,
String trustCertsFilePath,
String certFilePath,
String keyFilePath) |
static io.netty.handler.ssl.SslContext |
createNettySslContextForServer(boolean allowInsecureConnection,
String trustCertsFilePath,
String certFilePath,
String keyFilePath,
Set<String> ciphers,
Set<String> protocols,
boolean requireTrustedClientCertOnConnect) |
static SSLContext |
createSslContext(boolean allowInsecureConnection,
Certificate[] trustCertificates) |
static SSLContext |
createSslContext(boolean allowInsecureConnection,
Certificate[] trustCertficates,
Certificate[] certificates,
PrivateKey privateKey) |
static SSLContext |
createSslContext(boolean allowInsecureConnection,
String trustCertsFilePath,
String certFilePath,
String keyFilePath) |
static org.eclipse.jetty.util.ssl.SslContextFactory |
createSslContextFactory(boolean tlsAllowInsecureConnection,
String tlsTrustCertsFilePath,
String tlsCertificateFilePath,
String tlsKeyFilePath,
boolean tlsRequireTrustedClientCertOnConnect,
boolean autoRefresh,
long certRefreshInSec) |
static Provider |
getBCProviderFromClassPath()
Get Bouncy Castle provider from classpath, and call Security.addProvider.
|
static Provider |
getProvider()
Get Bouncy Castle provider, and call Security.addProvider(provider) if success.
|
static boolean |
isBCFIPS() |
static X509Certificate[] |
loadCertificatesFromPemFile(String certFilePath) |
static X509Certificate[] |
loadCertificatesFromPemStream(InputStream inStream) |
static PrivateKey |
loadPrivateKeyFromPemFile(String keyFilePath) |
static PrivateKey |
loadPrivateKeyFromPemStream(InputStream inStream) |
public static final Provider BC_PROVIDER
public static final String BC_FIPS_PROVIDER_CLASS
public static final String BC_NON_FIPS_PROVIDER_CLASS
public static final String BC_FIPS
public static final String BC
public static boolean isBCFIPS()
public static Provider getProvider()
public static Provider getBCProviderFromClassPath() throws Exception
Exceptionpublic static SSLContext createSslContext(boolean allowInsecureConnection, Certificate[] trustCertificates) throws GeneralSecurityException
GeneralSecurityExceptionpublic static io.netty.handler.ssl.SslContext createNettySslContextForClient(boolean allowInsecureConnection,
String trustCertsFilePath)
throws GeneralSecurityException,
SSLException,
FileNotFoundException,
IOException
public static SSLContext createSslContext(boolean allowInsecureConnection, String trustCertsFilePath, String certFilePath, String keyFilePath) throws GeneralSecurityException
GeneralSecurityExceptionpublic static io.netty.handler.ssl.SslContext createNettySslContextForClient(boolean allowInsecureConnection,
String trustCertsFilePath,
String certFilePath,
String keyFilePath)
throws GeneralSecurityException,
SSLException,
FileNotFoundException,
IOException
public static io.netty.handler.ssl.SslContext createNettySslContextForClient(boolean allowInsecureConnection,
String trustCertsFilePath,
Certificate[] certificates,
PrivateKey privateKey)
throws GeneralSecurityException,
SSLException,
FileNotFoundException,
IOException
public static io.netty.handler.ssl.SslContext createNettySslContextForClient(boolean allowInsecureConnection,
InputStream trustCertsStream,
Certificate[] certificates,
PrivateKey privateKey)
throws GeneralSecurityException,
SSLException,
FileNotFoundException,
IOException
public static io.netty.handler.ssl.SslContext createNettySslContextForServer(boolean allowInsecureConnection,
String trustCertsFilePath,
String certFilePath,
String keyFilePath,
Set<String> ciphers,
Set<String> protocols,
boolean requireTrustedClientCertOnConnect)
throws GeneralSecurityException,
SSLException,
FileNotFoundException,
IOException
public static SSLContext createSslContext(boolean allowInsecureConnection, Certificate[] trustCertficates, Certificate[] certificates, PrivateKey privateKey) throws GeneralSecurityException
GeneralSecurityExceptionpublic static X509Certificate[] loadCertificatesFromPemFile(String certFilePath) throws KeyManagementException
KeyManagementExceptionpublic static X509Certificate[] loadCertificatesFromPemStream(InputStream inStream) throws KeyManagementException
KeyManagementExceptionpublic static PrivateKey loadPrivateKeyFromPemFile(String keyFilePath) throws KeyManagementException
KeyManagementExceptionpublic static PrivateKey loadPrivateKeyFromPemStream(InputStream inStream) throws KeyManagementException
KeyManagementExceptionpublic static org.eclipse.jetty.util.ssl.SslContextFactory createSslContextFactory(boolean tlsAllowInsecureConnection,
String tlsTrustCertsFilePath,
String tlsCertificateFilePath,
String tlsKeyFilePath,
boolean tlsRequireTrustedClientCertOnConnect,
boolean autoRefresh,
long certRefreshInSec)
throws GeneralSecurityException,
SSLException,
FileNotFoundException,
IOException
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.