Examples of JWSHeader


Examples of com.nimbusds.jose.JWSHeader

    throws Exception {

    JWTClaimsSet claimsSet = new JWTClaimsSet();
    claimsSet.setIssuer("https://c2id.com");

    SignedJWT jwt = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet);
    jwt.sign(new MACSigner("abcdef1234567890"));

    OIDCClientMetadata metadata = new OIDCClientMetadata();
    metadata.setRedirectionURI(new URI("https://client.com/in"));
    metadata.setName("Test App");
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader

    try {
      new OIDCClientRegistrationRequest(
        new URI("https://c2id.com/reg"),
        metadata,
        new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet),
        null);

    } catch (IllegalArgumentException e) {

      // ok
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader


  public void testRejectSoftwareStatementWithoutIssuer()
    throws Exception {

    SignedJWT jwt = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), new JWTClaimsSet());
    jwt.sign(new MACSigner("abcdef1234567890"));

    OIDCClientMetadata metadata = new OIDCClientMetadata();
    metadata.setRedirectionURI(new URI("https://client.com/in"));
    metadata.setName("Test App");
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader

    throws Exception {

    JWTClaimsSet claimsSet = new JWTClaimsSet();
    claimsSet.setIssuer("https://c2id.com");

    SignedJWT jwt = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet);
    jwt.sign(new MACSigner("abcdef1234567890"));

    ClientMetadata metadata = new ClientMetadata();
    metadata.setRedirectionURI(new URI("https://client.com/in"));
    metadata.setName("Test App");
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader

    try {
      new ClientRegistrationRequest(
        new URI("https://c2id.com/reg"),
        metadata,
        new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet),
        null);

    } catch (IllegalArgumentException e) {

      // ok
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader


  public void testRejectSoftwareStatementWithoutIssuer()
    throws Exception {

    SignedJWT jwt = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), new JWTClaimsSet());
    jwt.sign(new MACSigner("abcdef1234567890"));

    ClientMetadata metadata = new ClientMetadata();
    metadata.setRedirectionURI(new URI("https://client.com/in"));
    metadata.setName("Test App");
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader


  public void testSignWithReadyVector()
    throws Exception {

    JWSHeader header = JWSHeader.parse(B64_HEADER);

    JWSSigner signer = new RSASSASigner(PRIVATE_KEY);

    Base64URL b64sigComputed = signer.sign(header, SIGNABLE);
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader


  public void testVerifyWithReadyVector()
    throws Exception {

    JWSHeader header = JWSHeader.parse(B64_HEADER);

    JWSVerifier verifier = new RSASSAVerifier(PUBLIC_KEY);

    boolean verified = verifier.verify(header, SIGNABLE, B64_SIG);
View Full Code Here

Examples of com.nimbusds.jose.JWSHeader


  public void testSignAndVerifyCycle(final JWSAlgorithm alg, final JWSSigner signer, final JWSVerifier verifier)
    throws Exception {

    JWSHeader header = new JWSHeader(alg);

    JWSObject jwsObject = new JWSObject(header, PAYLOAD);

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

Examples of com.nimbusds.jose.JWSHeader

    // Create RSA-signer with the private key
    JWSSigner signer = new RSASSASigner(privateKey);

    // Prepare JWS object with simple string as payload
    JWSObject jwsObject = new JWSObject(new JWSHeader(JWSAlgorithm.RS256), new Payload("In RSA we trust!"));

    // Compute the RSA signature
    jwsObject.sign(signer);

    assertTrue(jwsObject.getState().equals(JWSObject.State.SIGNED));
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.