o

pdi.jwt

JwtUtils

object JwtUtils

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JwtUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val ECDSA: String
  5. val ENCODING: String
  6. val EdDSA: String
  7. val RSA: String
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def bytify(str: String): Array[Byte]

    Convert a string to its corresponding array of bytes using the default encoding.

    Convert a string to its corresponding array of bytes using the default encoding.

    str

    the string to convert

    returns

    the final array of bytes

  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  14. def getSignatureByteArrayLength(algorithm: JwtECDSAAlgorithm): Int

    Returns the expected signature byte array length (R + S parts) for the specified ECDSA algorithm.

    Returns the expected signature byte array length (R + S parts) for the specified ECDSA algorithm.

    algorithm

    The ECDSA algorithm. Must be supported and not null .

    returns

    The expected byte array length for the signature.

  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. def hashToJson(hash: Seq[(String, Any)]): String

    Convert a sequence of tuples to a JSON object

  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def mergeJson(json: String, jsonSeq: String*): String

    Merge multiple JSON strings to a unique one

  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  22. def seqToJson(seq: Seq[Any]): String

    Convert a sequence to a JSON array

  23. def sign(data: String, key: String, algorithm: JwtAlgorithm): Array[Byte]

    Alias to sign using a String data which will be converted to an array of bytes.

  24. def sign(data: Array[Byte], key: String, algorithm: JwtAlgorithm): Array[Byte]

    Will try to sign some given data by parsing the provided key, if parsing fail, please consider retrieving the SecretKey or the PrivateKey on your side and then use another "sign" method.

  25. def sign(data: String, key: PrivateKey, algorithm: JwtAsymmetricAlgorithm): Array[Byte]
  26. def sign(data: Array[Byte], key: PrivateKey, algorithm: JwtAsymmetricAlgorithm): Array[Byte]

    Generate the signature for a given data using the key and RSA or ECDSA algorithm provided.

  27. def sign(data: String, key: SecretKey, algorithm: JwtHmacAlgorithm): Array[Byte]
  28. def sign(data: Array[Byte], key: SecretKey, algorithm: JwtHmacAlgorithm): Array[Byte]

    Generate the signature for a given data using the key and HMAC algorithm provided.

  29. def splitString(input: String, separator: Char): Array[String]
  30. def stringify(arr: Array[Byte]): String

    Convert an array of bytes to its corresponding string using the default encoding.

    Convert an array of bytes to its corresponding string using the default encoding.

    arr

    the array of bytes to transform

    returns

    the final string

  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. def transcodeSignatureToConcat(derSignature: Array[Byte], outputLength: Int): Array[Byte]

    Transcodes the JCA ASN.1/DER-encoded signature into the concatenated R + S format expected by ECDSA JWS.

    Transcodes the JCA ASN.1/DER-encoded signature into the concatenated R + S format expected by ECDSA JWS.

    derSignature

    The ASN1./DER-encoded. Must not be null .

    outputLength

    The expected length of the ECDSA JWS signature.

    returns

    The ECDSA JWS encoded signature.

    Annotations
    @throws(scala.this.throws.<init>$default$1[pdi.jwt.exceptions.JwtSignatureFormatException])
    Exceptions thrown

    JwtSignatureFormatException If the ASN.1/DER signature format is invalid.

  34. def transcodeSignatureToDER(signature: Array[Byte]): Array[Byte]

    Transcodes the ECDSA JWS signature into ASN.1/DER format for use by the JCA verifier.

    Transcodes the ECDSA JWS signature into ASN.1/DER format for use by the JCA verifier.

    signature

    The JWS signature, consisting of the concatenated R and S values. Must not be null .

    returns

    The ASN.1/DER encoded signature.

    Annotations
    @throws(scala.this.throws.<init>$default$1[pdi.jwt.exceptions.JwtSignatureFormatException])
    Exceptions thrown

    JwtSignatureFormatException If the ECDSA JWS signature format is invalid.

  35. def verify(data: String, signature: String, key: String, algorithm: JwtAlgorithm): Boolean

    Alias for verify

  36. def verify(data: Array[Byte], signature: Array[Byte], key: String, algorithm: JwtAlgorithm): Boolean

    Will try to check if a signature is valid for a given data by parsing the provided key, if parsing fail, please consider retrieving the SecretKey or the PublicKey on your side and then use another "verify" method.

  37. def verify(data: Array[Byte], signature: Array[Byte], key: PublicKey, algorithm: JwtAsymmetricAlgorithm): Boolean

    Check if a signature is valid for a given data using the key and the RSA or ECDSA algorithm provided.

  38. def verify(data: Array[Byte], signature: Array[Byte], key: SecretKey, algorithm: JwtHmacAlgorithm): Boolean

    Check if a signature is valid for a given data using the key and the HMAC algorithm provided.

  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped