Package se.digg.dgc.signatures.cose
Enum SignatureAlgorithm
- java.lang.Object
-
- java.lang.Enum<SignatureAlgorithm>
-
- se.digg.dgc.signatures.cose.SignatureAlgorithm
-
- All Implemented Interfaces:
Serializable
,Comparable<SignatureAlgorithm>
public enum SignatureAlgorithm extends Enum<SignatureAlgorithm>
Representation of the supported signature algorithms.- Author:
- Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SignatureAlgorithm
fromCborObject(com.upokecenter.cbor.CBORObject value)
Given a CBOR object the method gets the correspondingSignatureAlgorithmId
.static SignatureAlgorithm
fromValue(int value)
Given a value the method gets the correspondingSignatureAlgorithmId
.com.upokecenter.cbor.CBORObject
getCborObject()
Gets the signature identifier as a CBOR object.String
getJcaAlgorithmName()
Gets the JCA algorithm name for this algorithm.String
getName()
Gets the COSE/JOSE name of the algorithm.int
getValue()
Gets the CBOR value for the signature identifier.static SignatureAlgorithm
valueOf(String name)
Returns the enum constant of this type with the specified name.static SignatureAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ES256
public static final SignatureAlgorithm ES256
ECDSA with SHA-256.
-
ES384
public static final SignatureAlgorithm ES384
ECDSA with SHA-384.
-
ES512
public static final SignatureAlgorithm ES512
ECDSA with SHA-512.
-
PS256
public static final SignatureAlgorithm PS256
RSASSA-PSS with SHA-256.
-
PS384
public static final SignatureAlgorithm PS384
RSASSA-PSS with SHA-384.
-
PS512
public static final SignatureAlgorithm PS512
RSASSA-PSS with SHA-512.
-
-
Method Detail
-
values
public static SignatureAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SignatureAlgorithm c : SignatureAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SignatureAlgorithm valueOf(String name)
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
-
fromCborObject
public static SignatureAlgorithm fromCborObject(com.upokecenter.cbor.CBORObject value)
Given a CBOR object the method gets the correspondingSignatureAlgorithmId
.- Parameters:
value
- the value- Returns:
- a SignatureAlgorithmId
-
fromValue
public static SignatureAlgorithm fromValue(int value)
Given a value the method gets the correspondingSignatureAlgorithmId
.- Parameters:
value
- the value- Returns:
- a SignatureAlgorithmId
-
getCborObject
public com.upokecenter.cbor.CBORObject getCborObject()
Gets the signature identifier as a CBOR object.- Returns:
- a CBORObject
-
getValue
public int getValue()
Gets the CBOR value for the signature identifier.- Returns:
- the value
-
getJcaAlgorithmName
public String getJcaAlgorithmName()
Gets the JCA algorithm name for this algorithm.- Returns:
- the JCA algorithm name
-
getName
public String getName()
Gets the COSE/JOSE name of the algorithm.- Returns:
- the name
-
-