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 Show documentation
Show all versions of java-jwt Show documentation
Java implementation of JSON Web Token (JWT)
package com.auth0.jwt.algorithms;
import com.auth0.jwt.exceptions.SignatureGenerationException;
import com.auth0.jwt.exceptions.SignatureVerificationException;
class NoneAlgorithm extends Algorithm {
NoneAlgorithm() {
super("none", "none");
}
@Override
public void verify(byte[] contentBytes, byte[] signatureBytes) throws SignatureVerificationException {
if (signatureBytes.length > 0) {
throw new SignatureVerificationException(this);
}
}
@Override
public byte[] sign(byte[] contentBytes) throws SignatureGenerationException {
return new byte[0];
}
}