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".
- Since:
- 0.3.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe signature scheme Ed25519 as defined in RFC 8032.The signature scheme Ed448 as defined in RFC 8032.The signature scheme Ed25519 as defined in RFC 8032.ECDSA with SHA-256 on the NIST P-256 curve.ECDSA with SHA-384 on the NIST P-384 curve.ECDSA with SHA-512 on the NIST P-521 curve.RSASSA-PKCS1-v1_5 using SHA-1.RSASSA-PKCS1-v1_5 using SHA-256.RSASSA-PKCS1-v1_5 using SHA-384.RSASSA-PKCS1-v1_5 using SHA-512. -
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
The signature scheme Ed25519 as defined in RFC 8032.Note: This COSE identifier does not in general identify the full Ed25519 parameter suite, but is specialized to that meaning within the WebAuthn API.
-
Ed25519
The signature scheme Ed25519 as defined in RFC 8032.This value is NOT RECOMMENDED, see the documentation of
pubKeyCredParams. UseEdDSAinstead or in addition. -
Ed448
The signature scheme Ed448 as defined in RFC 8032. -
ES256
ECDSA with SHA-256 on the NIST P-256 curve.Note: This COSE identifier does not in general restrict the curve to P-256, but is specialized to that meaning within the WebAuthn API.
-
ES384
ECDSA with SHA-384 on the NIST P-384 curve.Note: This COSE identifier does not in general restrict the curve to P-384, but is specialized to that meaning within the WebAuthn API.
-
ES512
ECDSA with SHA-512 on the NIST P-521 curve.Note: This COSE identifier does not in general restrict the curve to P-521, but is specialized to that meaning within the WebAuthn API.
-
RS256
RSASSA-PKCS1-v1_5 using SHA-256.- Since:
- 0.3.0
- See Also:
-
RS384
RSASSA-PKCS1-v1_5 using SHA-384.- Since:
- 2.4.0
- See Also:
-
RS512
RSASSA-PKCS1-v1_5 using SHA-512.- Since:
- 2.4.0
- See Also:
-
RS1
RSASSA-PKCS1-v1_5 using SHA-1.- Since:
- 1.5.0
- See Also:
-
-
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. - Since:
- 0.3.0
- 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.- Since:
- 2.1.0
-
getId
public long getId()
-