Package com.nimbusds.jose

Examples of com.nimbusds.jose.JWSObject.verify()


    // Initialise verifier
    BigInteger x = publicKey.getW().getAffineX();
    BigInteger y = publicKey.getW().getAffineY();
    JWSVerifier verifier = new ECDSAVerifier(x, y);

    boolean verified = jwsObject.verify(verifier);

    assertTrue("EC512 signature verified", verified);
  }

View Full Code Here


    BigInteger x = publicKey.getW().getAffineX();
    BigInteger y = publicKey.getW().getAffineY();
    JWSVerifier verifier = new ECDSAVerifier(x, y);
    verifier.getIgnoredCriticalHeaderParameters().add("exp");

    boolean verified = jwsObject.verify(verifier);

    assertTrue("Verified signature", verified);

    assertEquals("State check", JWSObject.State.VERIFIED, jwsObject.getState());
  }
View Full Code Here

    BigInteger x = publicKey.getW().getAffineX();
    BigInteger y = publicKey.getW().getAffineY();
    JWSVerifier verifier = new ECDSAVerifier(x, y);

    boolean verified = jwsObject.verify(verifier);

    assertFalse("Verified signature", verified);

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());
  }
View Full Code Here


    RSASSAVerifier verifier = new RSASSAVerifier(PUBLIC_KEY);
    assertNotNull("Public key check", verifier.getPublicKey());

    boolean verified = jwsObject.verify(verifier);

    assertTrue("Verified signature", verified);

    assertEquals("State check", JWSObject.State.VERIFIED, jwsObject.getState());
  }
View Full Code Here

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());

    JWSVerifier verifier = new RSASSAVerifier(PUBLIC_KEY);

    boolean verified = jwsObject.verify(verifier);

    assertTrue("Signature check", verified);

    assertEquals("State check", JWSObject.State.VERIFIED, jwsObject.getState());
  }
View Full Code Here

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());

    JWSVerifier verifier = new RSASSAVerifier(PUBLIC_KEY);

    boolean verified = jwsObject.verify(verifier);

    assertFalse("Signature check", verified);
  }

View Full Code Here

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());

    JWSVerifier verifier = new RSASSAVerifier(PUBLIC_KEY);

    boolean verified = jwsObject.verify(verifier);

    assertFalse("Signature check", verified);
  }

View Full Code Here

    jwsObject.sign(signer);

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());

    assertTrue("Verify signature", jwsObject.verify(verifier));

    assertEquals("State check", JWSObject.State.VERIFIED, jwsObject.getState());

    // Verify from serialised and then parsed JWS
    jwsObject = JWSObject.parse(jwsObject.serialize());
View Full Code Here

    // Verify from serialised and then parsed JWS
    jwsObject = JWSObject.parse(jwsObject.serialize());

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());

    assertTrue("Verify signature", jwsObject.verify(verifier));

    assertEquals("State check", JWSObject.State.VERIFIED, jwsObject.getState());
  }

View Full Code Here

    // To parse the JWS and verify it, e.g. on client-side
    jwsObject = JWSObject.parse(s);

    JWSVerifier verifier = new RSASSAVerifier(publicKey);

    assertTrue(jwsObject.verify(verifier));

    assertEquals("In RSA we trust!", jwsObject.getPayload().toString());
  }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.