35 PrivateKey privateKey;
37 privateKey = PemUtils.decodePrivateKey(privateKeyPem);
38 }
catch (Exception e) {
39 throw new VerificationException(
"Failed to decode private key");
44 publicKey = PemUtils.decodePublicKey(publicKeyPem);
45 }
catch (Exception e) {
46 throw new VerificationException(
"Failed to decode public key");
50 String jws =
new JWSBuilder().content(
"content".getBytes()).rsa256(privateKey);
51 if (!RSAProvider.verify(
new JWSInput(jws), publicKey)) {
52 throw new VerificationException(
"Keys don't match");
54 }
catch (Exception e) {
55 throw new VerificationException(
"Keys don't match");