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 class
BuiltinIdentities.Constants
Contains the names of the identities
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
algorithm
private java.lang.String
name
static java.util.NavigableSet<java.lang.String>
NAMES
A case insensitiveNavigableSet
of all built-in identities namesprivate java.lang.Class<? extends java.security.PrivateKey>
prvType
private java.lang.Class<? extends java.security.PublicKey>
pubType
private java.util.NavigableSet<java.lang.String>
types
static 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 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)
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)
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BuiltinIdentities
fromAlgorithm(java.lang.String algorithm)
static BuiltinIdentities
fromKey(java.security.Key key)
static BuiltinIdentities
fromKeyPair(java.security.KeyPair kp)
static BuiltinIdentities
fromKeyType(java.lang.Class<?> clazz)
static BuiltinIdentities
fromKeyTypeName(java.lang.String typeName)
static BuiltinIdentities
fromName(java.lang.String name)
java.lang.String
getAlgorithm()
java.lang.String
getName()
java.lang.Class<? extends java.security.PrivateKey>
getPrivateKeyType()
java.lang.Class<? extends java.security.PublicKey>
getPublicKeyType()
java.util.NavigableSet<java.lang.String>
getSupportedKeyTypes()
boolean
isSupported()
static BuiltinIdentities
valueOf(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 insensitiveNavigableSet
of 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:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
isSupported
public boolean isSupported()
- Specified by:
isSupported
in interfaceOptionalFeature
-
getSupportedKeyTypes
public java.util.NavigableSet<java.lang.String> getSupportedKeyTypes()
- Specified by:
getSupportedKeyTypes
in interfaceKeyTypeNamesSupport
- Returns:
- The case insensitive
NavigableSet
ofOpenSSH
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...
-
getAlgorithm
public java.lang.String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceAlgorithmNameProvider
-
getPublicKeyType
public final java.lang.Class<? extends java.security.PublicKey> getPublicKeyType()
- Specified by:
getPublicKeyType
in interfaceIdentity
-
getPrivateKeyType
public final java.lang.Class<? extends java.security.PrivateKey> getPrivateKeyType()
- Specified by:
getPrivateKeyType
in interfaceIdentity
-
fromName
public static BuiltinIdentities fromName(java.lang.String name)
- Parameters:
name
- The identity name - ignored ifnull
/empty- Returns:
- The matching
BuiltinIdentities
whosegetName()
value matches case insensitive ornull
if no match found
-
fromAlgorithm
public static BuiltinIdentities fromAlgorithm(java.lang.String algorithm)
- Parameters:
algorithm
- The algorithm - ignored ifnull
/empty- Returns:
- The matching
BuiltinIdentities
whosegetAlgorithm()
value matches case insensitive ornull
if no match found
-
fromKeyPair
public static BuiltinIdentities fromKeyPair(java.security.KeyPair kp)
- Parameters:
kp
- TheKeyPair
- ignored ifnull
- Returns:
- 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)
-
fromKey
public static BuiltinIdentities fromKey(java.security.Key key)
- Parameters:
key
- TheKey
instance - ignored ifnull
- Returns:
- The matching
BuiltinIdentities
whose either public or private key type matches the requested one ornull
if no match found - See Also:
fromKeyType(Class)
-
fromKeyType
public static BuiltinIdentities fromKeyType(java.lang.Class<?> clazz)
- Parameters:
clazz
- The key type - ignored ifnull
or not aKey
class- Returns:
- The matching
BuiltinIdentities
whose either public or private key type matches the requested one ornull
if no match found - See Also:
getPublicKeyType()
,getPrivateKeyType()
-
fromKeyTypeName
public static BuiltinIdentities fromKeyTypeName(java.lang.String typeName)
- Parameters:
typeName
- TheOpenSSH
key type e.g.,ssh-rsa, ssh-dss, ecdsa-sha2-nistp384
. Ignored ifnull
/empty.- Returns:
- The
BuiltinIdentities
that reported the type name as itsgetSupportedKeyTypes()
(case insensitive) -null
if no match found - See Also:
KeyTypeNamesSupport.findSupporterByKeyTypeName(String, Collection)
-
-