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
-
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 theCOSEAlgorithmIdentifier
from a public key in COSE_Key format.long
getId()
static COSEAlgorithmIdentifier
Returns 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 theid
of a constant inCOSEAlgorithmIdentifier
- Returns:
- The
COSEAlgorithmIdentifier
instance whoseid
equalsid
, if any. - See Also:
-
fromPublicKey
public static Optional<COSEAlgorithmIdentifier> fromPublicKey(@NonNull @NonNull ByteArray publicKeyCose) Read theCOSEAlgorithmIdentifier
from a public key in COSE_Key format.- Parameters:
publicKeyCose
- a public key in COSE_Key format.- Returns:
- The
alg
of thepublicKeyCose
parsed as aCOSEAlgorithmIdentifier
, if possible. Returns empty if theCOSEAlgorithmIdentifier
enum has no constant matching thealg
value. - Throws:
IllegalArgumentException
- ifpublicKeyCose
is not a well-formed COSE_Key.
-
getId
public long getId()
-