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

com.rongjih.jwt.signer.NONE Maven / Gradle / Ivy

The newest version!
package com.rongjih.jwt.signer;

import com.rongjih.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