Class SimpleGeneratorHostKeyProvider
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.keyprovider.AbstractKeyPairProvider
org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider
org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider
- All Implemented Interfaces:
AlgorithmNameProvider,KeyIdentityProvider,KeyPairProvider,KeySizeIndicator
A simple implementation of an
AbstractGeneratorHostKeyProvider that writes and reads host keys using the
OpenSSH file format. Legacy keys written by earlier implementations used Java serialization. De-serializing is
restricted to a small number of classes known to exist in serialized KeyPairs.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
Fields inherited from class org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider
DEFAULT_ALGORITHM, DEFAULT_ALLOWED_TO_OVERWRITEFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
EMPTY_KEYS_PROVIDERFields inherited from interface org.apache.sshd.common.keyprovider.KeyPairProvider
ECDSA_SHA2_NISTP256, ECDSA_SHA2_NISTP384, ECDSA_SHA2_NISTP521, EMPTY_KEYPAIR_PROVIDER, SSH_DSS, SSH_DSS_CERT, SSH_ECDSA_SHA2_NISTP256_CERT, SSH_ECDSA_SHA2_NISTP384_CERT, SSH_ECDSA_SHA2_NISTP521_CERT, SSH_ED25519, SSH_ED25519_CERT, SSH_RSA, SSH_RSA_CERT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoReadKeyPairs(SessionContext session, NamedResource resourceKey, InputStream inputStream) protected voiddoWriteKeyPair(NamedResource resourceKey, KeyPair kp, OutputStream outputStream) private booleanisJavaSerialization(BufferedInputStream in, NamedResource resourceKey) Methods inherited from class org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider
clearLoadedKeys, generateKeyPair, getAlgorithm, getKeySize, getKeySpec, getPath, hasStrictFilePermissions, isOverwriteAllowed, loadFromFile, loadKeys, readKeyPairs, resolveKeyPairs, setAlgorithm, setFilePermissions, setKeySize, setKeySpec, setOverwriteAllowed, setPath, setStrictFilePermissions, writeKeyPairMethods 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.keyprovider.KeyPairProvider
getKeyTypes, loadKey
-
Constructor Details
-
SimpleGeneratorHostKeyProvider
public SimpleGeneratorHostKeyProvider() -
SimpleGeneratorHostKeyProvider
-
-
Method Details
-
doReadKeyPairs
protected Iterable<KeyPair> doReadKeyPairs(SessionContext session, NamedResource resourceKey, InputStream inputStream) throws IOException, GeneralSecurityException - Overrides:
doReadKeyPairsin classAbstractGeneratorHostKeyProvider- Throws:
IOExceptionGeneralSecurityException
-
isJavaSerialization
private boolean isJavaSerialization(BufferedInputStream in, NamedResource resourceKey) throws IOException - Throws:
IOException
-
doWriteKeyPair
protected void doWriteKeyPair(NamedResource resourceKey, KeyPair kp, OutputStream outputStream) throws IOException, GeneralSecurityException - Specified by:
doWriteKeyPairin classAbstractGeneratorHostKeyProvider- Throws:
IOExceptionGeneralSecurityException
-