Enum BuiltinIdentities
- java.lang.Object
-
- java.lang.Enum<BuiltinIdentities>
-
- org.apache.sshd.common.config.keys.BuiltinIdentities
-
- All Implemented Interfaces:
Serializable,Comparable<BuiltinIdentities>,AlgorithmNameProvider,Identity,KeyTypeNamesSupport,NamedResource,OptionalFeature
public enum BuiltinIdentities extends Enum<BuiltinIdentities> implements Identity
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuiltinIdentities.ConstantsContains the names of the identities
-
Field Summary
Fields Modifier and Type Field Description static NavigableSet<String>NAMESA case insensitiveNavigableSetof all built-in identities namesstatic Set<BuiltinIdentities>VALUES-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Fields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuiltinIdentitiesfromAlgorithm(String algorithm)static BuiltinIdentitiesfromKey(Key key)static BuiltinIdentitiesfromKeyPair(KeyPair kp)static BuiltinIdentitiesfromKeyType(Class<?> clazz)static BuiltinIdentitiesfromKeyTypeName(String typeName)static BuiltinIdentitiesfromName(String name)StringgetAlgorithm()StringgetName()Class<? extends PrivateKey>getPrivateKeyType()Class<? extends PublicKey>getPublicKeyType()NavigableSet<String>getSupportedKeyTypes()booleanisSupported()static BuiltinIdentitiesvalueOf(String name)Returns the enum constant of this type with the specified name.static BuiltinIdentities[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RSA
public static final BuiltinIdentities RSA
-
DSA
public static final BuiltinIdentities DSA
-
ECDSA
public static final BuiltinIdentities ECDSA
-
ED25119
public static final BuiltinIdentities ED25119
-
-
Field Detail
-
VALUES
public static final Set<BuiltinIdentities> VALUES
-
NAMES
public static final NavigableSet<String> NAMES
A case insensitiveNavigableSetof all built-in identities names
-
-
Method Detail
-
values
public static BuiltinIdentities[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BuiltinIdentities c : BuiltinIdentities.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BuiltinIdentities valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getName
public final String getName()
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
isSupported
public boolean isSupported()
- Specified by:
isSupportedin interfaceOptionalFeature
-
getSupportedKeyTypes
public NavigableSet<String> getSupportedKeyTypes()
- Specified by:
getSupportedKeyTypesin interfaceKeyTypeNamesSupport- Returns:
- The case insensitive
NavigableSetofOpenSSHkey 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...
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getPublicKeyType
public final Class<? extends PublicKey> getPublicKeyType()
- Specified by:
getPublicKeyTypein interfaceIdentity
-
getPrivateKeyType
public final Class<? extends PrivateKey> getPrivateKeyType()
- Specified by:
getPrivateKeyTypein interfaceIdentity
-
fromName
public static BuiltinIdentities fromName(String name)
- Parameters:
name- The identity name - ignored ifnull/empty- Returns:
- The matching
BuiltinIdentitieswhosegetName()value matches case insensitive ornullif no match found
-
fromAlgorithm
public static BuiltinIdentities fromAlgorithm(String algorithm)
- Parameters:
algorithm- The algorithm - ignored ifnull/empty- Returns:
- The matching
BuiltinIdentitieswhosegetAlgorithm()value matches case insensitive ornullif no match found
-
fromKeyPair
public static BuiltinIdentities fromKeyPair(KeyPair kp)
- Parameters:
kp- TheKeyPair- ignored ifnull- Returns:
- The matching
BuiltinIdentitiesprovided both public and public keys are of the same type -nullif no match could be found - See Also:
fromKey(Key)
-
fromKey
public static BuiltinIdentities fromKey(Key key)
- Parameters:
key- TheKeyinstance - ignored ifnull- Returns:
- The matching
BuiltinIdentitieswhose either public or private key type matches the requested one ornullif no match found - See Also:
fromKeyType(Class)
-
fromKeyType
public static BuiltinIdentities fromKeyType(Class<?> clazz)
- Parameters:
clazz- The key type - ignored ifnullor not aKeyclass- Returns:
- The matching
BuiltinIdentitieswhose either public or private key type matches the requested one ornullif no match found - See Also:
getPublicKeyType(),getPrivateKeyType()
-
fromKeyTypeName
public static BuiltinIdentities fromKeyTypeName(String typeName)
- Parameters:
typeName- TheOpenSSHkey type e.g.,ssh-rsa, ssh-dss, ecdsa-sha2-nistp384. Ignored ifnull/empty.- Returns:
- The
BuiltinIdentitiesthat reported the type name as itsgetSupportedKeyTypes()(case insensitive) -nullif no match found - See Also:
KeyTypeNamesSupport.findSupporterByKeyTypeName(String, Collection)
-
-