Class PEMDecoder


  • public class PEMDecoder
    extends java.lang.Object
    PEM Support.
    Version:
    $Id: PEMDecoder.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
    • Constructor Detail

      • PEMDecoder

        public PEMDecoder()
    • Method Detail

      • hexToInt

        private static int hexToInt​(char c)
      • hexToByteArray

        private static byte[] hexToByteArray​(java.lang.String hex)
      • generateKeyFromPasswordSaltWithMD5

        public static byte[] generateKeyFromPasswordSaltWithMD5​(byte[] password,
                                                                byte[] salt,
                                                                int keyLen)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • removePadding

        private static byte[] removePadding​(byte[] buff,
                                            int blockSize)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • parsePEM

        private static PEMStructure parsePEM​(char[] pem)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • parsePEM

        private static PEMStructure parsePEM​(char[] pem,
                                             CertificateDecoder certificateDecoder)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • decryptPEM

        private static void decryptPEM​(PEMStructure ps,
                                       byte[] pw)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • isPEMEncrypted

        public static boolean isPEMEncrypted​(PEMStructure ps)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • decode

        @Deprecated
        public static java.lang.Object decode​(char[] pem,
                                              java.lang.String password)
                                       throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • decodeKeyPair

        public static java.security.KeyPair decodeKeyPair​(char[] pem,
                                                          java.lang.String password)
                                                   throws java.io.IOException
        Throws:
        java.io.IOException