Enum BuiltinIdentities
- java.lang.Object
-
- java.lang.Enum<BuiltinIdentities>
-
- org.apache.sshd.common.config.keys.BuiltinIdentities
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<BuiltinIdentities>,AlgorithmNameProvider,Identity,KeyTypeNamesSupport,NamedResource,OptionalFeature
public enum BuiltinIdentities extends java.lang.Enum<BuiltinIdentities> implements Identity
-
-
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 private java.lang.Stringalgorithmprivate java.lang.Stringnamestatic java.util.NavigableSet<java.lang.String>NAMESA case insensitiveNavigableSetof all built-in identities namesprivate java.lang.Class<? extends java.security.PrivateKey>prvTypeprivate java.lang.Class<? extends java.security.PublicKey>pubTypeprivate java.util.NavigableSet<java.lang.String>typesstatic java.util.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
-
-
Constructor Summary
Constructors Modifier Constructor Description privateBuiltinIdentities(java.lang.String type, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.lang.String keyType)privateBuiltinIdentities(java.lang.String name, java.lang.String algorithm, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.lang.String keyType)privateBuiltinIdentities(java.lang.String name, java.lang.String algorithm, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.util.Collection<java.lang.String> keyTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuiltinIdentitiesfromAlgorithm(java.lang.String algorithm)static BuiltinIdentitiesfromKey(java.security.Key key)static BuiltinIdentitiesfromKeyPair(java.security.KeyPair kp)static BuiltinIdentitiesfromKeyType(java.lang.Class<?> clazz)static BuiltinIdentitiesfromKeyTypeName(java.lang.String typeName)static BuiltinIdentitiesfromName(java.lang.String name)java.lang.StringgetAlgorithm()java.lang.StringgetName()java.lang.Class<? extends java.security.PrivateKey>getPrivateKeyType()java.lang.Class<? extends java.security.PublicKey>getPublicKeyType()java.util.NavigableSet<java.lang.String>getSupportedKeyTypes()booleanisSupported()static BuiltinIdentitiesvalueOf(java.lang.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 java.util.Set<BuiltinIdentities> VALUES
-
NAMES
public static final java.util.NavigableSet<java.lang.String> NAMES
A case insensitiveNavigableSetof all built-in identities names
-
name
private final java.lang.String name
-
algorithm
private final java.lang.String algorithm
-
pubType
private final java.lang.Class<? extends java.security.PublicKey> pubType
-
prvType
private final java.lang.Class<? extends java.security.PrivateKey> prvType
-
types
private final java.util.NavigableSet<java.lang.String> types
-
-
Constructor Detail
-
BuiltinIdentities
private BuiltinIdentities(java.lang.String type, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.lang.String keyType)
-
BuiltinIdentities
private BuiltinIdentities(java.lang.String name, java.lang.String algorithm, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.lang.String keyType)
-
BuiltinIdentities
private BuiltinIdentities(java.lang.String name, java.lang.String algorithm, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.util.Collection<java.lang.String> keyTypes)
-
-
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(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getName
public final java.lang.String getName()
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
isSupported
public boolean isSupported()
- Specified by:
isSupportedin interfaceOptionalFeature
-
getSupportedKeyTypes
public java.util.NavigableSet<java.lang.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 java.lang.String getAlgorithm()
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getPublicKeyType
public final java.lang.Class<? extends java.security.PublicKey> getPublicKeyType()
- Specified by:
getPublicKeyTypein interfaceIdentity
-
getPrivateKeyType
public final java.lang.Class<? extends java.security.PrivateKey> getPrivateKeyType()
- Specified by:
getPrivateKeyTypein interfaceIdentity
-
fromName
public static BuiltinIdentities fromName(java.lang.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(java.lang.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(java.security.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(java.security.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(java.lang.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(java.lang.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)
-
-