Top Inners Fields Constructors Methods
org.apache.sshd.common.config.keys

public sealed Enum BuiltinIdentities

extends Enum<BuiltinIdentities>
implements Identity
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.config.keys.Identity, org.apache.sshd.common.config.keys.KeyTypeNamesSupport, org.apache.sshd.common.OptionalFeature, org.apache.sshd.common.NamedResource, org.apache.sshd.common.AlgorithmNameProvider
Imports
java.security.Key, .KeyPair, .PrivateKey, .PublicKey, java.security.interfaces.DSAPrivateKey, .DSAPublicKey, .ECPrivateKey, .ECPublicKey, .RSAPrivateKey, .RSAPublicKey, java.util.Collection, .Collections, .EnumSet, .NavigableSet, .Objects, .Set, java.util.stream.Collectors, org.apache.sshd.common.NamedResource, org.apache.sshd.common.cipher.ECCurves, org.apache.sshd.common.keyprovider.KeyPairProvider, .KeyTypeIndicator, org.apache.sshd.common.util.GenericUtils, .ValidateUtils, org.apache.sshd.common.util.security.SecurityUtils

Author
Apache MINA SSHD Project

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
BuiltinIdentities.Constants

Contains the names of the identities

Field Summary

Modifier and TypeField and Description
private final String
public static final BuiltinIdentities
public static final BuiltinIdentities
public static final BuiltinIdentities
private final String
public static final NavigableSet<String>
NAMES

A case insensitive NavigableSet of all built-in identities names

private final Class<? extends PrivateKey>
private final Class<? extends PublicKey>
public static final BuiltinIdentities
private final NavigableSet<String>
public static final Set<BuiltinIdentities>

Constructor Summary

AccessConstructor and Description
private
BuiltinIdentities(String type, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, String keyType)

private
BuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, String keyType)

private
BuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, Collection<String> keyTypes)

Method Summary

Modifier and TypeMethod and Description
public static BuiltinIdentities

Returns:

The matching BuiltinIdentities whose getAlgorithm() value matches case insensitive or null if no match found
fromAlgorithm
(String
The algorithm - ignored if null/empty
algorithm
)

public static BuiltinIdentities

Returns:

The matching BuiltinIdentities whose either public or private key type matches the requested one or null if no match found
fromKey
(Key
The Key instance - ignored if null
key
)

public static BuiltinIdentities

Returns:

The matching BuiltinIdentities provided both public and public keys are of the same type - null if no match could be found
fromKeyPair
(KeyPair
The KeyPair - ignored if null
kp
)

public static BuiltinIdentities

Returns:

The matching BuiltinIdentities whose either public or private key type matches the requested one or null if no match found
fromKeyType
(Class<?>
The key type - ignored if null or not a Key class
clazz
)

public static BuiltinIdentities

Returns:

The BuiltinIdentities that reported the type name as its getSupportedKeyTypes() (case insensitive) - null if no match found
fromKeyTypeName
(String
The OpenSSH key type e.g., ssh-rsa, ssh-dss, ecdsa-sha2-nistp384. Ignored if null/empty.
typeName
)

public static BuiltinIdentities

Returns:

The matching BuiltinIdentities whose getName() value matches case insensitive or null if no match found
fromName
(String
The identity name - ignored if null/empty
name
)

public String
public final String
public final Class<? extends PrivateKey>
public final Class<? extends PublicKey>
public NavigableSet<String>
public boolean
public static BuiltinIdentities
public static BuiltinIdentities[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

algorithmback to summary
private final String algorithm
DSAback to summary
public static final BuiltinIdentities DSA
ECDSAback to summary
public static final BuiltinIdentities ECDSA
ED25119back to summary
public static final BuiltinIdentities ED25119
nameback to summary
private final String name

Hides java.lang.Enum.name.

NAMESback to summary
public static final NavigableSet<String> NAMES

A case insensitive NavigableSet of all built-in identities names

prvTypeback to summary
private final Class<? extends PrivateKey> prvType
pubTypeback to summary
private final Class<? extends PublicKey> pubType
RSAback to summary
public static final BuiltinIdentities RSA
typesback to summary
private final NavigableSet<String> types
VALUESback to summary
public static final Set<BuiltinIdentities> VALUES

Constructor Detail

BuiltinIdentitiesback to summary
private BuiltinIdentities(String type, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, String keyType)
BuiltinIdentitiesback to summary
private BuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, String keyType)
BuiltinIdentitiesback to summary
private BuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, Collection<String> keyTypes)

