MCPcopy Index your code
hub / github.com/auth0/java-jwt / NoneAlgorithm

Class NoneAlgorithm

lib/src/main/java/com/auth0/jwt/algorithms/NoneAlgorithm.java:8–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import java.util.Base64;
7
8class NoneAlgorithm extends Algorithm {
9
10 NoneAlgorithm() {
11 super("none", "none");
12 }
13
14 @Override
15 public void verify(DecodedJWT jwt) throws SignatureVerificationException {
16 try {
17 byte[] signatureBytes = Base64.getUrlDecoder().decode(jwt.getSignature());
18
19 if (signatureBytes.length > 0) {
20 throw new SignatureVerificationException(this);
21 }
22 } catch (IllegalArgumentException e) {
23 throw new SignatureVerificationException(this, e);
24 }
25 }
26
27 @Override
28 public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {
29 return new byte[0];
30 }
31
32 @Override
33 public byte[] sign(byte[] contentBytes) throws SignatureGenerationException {
34 return new byte[0];
35 }
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…