public enum BuiltinIdentities extends Enum<BuiltinIdentities> implements Identity
Modifier and Type | Class and Description |
---|---|
static class |
BuiltinIdentities.Constants
Contains the names of the identities
|
Modifier and Type | Field and Description |
---|---|
static NavigableSet<String> |
NAMES
A case insensitive
NavigableSet of all built-in identities names |
static Set<BuiltinIdentities> |
VALUES |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
FALSE, TRUE
Modifier and Type | Method and Description |
---|---|
static BuiltinIdentities |
fromAlgorithm(String algorithm) |
static BuiltinIdentities |
fromKey(Key key) |
static BuiltinIdentities |
fromKeyPair(KeyPair kp) |
static BuiltinIdentities |
fromKeyType(Class<?> clazz) |
static BuiltinIdentities |
fromKeyTypeName(String typeName) |
static BuiltinIdentities |
fromName(String name) |
String |
getAlgorithm() |
String |
getName() |
Class<? extends PrivateKey> |
getPrivateKeyType() |
Class<? extends PublicKey> |
getPublicKeyType() |
NavigableSet<String> |
getSupportedKeyTypes() |
boolean |
isSupported() |
static BuiltinIdentities |
valueOf(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.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
all, any, of
findSupporterByKeyTypeName
public static final BuiltinIdentities RSA
public static final BuiltinIdentities DSA
public static final BuiltinIdentities ECDSA
public static final BuiltinIdentities ED25119
public static final Set<BuiltinIdentities> VALUES
public static final NavigableSet<String> NAMES
NavigableSet
of all built-in identities namespublic static BuiltinIdentities[] values()
for (BuiltinIdentities c : BuiltinIdentities.values()) System.out.println(c);
public static BuiltinIdentities valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic final String getName()
getName
in interface NamedResource
public boolean isSupported()
isSupported
in interface OptionalFeature
public NavigableSet<String> getSupportedKeyTypes()
getSupportedKeyTypes
in interface KeyTypeNamesSupport
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...public String getAlgorithm()
getAlgorithm
in interface AlgorithmNameProvider
public final Class<? extends PublicKey> getPublicKeyType()
getPublicKeyType
in interface Identity
public final Class<? extends PrivateKey> getPrivateKeyType()
getPrivateKeyType
in interface Identity
public static BuiltinIdentities fromName(String name)
name
- The identity name - ignored if null
/emptyBuiltinIdentities
whose getName()
value matches case
insensitive or null
if no match foundpublic static BuiltinIdentities fromAlgorithm(String algorithm)
algorithm
- The algorithm - ignored if null
/emptyBuiltinIdentities
whose getAlgorithm()
value matches case
insensitive or null
if no match foundpublic static BuiltinIdentities fromKeyPair(KeyPair kp)
kp
- The KeyPair
- ignored if null
BuiltinIdentities
provided both public and public keys are of the same
type - null
if no match could be foundfromKey(Key)
public static BuiltinIdentities fromKey(Key key)
key
- The Key
instance - ignored if null
BuiltinIdentities
whose either public or private key type matches the requested
one or null
if no match foundfromKeyType(Class)
public static BuiltinIdentities fromKeyType(Class<?> clazz)
clazz
- The key type - ignored if null
or not a Key
classBuiltinIdentities
whose either public or private key type matches the
requested one or null
if no match foundgetPublicKeyType()
,
getPrivateKeyType()
public static BuiltinIdentities fromKeyTypeName(String typeName)
typeName
- The OpenSSH
key type e.g., ssh-rsa, ssh-dss, ecdsa-sha2-nistp384
. Ignored if
null
/empty.BuiltinIdentities
that reported the type name as its getSupportedKeyTypes()
(case insensitive) - null
if no match foundKeyTypeNamesSupport.findSupporterByKeyTypeName(String, Collection)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.