![JAR search and dependency download from the Maven repository](/logo.png)
com.auth0.jwt.algorithms.NoneAlgorithm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-jwt-nodependencies Show documentation
Show all versions of java-jwt-nodependencies Show documentation
This is a drop in replacement for the auth0 java-jwt library (see https://github.com/auth0/java-jwt). This jar makes sure there are no external dependencies (e.g. fasterXml, Apacha Commons) needed. This is useful when deploying to an application server (e.g. tomcat with Alfreso or Pega).
The newest version!
package com.auth0.jwt.algorithms;
import com.auth0.jwt.exceptions.SignatureGenerationException;
import com.auth0.jwt.exceptions.SignatureVerificationException;
import com.auth0.jwt.interfaces.DecodedJWT;
import org.apache.commons.codec.binary.Base64;
class NoneAlgorithm extends Algorithm {
NoneAlgorithm() {
super("none", "none");
}
@Override
public void verify(DecodedJWT jwt) throws SignatureVerificationException {
byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());
if (signatureBytes.length > 0) {
throw new SignatureVerificationException(this);
}
}
@Override
public byte[] sign(byte[] contentBytes) throws SignatureGenerationException {
return new byte[0];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy