Enum Class PowerAuthSignatureFormat
java.lang.Object
java.lang.Enum<PowerAuthSignatureFormat>
io.getlime.security.powerauth.crypto.lib.enums.PowerAuthSignatureFormat
- All Implemented Interfaces:
Serializable,Comparable<PowerAuthSignatureFormat>,Constable
Enum with signature format types.
-
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 TypeMethodDescriptionbooleanequalsName(String otherName) Compare enumeration to another string.static PowerAuthSignatureFormatgetEnumFromString(String value) Converts string intoPowerAuthSignatureFormatenumeration.static PowerAuthSignatureFormatgetFormatForSignatureVersion(String signatureVersion) Get signature format for signature version.static PowerAuthSignatureFormatReturns the enum constant of this class with the specified name.static PowerAuthSignatureFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DECIMAL
Each signature's factor is represented by one decimal, zero-padded, 8-digit long number. If the final signature is composed from more than one factor, then the dash character"-"is the separator between the factors. For example:- One factor:
88457234 - Two factors:
88457234-00630125
This type of formatting is currently used in the following scenarios:
- For legacy
3.0version of online signatures. - For all versions of offline signatures.
- One factor:
-
BASE64
Each signature's factor is represented by 16-bytes long binary data. If the signature is composed from more than one factor, then the binary sequences are concatenated one after another. The whole signature is then represented as one Base64 string with"="as a padding character. For example:- One factor:
MDEyMzQ1Njc4OWFiY2RlZg== - Two factors:
MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=
3.1version of online signatures and newer. - One factor:
-
-
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
-
getFormatForSignatureVersion
public static PowerAuthSignatureFormat getFormatForSignatureVersion(String signatureVersion) throws GenericCryptoException Get signature format for signature version.- Parameters:
signatureVersion- Signature version to be calculated, or validated.- Returns:
- Signature format for given version.
- Throws:
GenericCryptoException- In case that null or unknown format is provided.
-
getEnumFromString
Converts string intoPowerAuthSignatureFormatenumeration. Function returnsnullin case that such conversion is not possible.You can use
Enum.toString()function as opposite, to convert enumeration into its string representation.- Parameters:
value- String representation of the enumeration.- Returns:
PowerAuthSignatureFormatenumeration ornullif the conversion is not possible.
-
equalsName
Compare enumeration to another string.- Parameters:
otherName- Other string to compare- Returns:
trueif other string is equal to this enumeration's string representation.
-