Home

Awesome

Branca

Branca is a secure alternative to JWT, This implementation is written in Kotlin and implements the branca token specification.

Original Java implementation: jbranca

Install

repositories {
    // ...
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation "com.github.petersamokhin:kbranca:$kbrancaVersion"
}

Latest version: https://github.com/petersamokhin/kbranca/releases/latest

Example

val key = "SecretKeyYouShouldNeverCommit!!!" // exactly 32 chars

val factory = BrancaTokenFactory(key)
val plaintext = """{"key": "example_value"}"""
val encoded = factory.encode(plaintext.toByteArray())
val decoded = factory.decode(encoded)
assertEquals(plaintext, String(decoded))

3rd party