public interface KeyPairProvider extends KeyIdentityProvider
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ECDSA_SHA2_NISTP256
SSH identifier for EC keys in NIST curve P-256
|
static java.lang.String |
ECDSA_SHA2_NISTP384
SSH identifier for EC keys in NIST curve P-384
|
static java.lang.String |
ECDSA_SHA2_NISTP521
SSH identifier for EC keys in NIST curve P-521
|
static KeyPairProvider |
EMPTY_KEYPAIR_PROVIDER
A
KeyPairProvider that has no keys |
static java.lang.String |
SSH_DSS
SSH identifier for DSA keys
|
static java.lang.String |
SSH_DSS_CERT |
static java.lang.String |
SSH_ECDSA_SHA2_NISTP256_CERT |
static java.lang.String |
SSH_ECDSA_SHA2_NISTP384_CERT |
static java.lang.String |
SSH_ECDSA_SHA2_NISTP521_CERT |
static java.lang.String |
SSH_ED25519
SSH identifier for ED25519 elliptic curve keys
|
static java.lang.String |
SSH_ED25519_CERT |
static java.lang.String |
SSH_RSA
SSH identifier for RSA keys
|
static java.lang.String |
SSH_RSA_CERT
SSH identifier for openssh cert keys
|
EMPTY_KEYS_PROVIDER
Modifier and Type | Method and Description |
---|---|
default java.lang.Iterable<java.lang.String> |
getKeyTypes(SessionContext session) |
default java.security.KeyPair |
loadKey(SessionContext session,
java.lang.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(java.lang.Iterable<java.security.KeyPair> pairs)
Wrap the provided
KeyPair s into a KeyPairProvider |
static KeyPairProvider |
wrap(java.security.KeyPair... pairs)
Wrap the provided
KeyPair s into a KeyPairProvider |
exhaustCurrentIdentities, isEmpty, iterableOf, loadKeys, multiProvider, multiProvider, resolveKeyIdentityProvider, wrapKeyPairs, wrapKeyPairs
static final java.lang.String SSH_RSA
static final java.lang.String SSH_DSS
static final java.lang.String SSH_ED25519
static final java.lang.String ECDSA_SHA2_NISTP256
static final java.lang.String ECDSA_SHA2_NISTP384
static final java.lang.String ECDSA_SHA2_NISTP521
static final java.lang.String SSH_RSA_CERT
static final java.lang.String SSH_DSS_CERT
static final java.lang.String SSH_ED25519_CERT
static final java.lang.String SSH_ECDSA_SHA2_NISTP256_CERT
static final java.lang.String SSH_ECDSA_SHA2_NISTP384_CERT
static final java.lang.String SSH_ECDSA_SHA2_NISTP521_CERT
static final KeyPairProvider EMPTY_KEYPAIR_PROVIDER
KeyPairProvider
that has no keysdefault java.security.KeyPair loadKey(SessionContext session, java.lang.String type) throws java.io.IOException, java.security.GeneralSecurityException
null
session
- The SessionContext
for invoking this load command - may be null
if not invoked within a session context (e.g., offline tool).type
- the type of key to loadnull
if this type of key is not availablejava.io.IOException
- If failed to read/parse the keys datajava.security.GeneralSecurityException
- If failed to generate the keysdefault java.lang.Iterable<java.lang.String> getKeyTypes(SessionContext session) throws java.io.IOException, java.security.GeneralSecurityException
session
- The SessionContext
for invoking this load command - may be null
if not invoked within a session context (e.g., offline tool).Iterable
key types - never null
java.io.IOException
- If failed to read/parse the keys datajava.security.GeneralSecurityException
- If failed to generate the keysstatic KeyPairProvider wrap(java.security.KeyPair... pairs)
KeyPair
s into a KeyPairProvider
pairs
- The available pairs - ignored if null
/empty (i.e., returns EMPTY_KEYPAIR_PROVIDER
)wrap(Iterable)
static KeyPairProvider wrap(java.lang.Iterable<java.security.KeyPair> pairs)
KeyPair
s into a KeyPairProvider
pairs
- The available pairs Iterable
- ignored if null
(i.e., returns
EMPTY_KEYPAIR_PROVIDER
)