JwtCryptoBackend

zio.blocks.jwt.JwtCryptoBackend

Platform-specific cryptographic operations for JWT.

Call install() on a platform backend (e.g. JvmJwtCryptoBackend.install()) before signing or verifying tokens. The default backend (the built-in shared backend) supports HMAC-SHA2 algorithms only and requires no native dependencies.

Attributes

Source
Jwt.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def sign(data: Array[Byte], key: Array[Byte], alg: Algorithm): Either[JwtError, Array[Byte]]

Computes the JWT signature over data with key using alg.

Computes the JWT signature over data with key using alg.

Attributes

Source
Jwt.scala

The set of algorithms this backend supports. Calling sign/verify with an unsupported algorithm returns UnsupportedAlgorithm.

The set of algorithms this backend supports. Calling sign/verify with an unsupported algorithm returns UnsupportedAlgorithm.

Attributes

Source
Jwt.scala
def verify(data: Array[Byte], signature: Array[Byte], key: Array[Byte], alg: Algorithm): Either[JwtError, Boolean]

Verifies that signature over data is valid for key and alg.

Verifies that signature over data is valid for key and alg.

Attributes

Source
Jwt.scala