Search in sources :

Example 11 with JWTVerificationException

use of com.auth0.jwt.exceptions.JWTVerificationException in project open-kilda by telstra.

the class DataSignature method verify.

/**
 * Verify data signature.
 */
public DecodedJWT verify(byte[] payload) throws CorruptedNetworkDataException {
    String payloadStr = new String(payload, Charset.forName("UTF-8"));
    DecodedJWT token;
    try {
        token = signVerification.verify(payloadStr);
    } catch (JWTVerificationException e) {
        throw new CorruptedNetworkDataException(String.format("Bad signature: %s", e));
    }
    return token;
}
Also used : JWTVerificationException(com.auth0.jwt.exceptions.JWTVerificationException) DecodedJWT(com.auth0.jwt.interfaces.DecodedJWT) CorruptedNetworkDataException(org.openkilda.floodlight.error.CorruptedNetworkDataException)

Aggregations

JWTVerificationException (com.auth0.jwt.exceptions.JWTVerificationException)11 DecodedJWT (com.auth0.jwt.interfaces.DecodedJWT)7 Claim (com.auth0.jwt.interfaces.Claim)5 Algorithm (com.auth0.jwt.algorithms.Algorithm)2 IOException (java.io.IOException)2 ByteBuffer (java.nio.ByteBuffer)2 LLDPTLV (net.floodlightcontroller.packet.LLDPTLV)2 OFPort (org.projectfloodlight.openflow.types.OFPort)2 JWTCreator (com.auth0.jwt.JWTCreator)1 JWTVerifier (com.auth0.jwt.JWTVerifier)1 AlgorithmMismatchException (com.auth0.jwt.exceptions.AlgorithmMismatchException)1 InvalidClaimException (com.auth0.jwt.exceptions.InvalidClaimException)1 SignatureVerificationException (com.auth0.jwt.exceptions.SignatureVerificationException)1 TokenExpiredException (com.auth0.jwt.exceptions.TokenExpiredException)1 NullClaim (com.auth0.jwt.impl.NullClaim)1 DecodedGoogleJWTWrapper (com.example.compute.signedmetadata.token.DecodedGoogleJWTWrapper)1 TokenVerifier (com.example.compute.signedmetadata.token.TokenVerifier)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Gson (com.google.gson.Gson)1