Package com.yubico.webauthn.data
Enum Class COSEAlgorithmIdentifier
- All Implemented Interfaces:
Serializable,Comparable<COSEAlgorithmIdentifier>,Constable
A number identifying a cryptographic algorithm. The algorithm identifiers SHOULD be values
registered in the IANA COSE Algorithms registry, for instance, -7 for "ES256" and -257 for
"RS256".
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<COSEAlgorithmIdentifier>fromId(long id) Attempt to parse an integer as aCOSEAlgorithmIdentifier.static Optional<COSEAlgorithmIdentifier>fromPublicKey(@NonNull ByteArray publicKeyCose) Read theCOSEAlgorithmIdentifierfrom a public key in COSE_Key format.longgetId()static COSEAlgorithmIdentifierReturns the enum constant of this class with the specified name.static COSEAlgorithmIdentifier[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EdDSA
-
ES256
-
ES384
-
ES512
-
RS256
-
RS384
-
RS512
-
RS1
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
fromId
Attempt to parse an integer as aCOSEAlgorithmIdentifier.- Parameters:
id- an integer equal to theidof a constant inCOSEAlgorithmIdentifier- Returns:
- The
COSEAlgorithmIdentifierinstance whoseidequalsid, if any. - See Also:
-
fromPublicKey
public static Optional<COSEAlgorithmIdentifier> fromPublicKey(@NonNull @NonNull ByteArray publicKeyCose) Read theCOSEAlgorithmIdentifierfrom a public key in COSE_Key format.- Parameters:
publicKeyCose- a public key in COSE_Key format.- Returns:
- The
algof thepublicKeyCoseparsed as aCOSEAlgorithmIdentifier, if possible. Returns empty if theCOSEAlgorithmIdentifierenum has no constant matching thealgvalue. - Throws:
IllegalArgumentException- ifpublicKeyCoseis not a well-formed COSE_Key.
-
getId
public long getId()
-