Method Detail

fromAlgorithmback to summary
public static BuiltinIdentities fromAlgorithm(String algorithm)
Parameters
algorithm:String

The algorithm - ignored if null/empty

Returns:BuiltinIdentities

The matching BuiltinIdentities whose getAlgorithm() value matches case insensitive or null if no match found

fromKeyback to summary
public static BuiltinIdentities fromKey(Key key)
Parameters
key:Key

The Key instance - ignored if null

Returns:BuiltinIdentities

The matching BuiltinIdentities whose either public or private key type matches the requested one or null if no match found

See Also
fromKeyType(Class)
fromKeyPairback to summary
public static BuiltinIdentities fromKeyPair(KeyPair kp)
Parameters
kp:KeyPair

The KeyPair - ignored if null

Returns:BuiltinIdentities

The matching BuiltinIdentities provided both public and public keys are of the same type - null if no match could be found

See Also
fromKey(Key)
fromKeyTypeback to summary
public static BuiltinIdentities fromKeyType(Class<?> clazz)
Parameters
clazz:Class<?>

The key type - ignored if null or not a Key class

Returns:BuiltinIdentities

The matching BuiltinIdentities whose either public or private key type matches the requested one or null if no match found

See Also
getPublicKeyType(), getPrivateKeyType()
fromKeyTypeNameback to summary
public static BuiltinIdentities fromKeyTypeName(String typeName)
Parameters
typeName:String

The OpenSSH key type e.g., ssh-rsa, ssh-dss, ecdsa-sha2-nistp384. Ignored if null/empty.

Returns:BuiltinIdentities

The BuiltinIdentities that reported the type name as its getSupportedKeyTypes() (case insensitive) - null if no match found

See Also
KeyTypeNamesSupport#findSupporterByKeyTypeName(String, Collection)
fromNameback to summary
public static BuiltinIdentities fromName(String name)
Parameters
name:String

The identity name - ignored if null/empty

Returns:BuiltinIdentities

The matching BuiltinIdentities whose getName() value matches case insensitive or null if no match found

getAlgorithmback to summary
public String getAlgorithm()

Implements org.apache.sshd.common.AlgorithmNameProvider.getAlgorithm.

Annotations
@Override
getNameback to summary
public final String getName()

Implements org.apache.sshd.common.NamedResource.getName.

Returns:String

Doc from org.apache.sshd.common.NamedResource.getName.

The resource name

Annotations
@Override
getPrivateKeyTypeback to summary
public final Class<? extends PrivateKey> getPrivateKeyType()

Implements org.apache.sshd.common.config.keys.Identity.getPrivateKeyType.

Annotations
@Override
getPublicKeyTypeback to summary
public final Class<? extends PublicKey> getPublicKeyType()

Implements org.apache.sshd.common.config.keys.Identity.getPublicKeyType.

Annotations
@Override
getSupportedKeyTypesback to summary
public NavigableSet<String> getSupportedKeyTypes()

Implements org.apache.sshd.common.config.keys.KeyTypeNamesSupport.getSupportedKeyTypes.

Returns:NavigableSet<String>

Doc from org.apache.sshd.common.config.keys.KeyTypeNamesSupport.getSupportedKeyTypes.

The case insensitive NavigableSet of OpenSSH key type names that are supported by this decoder - e.g., ssh-rsa, ssh-dss, ecdsa-sha2-nistp384. This is not a single name - e.g., ECDSA keys have several curve names

Caveat

this collection may be un-modifiable...

Annotations
@Override
isSupportedback to summary
public boolean isSupported()

Implements org.apache.sshd.common.OptionalFeature.isSupported.

Annotations
@Override
valueOfback to summary
public static BuiltinIdentities valueOf(String name)
valuesback to summary
public static BuiltinIdentities[] values()
org.apache.sshd.common.config.keys back to summary

public final Class BuiltinIdentities.Constants

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.sshd.common.config.keys.BuiltinIdentities.Constants

Contains the names of the identities

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DSAback to summary
public static final String DSA
ECDSAback to summary
public static final String ECDSA
ED25519back to summary
public static final String ED25519
RSAback to summary
public static final String RSA

Constructor Detail

Constantsback to summary
private Constants()