Examples of JWSObject


Examples of com.nimbusds.jose.JWSObject

    JWSHeader header = new JWSHeader(JWSAlgorithm.HS512);
    header.setCustomParameter("exp", "2014-04-24");
    header.setCriticalHeaders(new HashSet<String>(Arrays.asList("exp")));

    JWSObject jwsObject = new JWSObject(header, payload);

    MACSigner signer = new MACSigner(stringSecret);

    jwsObject.sign(signer);

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

    MACVerifier verifier = new MACVerifier(stringSecret);

    boolean verified = jwsObject.verify(verifier);

    assertFalse("Verified signature", verified);

    assertEquals("State check", JWSObject.State.SIGNED, jwsObject.getState());
  }
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.