public enum BuiltinIdentities extends java.lang.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 |
---|---|
private java.lang.String |
algorithm |
private java.lang.String |
name |
static java.util.NavigableSet<java.lang.String> |
NAMES
A case insensitive
NavigableSet of all built-in identities names |
private 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 |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
FALSE, TRUE
Modifier and Type | Method and 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.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
findByName, getNameList, getNames, ofName, removeByName
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 java.util.Set<BuiltinIdentities> VALUES
public static final java.util.NavigableSet<java.lang.String> NAMES
NavigableSet
of all built-in identities namesprivate final java.lang.String name
private final java.lang.String algorithm
private final java.lang.Class<? extends java.security.PublicKey> pubType
private final java.lang.Class<? extends java.security.PrivateKey> prvType
private final java.util.NavigableSet<java.lang.String> types
public static BuiltinIdentities[] values()
for (BuiltinIdentities c : BuiltinIdentities.values()) System.out.println(c);
public static BuiltinIdentities valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final java.lang.String getName()
getName
in interface NamedResource
public boolean isSupported()
isSupported
in interface OptionalFeature
public java.util.NavigableSet<java.lang.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 java.lang.String getAlgorithm()
getAlgorithm
in interface AlgorithmNameProvider
public final java.lang.Class<? extends java.security.PublicKey> getPublicKeyType()
getPublicKeyType
in interface Identity
public final java.lang.Class<? extends java.security.PrivateKey> getPrivateKeyType()
getPrivateKeyType
in interface Identity
public static BuiltinIdentities fromName(java.lang.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(java.lang.String algorithm)
algorithm
- The algorithm - ignored if null
/emptyBuiltinIdentities
whose getAlgorithm()
value matches case
insensitive or null
if no match foundpublic static BuiltinIdentities fromKeyPair(java.security.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(java.security.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(java.lang.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(java.lang.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)