Verification
Verifier
Usage examples
KeyStore keystore = keystore("classpath:keystore.p12", "password".toCharArray(), "PKCS12");
PublicKey publicKey = publicKey(keystore, "alice");
Verifier verifier = verifierBuilder()
.key(publicKey)
.algorithm("SHA512withRSA")
.build();
// raw bytes + raw bytes → boolean
boolean ok = verifier.verify(
Bytes.from("Hello Bob".getBytes(UTF_8)),
rawSignature);
// UTF-8 text + BASE64 signature → boolean
boolean ok2 = verifier.verify(
Bytes.from("Hello Bob"),
Bytes.from(base64Signature, BASE64));
// UTF-8 text + HEX signature → boolean
boolean ok3 = verifier.verify(
Bytes.from("Hello Bob"),
Bytes.from(hexSignature, HEX));
// ISO-8859-1 text + BASE64 signature → boolean
boolean ok4 = verifier.verify(
Bytes.from("Hello Bob", ISO_8859_1),
Bytes.from(base64Signature, BASE64));Builder options
Interface
Verifier by Key
Usage examples
Interface
Last updated
Was this helpful?