JwtHelper

object JwtHelper

Functions

Link copied to clipboard
fun convertJwtToJwtContext(raw: String): JwtContext
Link copied to clipboard
fun convertJwtToPayloadString(raw: String): String
Link copied to clipboard
fun createRootCert(    keyPair: KeyPair,     issuer: String = "cn=ComunyAndroidCert",     nbf: Date = Date(System.currentTimeMillis() - notBeforeOffset),     exp: Date = Date(System.currentTimeMillis() + notAfterOffset),     subject: String = issuer): X509Certificate

Generate a root certificate for the given key pair.

Link copied to clipboard
fun sign(payload: String, keyPair: KeyPair = KeyPairGenerator.getInstance("RSA").genKeyPair()): String

Creates signed JsonWebSignature in compact serialization format. Algorithm used is RS256, public key / certificates is stored in x5c.