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 PrivateKey
getPrivateKey
(File keyFile, String keyPassword) Generates a newPrivateKey
.static PrivateKey
getPrivateKey
(InputStream keyInputStream, String keyPassword) Generates a newPrivateKey
.private static PrivateKey
getPrivateKey
(org.bouncycastle.openssl.PEMParser pemParser, String keyPassword) static boolean
static boolean
private static org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
private static org.bouncycastle.openssl.PEMParser
private static org.bouncycastle.openssl.PEMParser
newParser
(InputStream keyInputStream) (package private) static Provider
Allows to testattemptedLoading
under different conditions.private static void
static 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 testattemptedLoading
under different conditions.- Returns:
- previous
bcProvider
value
-
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
.null
if 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
.null
if 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:
IOException
org.bouncycastle.pkcs.PKCSException
org.bouncycastle.operator.OperatorCreationException
-
newParser
private static org.bouncycastle.openssl.PEMParser newParser(File keyFile) throws FileNotFoundException - Throws:
FileNotFoundException
-
newParser
-