cgoldammer / cryptobits

Simple crypto for signing auth tokens.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

About

Simple crypto for signing auth tokens.

License:MIT License


Languages

Language:Scala 100.0%