class JWK : Crypto
JWK https://tools.ietf.org/html/rfc7517 In a nutshell a JWK is a Key(Pair) encoded as JSON. This implementation follows the spec with some limitations: * Supported algorithms are: "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512" The rationale for this choice is to support the required algorithms for JWT. The constructor takes a single JWK (the the KeySet) or a PEM encoded pair (used by Google and useful for importing standard PEM files from OpenSSL). * Certificate chains (x5c) only allow a single element chain, certificate urls and fingerprints are not considered.
Author
Paulo Lopes
JWK(algorithm: String, pemPub: String, pemSec: String)JWK(algorithm: String, isCertificate: Boolean, pemPub: String, pemSec: String)
Creates a Key(Pair) from pem formatted strings. JWK(algorithm: String, hmac: String)
Creates a Symmetric Key from a base64 encoded string. JWK(json: JsonObject) |
fun decrypt(payload: ByteArray): ByteArray |
|
fun encrypt(payload: ByteArray): ByteArray |
|
fun getAlgorithm(): String |
|
fun getId(): String |
|
fun sign(payload: ByteArray): ByteArray |
|
fun verify(expected: ByteArray, payload: ByteArray): Boolean |