Class BouncyCastlePemReader

java.lang.Object
io.netty.handler.ssl.BouncyCastlePemReader

final class BouncyCastlePemReader extends Object
  • Field Details

  • Constructor Details

    • BouncyCastlePemReader

      private BouncyCastlePemReader()
  • Method Details

    • hasAttemptedLoading

      public static boolean hasAttemptedLoading()
    • isAvailable

      public static boolean isAvailable()
    • unavailabilityCause

      public static Throwable unavailabilityCause()
      Returns:
      the cause if unavailable. null if available.
    • tryLoading

      private static void tryLoading()
    • resetBcProvider

      static Provider resetBcProvider()
      Allows to test attemptedLoading under different conditions.
      Returns:
      previous bcProvider value
    • getPrivateKey

      public static PrivateKey getPrivateKey(InputStream keyInputStream, String keyPassword)
      Generates a new PrivateKey.
      Parameters:
      keyInputStream - an input stream for a PKCS#1 or PKCS#8 private key in PEM format.
      keyPassword - the password of the keyFile. null if it's not password-protected.
      Returns:
      generated PrivateKey.
    • getPrivateKey

      public static PrivateKey getPrivateKey(File keyFile, String keyPassword)
      Generates a new PrivateKey.
      Parameters:
      keyFile - a PKCS#1 or PKCS#8 private key file in PEM format.
      keyPassword - the password of the keyFile. 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

      private static org.bouncycastle.openssl.PEMParser newParser(InputStream keyInputStream)