Interface KeyPairProvider
- All Superinterfaces:
KeyIdentityProvider
- All Known Implementing Classes:
AbstractGeneratorHostKeyProvider
,AbstractKeyPairProvider
,AbstractResourceKeyPairProvider
,BouncyCastleGeneratorHostKeyProvider
,BuiltinClientIdentitiesWatcher
,ClassLoadableResourceKeyPairProvider
,ClientIdentitiesWatcher
,DefaultClientIdentitiesWatcher
,FileKeyPairProvider
,MappedKeyPairProvider
,SimpleGeneratorHostKeyProvider
Provider for key pairs. This provider is used on the server side to provide the host key, or on the client side to
provide the user key.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
SSH identifier for EC keys in NIST curve P-256static final String
SSH identifier for EC keys in NIST curve P-384static final String
SSH identifier for EC keys in NIST curve P-521static final KeyPairProvider
AKeyPairProvider
that has no keysstatic final String
SSH identifier for DSA keysstatic final String
static final String
static final String
static final String
static final String
SSH identifier for ED25519 elliptic curve keysstatic final String
static final String
SSH identifier for RSA keysstatic final String
SSH identifier for openssh cert keysFields inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
EMPTY_KEYS_PROVIDER
-
Method Summary
Modifier and TypeMethodDescriptiongetKeyTypes
(SessionContext session) default KeyPair
loadKey
(SessionContext session, String type) Load a key of the specified type which can be "ssh-rsa", "ssh-dss", or "ecdsa-sha2-nistp{256,384,521}".static KeyPairProvider
Wrap the providedKeyPair
s into aKeyPairProvider
static KeyPairProvider
Wrap the providedKeyPair
s into aKeyPairProvider
Methods inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
loadKeys
-
Field Details
-
SSH_RSA
SSH identifier for RSA keys- See Also:
-
SSH_DSS
SSH identifier for DSA keys- See Also:
-
SSH_ED25519
SSH identifier for ED25519 elliptic curve keys- See Also:
-
ECDSA_SHA2_NISTP256
SSH identifier for EC keys in NIST curve P-256 -
ECDSA_SHA2_NISTP384
SSH identifier for EC keys in NIST curve P-384 -
ECDSA_SHA2_NISTP521
SSH identifier for EC keys in NIST curve P-521 -
SSH_RSA_CERT
SSH identifier for openssh cert keys- See Also:
-
SSH_DSS_CERT
- See Also:
-
SSH_ED25519_CERT
- See Also:
-
SSH_ECDSA_SHA2_NISTP256_CERT
- See Also:
-
SSH_ECDSA_SHA2_NISTP384_CERT
- See Also:
-
SSH_ECDSA_SHA2_NISTP521_CERT
- See Also:
-
EMPTY_KEYPAIR_PROVIDER
AKeyPairProvider
that has no keys
-
-
Method Details
-
loadKey
default KeyPair loadKey(SessionContext session, String type) throws IOException, GeneralSecurityException Load a key of the specified type which can be "ssh-rsa", "ssh-dss", or "ecdsa-sha2-nistp{256,384,521}". If there is no key of this type, returnnull
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).type
- the type of key to load- Returns:
- a valid key pair or
null
if this type of key is not available - Throws:
IOException
- If failed to read/parse the keys dataGeneralSecurityException
- If failed to generate the keys
-
getKeyTypes
default Iterable<String> getKeyTypes(SessionContext session) throws IOException, GeneralSecurityException - Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).- Returns:
- The available
Iterable
key types - nevernull
- Throws:
IOException
- If failed to read/parse the keys dataGeneralSecurityException
- If failed to generate the keys
-
wrap
Wrap the providedKeyPair
s into aKeyPairProvider
- Parameters:
pairs
- The available pairs - ignored ifnull
/empty (i.e., returnsEMPTY_KEYPAIR_PROVIDER
)- Returns:
- The provider wrapper
- See Also:
-
wrap
Wrap the providedKeyPair
s into aKeyPairProvider
- Parameters:
pairs
- The available pairsIterable
- ignored ifnull
(i.e., returnsEMPTY_KEYPAIR_PROVIDER
)- Returns:
- The provider wrapper
-