Examples of HmacSHA256Signer


Examples of net.oauth.jsontoken.crypto.HmacSHA256Signer

   * @throws InvalidKeyException
   * @throws SignatureException
   */
  public static String generate(JWTInterface target) throws InvalidKeyException, SignatureException{
    Calendar cal = Calendar.getInstance();
    HmacSHA256Signer signer = new HmacSHA256Signer(target.getIssuer(), null, target.getMerchantSecret().getBytes());
   
    JsonToken token = new JsonToken(signer);
    token.setAudience(target.getAudience());
    token.setParam("typ", target.getType());
    token.setIssuedAt(target.getIat() != null ? new Instant(target.getIat()) : new Instant(cal.getTimeInMillis()));
View Full Code Here

Examples of net.oauth.jsontoken.crypto.HmacSHA256Signer

    Step step = MiniProfiler.step("API.createToken");
    try {

      // Current time and signing algorithm
      final Calendar cal = Calendar.getInstance();
      final HmacSHA256Signer signer = new HmacSHA256Signer(ISSUER, null,
          SIGNING_KEY.getBytes());

      // Configure JSON token
      final JsonToken token = new JsonToken(signer);
      token.setAudience("Google");
View Full Code Here

Examples of net.oauth.jsontoken.crypto.HmacSHA256Signer

    private JsonToken mToken;

    public JWTAuthToken(String networkName, String networkSecret,
            String userId, String displayName, double expires)
            throws InvalidKeyException {
        HmacSHA256Signer signer = new HmacSHA256Signer(null, null,
                networkSecret.getBytes());
        mToken = new JsonToken(signer);
        JsonObject tokenJSON = mToken.getPayloadAsJsonObject();
        tokenJSON.addProperty("domain", networkName);
        tokenJSON.addProperty("user_id", userId);
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.