Enum BuiltinIdentities
- All Implemented Interfaces:
Serializable, Comparable<BuiltinIdentities>, AlgorithmNameProvider, Identity, KeyTypeNamesSupport, NamedResource, OptionalFeature
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the names of the identities -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringstatic final NavigableSet<String> A case insensitiveNavigableSetof all built-in identities namesprivate final Class<? extends PrivateKey> private final NavigableSet<String> static final Set<BuiltinIdentities> Fields inherited from interface NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface OptionalFeature
FALSE, TRUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBuiltinIdentities(String type, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, String keyType) privateBuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, String keyType) privateBuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, Collection<String> keyTypes) -
Method Summary
Modifier and TypeMethodDescriptionstatic BuiltinIdentitiesfromAlgorithm(String algorithm) static BuiltinIdentitiesstatic BuiltinIdentitiesfromKeyPair(KeyPair kp) static BuiltinIdentitiesfromKeyType(Class<?> clazz) static BuiltinIdentitiesfromKeyTypeName(String typeName) static BuiltinIdentitiesfinal StringgetName()final Class<? extends PrivateKey> booleanstatic BuiltinIdentitiesReturns 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 Details
-
RSA
-
DSA
-
ECDSA
-
ED25119
-
-
Field Details
-
VALUES
-
NAMES
A case insensitiveNavigableSetof all built-in identities names -
name
-
algorithm
-
pubType
-
prvType
-
types
-
-
Constructor Details
-
BuiltinIdentities
-
BuiltinIdentities
-
BuiltinIdentities
private BuiltinIdentities(String name, String algorithm, Class<? extends PublicKey> pubType, Class<? extends PrivateKey> prvType, Collection<String> keyTypes)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
isSupported
public boolean isSupported()- Specified by:
isSupportedin interfaceOptionalFeature
-
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
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getPublicKeyType
- Specified by:
getPublicKeyTypein interfaceIdentity
-
getPrivateKeyType
- Specified by:
getPrivateKeyTypein interfaceIdentity
-
fromName
- Parameters:
name- The identity name - ignored ifnull/empty- Returns:
- The matching
BuiltinIdentitieswhosegetName()value matches case insensitive ornullif no match found
-
fromAlgorithm
- Parameters:
algorithm- The algorithm - ignored ifnull/empty- Returns:
- The matching
BuiltinIdentitieswhosegetAlgorithm()value matches case insensitive ornullif no match found
-
fromKeyPair
- 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
- 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
- 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:
-
fromKeyTypeName
- 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:
-