Class PemReader


  • final class PemReader
    extends java.lang.Object
    Reads a PEM file and converts it into a list of DERs so that they are imported into a KeyStore easily.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PemReader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static ChannelBuffer[] readCertificates​(java.io.File file)  
      private static java.lang.String readContent​(java.io.File file)  
      (package private) static ChannelBuffer readPrivateKey​(java.io.File file)  
      private static void safeClose​(java.io.InputStream in)  
      private static void safeClose​(java.io.OutputStream out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CERT_PATTERN

        private static final java.util.regex.Pattern CERT_PATTERN
      • KEY_PATTERN

        private static final java.util.regex.Pattern KEY_PATTERN
    • Constructor Detail

      • PemReader

        private PemReader()
    • Method Detail

      • readCertificates

        static ChannelBuffer[] readCertificates​(java.io.File file)
                                         throws java.security.cert.CertificateException
        Throws:
        java.security.cert.CertificateException
      • readPrivateKey

        static ChannelBuffer readPrivateKey​(java.io.File file)
                                     throws java.security.KeyException
        Throws:
        java.security.KeyException
      • readContent

        private static java.lang.String readContent​(java.io.File file)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • safeClose

        private static void safeClose​(java.io.InputStream in)
      • safeClose

        private static void safeClose​(java.io.OutputStream out)