public class SimpleGeneratorHostKeyProvider extends AbstractGeneratorHostKeyProvider
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.| Modifier and Type | Class and Description |
|---|---|
private static class |
SimpleGeneratorHostKeyProvider.ValidatingObjectInputStream |
DEFAULT_ALGORITHM, DEFAULT_ALLOWED_TO_OVERWRITElogECDSA_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_CERTEMPTY_KEYS_PROVIDER| Constructor and Description |
|---|
SimpleGeneratorHostKeyProvider() |
SimpleGeneratorHostKeyProvider(java.nio.file.Path path) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Iterable<java.security.KeyPair> |
doReadKeyPairs(SessionContext session,
NamedResource resourceKey,
java.io.InputStream inputStream) |
protected void |
doWriteKeyPair(NamedResource resourceKey,
java.security.KeyPair kp,
java.io.OutputStream outputStream) |
private boolean |
isJavaSerialization(java.io.BufferedInputStream in,
NamedResource resourceKey) |
clearLoadedKeys, generateKeyPair, getAlgorithm, getKeySize, getKeySpec, getPath, isOverwriteAllowed, loadFromFile, loadKeys, readKeyPairs, resolveKeyPairs, setAlgorithm, setKeySize, setKeySpec, setOverwriteAllowed, setPath, writeKeyPairdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetKeyTypes, loadKey, wrap, wrapexhaustCurrentIdentities, isEmpty, iterableOf, multiProvider, multiProvider, resolveKeyIdentityProvider, wrapKeyPairs, wrapKeyPairspublic SimpleGeneratorHostKeyProvider()
public SimpleGeneratorHostKeyProvider(java.nio.file.Path path)
protected java.lang.Iterable<java.security.KeyPair> doReadKeyPairs(SessionContext session, NamedResource resourceKey, java.io.InputStream inputStream) throws java.io.IOException, java.security.GeneralSecurityException
doReadKeyPairs in class AbstractGeneratorHostKeyProviderjava.io.IOExceptionjava.security.GeneralSecurityExceptionprivate boolean isJavaSerialization(java.io.BufferedInputStream in,
NamedResource resourceKey)
throws java.io.IOException
java.io.IOExceptionprotected void doWriteKeyPair(NamedResource resourceKey, java.security.KeyPair kp, java.io.OutputStream outputStream) throws java.io.IOException, java.security.GeneralSecurityException
doWriteKeyPair in class AbstractGeneratorHostKeyProviderjava.io.IOExceptionjava.security.GeneralSecurityException