Class EncryptedPEMKeyReader
java.lang.Object
net.schmizz.sshj.userauth.keyprovider.StandardPEMKeyReader
net.schmizz.sshj.userauth.keyprovider.EncryptedPEMKeyReader
- All Implemented Interfaces:
PEMKeyReader
PEM Key Reader implementation supporting historical password-based encryption from OpenSSL EVP_BytesToKey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final Patternprivate final PasswordFinderprivate static final Stringprivate final Resource<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDataEncryptionKeyInfo(List<String> headers) private byte[]getDecryptedPemKeyBody(char[] password, byte[] pemKeyBody, EncryptedPEMKeyReader.DataEncryptionKeyInfo dataEncryptionKeyInfo) private booleanisEncrypted(List<String> headers) private PEMKeyreadEncryptedPemKey(PEMKey pemKey) readPemKey(BufferedReader bufferedReader) Read PEM Key from Buffered Reader
-
Field Details
-
PROC_TYPE_ENCRYPTED_HEADER
- See Also:
-
DEK_INFO_PATTERN
-
DEK_INFO_ALGORITHM_GROUP
private static final int DEK_INFO_ALGORITHM_GROUP- See Also:
-
DEK_INFO_IV_GROUP
private static final int DEK_INFO_IV_GROUP- See Also:
-
passwordFinder
-
resource
-
-
Constructor Details
-
EncryptedPEMKeyReader
EncryptedPEMKeyReader(PasswordFinder passwordFinder, Resource<?> resource)
-
-
Method Details
-
readPemKey
Description copied from class:StandardPEMKeyReaderRead PEM Key from Buffered Reader- Specified by:
readPemKeyin interfacePEMKeyReader- Overrides:
readPemKeyin classStandardPEMKeyReader- Parameters:
bufferedReader- Buffered Reader containing lines from resource reader- Returns:
- PEM Key
- Throws:
IOException- Thrown on failure to read or decode PEM Key
-
isEncrypted
-
readEncryptedPemKey
- Throws:
IOException
-
getDecryptedPemKeyBody
private byte[] getDecryptedPemKeyBody(char[] password, byte[] pemKeyBody, EncryptedPEMKeyReader.DataEncryptionKeyInfo dataEncryptionKeyInfo) throws IOException - Throws:
IOException
-
getDataEncryptionKeyInfo
private EncryptedPEMKeyReader.DataEncryptionKeyInfo getDataEncryptionKeyInfo(List<String> headers) throws IOException - Throws:
IOException
-