Package io.netty.handler.ssl
Class BouncyCastlePemReader
java.lang.Object
io.netty.handler.ssl.BouncyCastlePemReader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrivateKeygetPrivateKey(File keyFile, String keyPassword) Generates a newPrivateKey.static PrivateKeygetPrivateKey(InputStream keyInputStream, String keyPassword) Generates a newPrivateKey.private static PrivateKeygetPrivateKey(org.bouncycastle.openssl.PEMParser pemParser, String keyPassword) static booleanstatic booleanprivate static org.bouncycastle.openssl.jcajce.JcaPEMKeyConverterprivate static org.bouncycastle.openssl.PEMParserprivate static org.bouncycastle.openssl.PEMParsernewParser(InputStream keyInputStream) (package private) static ProviderAllows to testattemptedLoadingunder different conditions.private static voidstatic Throwable
-
Field Details
-
BC_PROVIDER_NAME
- See Also:
-
BC_PROVIDER
- See Also:
-
BC_FIPS_PROVIDER_NAME
- See Also:
-
BC_FIPS_PROVIDER
- See Also:
-
BC_PEMPARSER
- See Also:
-
logger
-
bcProvider
-
attemptedLoading
private static volatile boolean attemptedLoading
-
-
Constructor Details
-
BouncyCastlePemReader
private BouncyCastlePemReader()
-
-
Method Details
-
hasAttemptedLoading
public static boolean hasAttemptedLoading() -
isAvailable
public static boolean isAvailable() -
tryLoading
private static void tryLoading() -
resetBcProvider
Allows to testattemptedLoadingunder different conditions.- Returns:
- previous
bcProvidervalue
-
getPrivateKey
Generates a newPrivateKey.- Parameters:
keyInputStream- an input stream for a PKCS#1 or PKCS#8 private key in PEM format.keyPassword- the password of thekeyFile.nullif it's not password-protected.- Returns:
- generated
PrivateKey.
-
getPrivateKey
Generates a newPrivateKey.- Parameters:
keyFile- a PKCS#1 or PKCS#8 private key file in PEM format.keyPassword- the password of thekeyFile.nullif it's not password-protected.- Returns:
- generated
PrivateKey.
-
newConverter
private static org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter newConverter() -
getPrivateKey
private static PrivateKey getPrivateKey(org.bouncycastle.openssl.PEMParser pemParser, String keyPassword) throws IOException, org.bouncycastle.pkcs.PKCSException, org.bouncycastle.operator.OperatorCreationException - Throws:
IOExceptionorg.bouncycastle.pkcs.PKCSExceptionorg.bouncycastle.operator.OperatorCreationException
-
newParser
private static org.bouncycastle.openssl.PEMParser newParser(File keyFile) throws FileNotFoundException - Throws:
FileNotFoundException
-
newParser
-