reactormonk / cryptobits   1.3

MIT License GitHub

Simple crypto for signing auth tokens.

Scala versions: 2.13 2.12 2.11 2.10

crypto-bits

Simple crypto for signing auth tokens.

Sample usage

val key = PrivateKey(scala.io.Codec.toUTF8(string))
val crypto = CryptoBits(key)
val clock = Clock.systemUTC()
// or anything else for the nonce, should be something different each time.
val signed = crypto.signToken(message, clock.millis.toString)
val data = crypto.validateSignedToken(signed)