public final class JWK extends Object implements Crypto
ECDSA_ALGORITHMS| Constructor and Description |
|---|
JWK(JsonObject json) |
JWK(String algorithm,
boolean isCertificate,
String pemPub,
String pemSec)
Creates a Key(Pair) from pem formatted strings.
|
JWK(String algorithm,
String hmac)
Creates a Symmetric Key from a base64 encoded string.
|
JWK(String algorithm,
String pemPub,
String pemSec)
Creates a Key(Pair) from pem formatted strings.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] payload) |
byte[] |
encrypt(byte[] payload) |
String |
getAlgorithm() |
String |
getId() |
byte[] |
sign(byte[] payload) |
boolean |
verify(byte[] expected,
byte[] payload) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitECDSALength, isECDSApublic JWK(String algorithm, String pemPub, String pemSec)
algorithm - the algorithm e.g.: RS256pemPub - the public key in PEM formatpemSec - the private key in PEM formatpublic JWK(String algorithm, boolean isCertificate, String pemPub, String pemSec)
algorithm - the algorithm e.g.: RS256isCertificate - when true the public PEM is assumed to be a X509 CertificatepemPub - the public key in PEM formatpemSec - the private key in PEM formatpublic JWK(String algorithm, String hmac)
algorithm - the algorithm e.g.: HS256hmac - the symmetric keypublic JWK(JsonObject json)
public String getAlgorithm()
public byte[] encrypt(byte[] payload)
public byte[] decrypt(byte[] payload)
Copyright © 2018 Eclipse. All rights reserved.