All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.simter.jwt.signer.NONE Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package tech.simter.jwt.signer;

import tech.simter.jwt.Signer;

import java.nio.charset.StandardCharsets;

/**
 * The None Signature.
 *
 * @author RJ
 * @since JDK1.8
 */
public final class NONE implements Signer {
  private static final byte[] EMPTY = "".getBytes(StandardCharsets.UTF_8);

  @Override
  public byte[] sign(byte[] data, byte[] key) {
    // https://tools.ietf.org/html/rfc7519#section-6 Unsecured JWTs:
    // An Unsecured JWT is a JWS using the "alg" Header Parameter value "none"
    // and with the empty string for its JWS Signature value.
    return EMPTY;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy