Package com.trilead.ssh2.crypto
Class PEMDecoder
java.lang.Object
com.trilead.ssh2.crypto.PEMDecoder
PEM Support.
- Version:
- $Id: PEMDecoder.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Logger
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
Deprecated.static KeyPair
decodeKeyPair
(char[] pem, String password) private static void
decryptPEM
(PEMStructure ps, byte[] pw) static byte[]
generateKeyFromPasswordSaltWithMD5
(byte[] password, byte[] salt, int keyLen) private static byte[]
hexToByteArray
(String hex) private static int
hexToInt
(char c) static boolean
private static PEMStructure
parsePEM
(char[] pem) private static PEMStructure
parsePEM
(char[] pem, CertificateDecoder certificateDecoder) private static byte[]
removePadding
(byte[] buff, int blockSize)
-
Field Details
-
LOGGER
-
PEM_RSA_PRIVATE_KEY
private static final int PEM_RSA_PRIVATE_KEY- See Also:
-
PEM_DSA_PRIVATE_KEY
private static final int PEM_DSA_PRIVATE_KEY- See Also:
-
-
Constructor Details
-
PEMDecoder
public PEMDecoder()
-
-
Method Details
-
hexToInt
private static int hexToInt(char c) -
hexToByteArray
-
generateKeyFromPasswordSaltWithMD5
public static byte[] generateKeyFromPasswordSaltWithMD5(byte[] password, byte[] salt, int keyLen) throws IOException - Throws:
IOException
-
removePadding
- Throws:
IOException
-
parsePEM
- Throws:
IOException
-
parsePEM
private static PEMStructure parsePEM(char[] pem, CertificateDecoder certificateDecoder) throws IOException - Throws:
IOException
-
decryptPEM
- Throws:
IOException
-
isPEMEncrypted
- Throws:
IOException
-
decode
Deprecated.- Throws:
IOException
-
decodeKeyPair
- Throws:
IOException
-