Package com.nimbusds.jose

Examples of com.nimbusds.jose.JWSSigner


    // Creates initial unsigned JWS object
    JWSObject jwsObject = createInitialJWSObject(JWSAlgorithm.ES512);

    // Initialise signer
    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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


    ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey privateKey = (ECPrivateKey) keyPair.getPrivate();

    JWSObject jwsObject = new JWSObject(header, new Payload("Hello world!"));

    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

    ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey privateKey = (ECPrivateKey) keyPair.getPrivate();

    JWSObject jwsObject = new JWSObject(header, new Payload("Hello world!"));

    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

    claim.setSubject(Long.toString(sub));
    claim.setIssuer(host);
    claim.setIssueTime(DateTime.now().toDate());
    claim.setExpirationTime(DateTime.now().plusDays(14).toDate());
   
    JWSSigner signer = new MACSigner(TOKEN_SECRET);
    SignedJWT jwt = new SignedJWT(JWT_HEADER, claim);
    jwt.sign(signer);
   
    return new Token(jwt.serialize());
  }
View Full Code Here

    // Create HMAC signer
    String sharedKey = "a0a2abd8-6162-41c3-83d6-1cf559b46afc";
   
    System.out.println("HMAC key: " + sharedKey);
   
    JWSSigner signer = new MACSigner(sharedKey.getBytes());
   
    try {
      jwsObject.sign(signer);
     
    } catch (JOSEException e) {
View Full Code Here

    // Creates initial unsigned JWS object
    JWSObject jwsObject = createInitialJWSObject(JWSAlgorithm.ES256);

    // Initialise signer
    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

    // Creates initial unsigned JWS object
    JWSObject jwsObject = createInitialJWSObject(JWSAlgorithm.ES384);

    // Initialise signer
    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

    // Creates initial unsigned JWS object
    JWSObject jwsObject = createInitialJWSObject(JWSAlgorithm.ES512);

    // Initialise signer
    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

    ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey privateKey = (ECPrivateKey) keyPair.getPrivate();

    JWSObject jwsObject = new JWSObject(header, new Payload("Hello world!"));

    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

    ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey privateKey = (ECPrivateKey) keyPair.getPrivate();

    JWSObject jwsObject = new JWSObject(header, new Payload("Hello world!"));

    JWSSigner signer = new ECDSASigner(privateKey.getS());

    jwsObject.sign(signer);

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

TOP

Related Classes of com.nimbusds.jose.JWSSigner

Copyright © 2018 www.massapicom. 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.