Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 378 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 378 Bytes

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)