Package org.apache.sshd.putty
Class AbstractPuttyKeyDecoder<PUB extends PublicKey,PRV extends PrivateKey>
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader<PUB,PRV>
org.apache.sshd.putty.AbstractPuttyKeyDecoder<PUB,PRV>
- Type Parameters:
PUB- Generic public key typePRV- Generic private key type
- All Implemented Interfaces:
IdentityResourceLoader<PUB,,PRV> KeyTypeNamesSupport,KeyPairResourceLoader,KeyPairResourceParser,PuttyKeyPairResourceParser<PUB,PRV>
- Direct Known Subclasses:
DSSPuttyKeyDecoder,ECDSAPuttyKeyDecoder,EdDSAPuttyKeyDecoder,RSAPuttyKeyDecoder
public abstract class AbstractPuttyKeyDecoder<PUB extends PublicKey,PRV extends PrivateKey>
extends AbstractIdentityResourceLoader<PUB,PRV>
implements PuttyKeyPairResourceParser<PUB,PRV>
- Author:
- Apache MINA SSHD Project
-
Field Summary
FieldsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
MAX_BIGINT_OCTETS_COUNTFields inherited from interface org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader
MAX_CIPHER_NAME_LENGTH, MAX_KEY_COMMENT_LENGTH, MAX_KEY_TYPE_NAME_LENGTH, MAX_PRIVATE_KEY_DATA_SIZE, MAX_PUBLIC_KEY_DATA_SIZEFields inherited from interface org.apache.sshd.common.config.keys.loader.KeyPairResourceParser
EMPTYFields inherited from interface org.apache.sshd.putty.PuttyKeyPairResourceParser
FORMAT_3_MAC_KEY_LENGTH, KEY_FILE_HEADER_PREFIX, KNOWN_HEADERS, NO_PRIVATE_KEY_ENCRYPTION_VALUE, PPK_FILE_SUFFIX, PRIVATE_LINES_HEADER, PUBLIC_LINES_HEADER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPuttyKeyDecoder(Class<PUB> pubType, Class<PRV> prvType, Collection<String> names) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExtractKeyPairs(NamedResource resourceKey, List<String> lines) extractDataLines(NamedResource resourceKey, List<String> lines, int startIndex, String hdrName, String hdrValue, List<String> curLines) loadKeyPairs(NamedResource resourceKey, int formatVersion, byte[] pubData, byte[] prvData, Map<String, String> headers) loadKeyPairs(NamedResource resourceKey, int formatVersion, InputStream pubData, InputStream prvData, Map<String, String> headers) abstract Collection<KeyPair>loadKeyPairs(NamedResource resourceKey, int formatVersion, PuttyKeyReader pubReader, PuttyKeyReader prvReader, Map<String, String> headers) loadKeyPairs(SessionContext session, NamedResource resourceKey, int formatVersion, String pubData, String prvData, String prvEncryption, FilePasswordProvider passwordProvider, Map<String, String> headers) loadKeyPairs(SessionContext session, NamedResource resourceKey, int formatVersion, List<String> pubLines, List<String> prvLines, String prvEncryption, FilePasswordProvider passwordProvider, Map<String, String> headers) loadKeyPairs(SessionContext session, NamedResource resourceKey, FilePasswordProvider passwordProvider, List<String> lines) Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader
getPrivateKeyType, getPublicKeyType, getSupportedKeyTypesMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
getPrivateKeyType, getPublicKeyTypeMethods inherited from interface org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader
loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairsMethods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypes
-
Field Details
-
ENCRYPTION_HEADER
- See Also:
-
-
Constructor Details
-
AbstractPuttyKeyDecoder
-
-
Method Details
-
canExtractKeyPairs
public boolean canExtractKeyPairs(NamedResource resourceKey, List<String> lines) throws IOException, GeneralSecurityException - Specified by:
canExtractKeyPairsin interfaceKeyPairResourceParser- Specified by:
canExtractKeyPairsin interfacePuttyKeyPairResourceParser<PUB extends PublicKey,PRV extends PrivateKey> - Throws:
IOExceptionGeneralSecurityException
-
loadKeyPairs
public Collection<KeyPair> loadKeyPairs(SessionContext session, NamedResource resourceKey, FilePasswordProvider passwordProvider, List<String> lines) throws IOException, GeneralSecurityException - Specified by:
loadKeyPairsin interfaceKeyPairResourceLoader- Throws:
IOExceptionGeneralSecurityException
-
extractDataLines
public static List<String> extractDataLines(NamedResource resourceKey, List<String> lines, int startIndex, String hdrName, String hdrValue, List<String> curLines) throws IOException - Throws:
IOException
-
loadKeyPairs
public Collection<KeyPair> loadKeyPairs(SessionContext session, NamedResource resourceKey, int formatVersion, List<String> pubLines, List<String> prvLines, String prvEncryption, FilePasswordProvider passwordProvider, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
loadKeyPairs
public Collection<KeyPair> loadKeyPairs(SessionContext session, NamedResource resourceKey, int formatVersion, String pubData, String prvData, String prvEncryption, FilePasswordProvider passwordProvider, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
loadKeyPairs
public Collection<KeyPair> loadKeyPairs(NamedResource resourceKey, int formatVersion, byte[] pubData, byte[] prvData, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
loadKeyPairs
public Collection<KeyPair> loadKeyPairs(NamedResource resourceKey, int formatVersion, InputStream pubData, InputStream prvData, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
loadKeyPairs
public abstract Collection<KeyPair> loadKeyPairs(NamedResource resourceKey, int formatVersion, PuttyKeyReader pubReader, PuttyKeyReader prvReader, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-