Interface KeyPairResourceParser
- All Superinterfaces:
KeyPairResourceLoader
- All Known Subinterfaces:
KeyPairPEMResourceParser
- All Known Implementing Classes:
AbstractKeyPairResourceParser,AbstractPEMResourceKeyPairParser,BouncyCastleKeyPairResourceParser,DSSPEMResourceKeyPairParser,ECDSAPEMResourceKeyPairParser,Ed25519PEMResourceKeyParser,GenericEd25519PEMResourceKeyParser,OpenSSHKeyPairResourceParser,PKCS8PEMResourceKeyPairParser,RSAPEMResourceKeyPairParser
- Author:
- Apache MINA SSHD Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final KeyPairResourceParserAn empty parser that never fails, but always report that it cannot extract key pairs and returns empty list if asked to loadFields 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_SIZE -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyPairResourceParseraggregate(Collection<? extends KeyPairResourceParser> parsers) static KeyPairResourceParseraggregate(KeyPairResourceParser... parsers) booleancanExtractKeyPairs(NamedResource resourceKey, List<String> lines) static booleancontainsMarkerLine(List<String> lines, String marker) static booleancontainsMarkerLine(List<String> lines, List<String> markers) static byte[]extractDataBytes(Collection<String> lines) Converts the lines assumed to contain BASE-64 encoded data into the actual content bytes.findMarkerLine(List<String> lines, int startLine, List<String> markers) Attempts to locate a line that contains one of the markersfindMarkerLine(List<String> lines, List<String> markers) Attempts to locate a line that contains one of the markersstatic StringjoinDataLines(Collection<String> lines) Methods inherited from interface org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader
loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs
-
Field Details
-
EMPTY
An empty parser that never fails, but always report that it cannot extract key pairs and returns empty list if asked to load
-
-
Method Details
-
canExtractKeyPairs
boolean canExtractKeyPairs(NamedResource resourceKey, List<String> lines) throws IOException, GeneralSecurityException - Parameters:
resourceKey- A hint as to the origin of the text lineslines- The resource lines- Returns:
trueif the parser can extract some key pairs from the lines- Throws:
IOException- If failed to process the linesGeneralSecurityException- If failed to extract information regarding the possibility to extract the key pairs
-
extractDataBytes
Converts the lines assumed to contain BASE-64 encoded data into the actual content bytes.- Parameters:
lines- The data lines - empty lines and spaces are automatically deleted before BASE-64 decoding takes place.- Returns:
- The decoded data bytes
- See Also:
-
joinDataLines
-
containsMarkerLine
-
containsMarkerLine
-
findMarkerLine
static AbstractMap.SimpleImmutableEntry<Integer,Integer> findMarkerLine(List<String> lines, List<String> markers) Attempts to locate a line that contains one of the markers- Parameters:
lines- The list of lines to scan - ignored ifnull/emptymarkers- The markers to match - ignored ifnull/empty- Returns:
- A
AbstractMap.SimpleImmutableEntrywhose key is the first line index that matched and value the matched marker index -nullif no match found - See Also:
-
findMarkerLine
static AbstractMap.SimpleImmutableEntry<Integer,Integer> findMarkerLine(List<String> lines, int startLine, List<String> markers) Attempts to locate a line that contains one of the markers- Parameters:
lines- The list of lines to scan - ignored ifnull/emptystartLine- The scan start line indexmarkers- The markers to match - ignored ifnull/empty- Returns:
- A
AbstractMap.SimpleImmutableEntrywhose key is the first line index that matched and value the matched marker index -nullif no match found
-
aggregate
-
aggregate
-