| 6 | import java.util.Base64; |
| 7 | |
| 8 | class 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…