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

public enum PowerAuthSignatureFormat extends Enum<PowerAuthSignatureFormat>
Enum with signature format types.
  • Enum Constant Details

    • DECIMAL

      public static final PowerAuthSignatureFormat 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.0 version of online signatures.
      • For all versions of offline signatures.
    • BASE64

      public static final PowerAuthSignatureFormat 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=
      This type of formatting is currently used for 3.1 version of online signatures and newer.
  • Method Details

    • values

      public static PowerAuthSignatureFormat[] 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

      public static PowerAuthSignatureFormat valueOf(String name)
      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 name
      NullPointerException - 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

      public static PowerAuthSignatureFormat getEnumFromString(String value)
      Converts string into PowerAuthSignatureFormat enumeration. Function returns null in 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:
      PowerAuthSignatureFormat enumeration or null if the conversion is not possible.
    • equalsName

      public boolean equalsName(String otherName)
      Compare enumeration to another string.
      Parameters:
      otherName - Other string to compare
      Returns:
      true if other string is equal to this enumeration's string representation.