001package com.nimbusds.jose;
002
003
004import com.nimbusds.jose.util.Base64URL;
005
006
007/**
008 * JSON Web Signature (JWS) verifier.
009 *
010 * @author Vladimir Dzhuvinov
011 * @version 2015-04-21
012 */
013public interface JWSVerifier extends JWSProvider {
014
015
016        /**
017         * Verifies the specified {@link JWSObject#getSignature signature} of a
018         * {@link JWSObject JWS object}.
019         *
020         * @param header       The JSON Web Signature (JWS) header. Must
021         *                     specify a supported JWS algorithm and must not
022         *                     be {@code null}.
023         * @param signingInput The signing input. Must not be {@code null}.
024         * @param signature    The signature part of the JWS object. Must not
025         *                     be {@code null}.
026         *
027         * @return {@code true} if the signature was successfully verified, 
028         *         {@code false} if the signature is invalid or if a critical
029         *         header is neither supported nor marked for deferral to the
030         *         application.
031         *
032         * @throws JOSEException If the JWS algorithm is not supported, or if
033         *                       signature verification failed for some other
034         *                       internal reason.
035         */
036        boolean verify(final JWSHeader header, final byte[] signingInput, final Base64URL signature)
037                throws JOSEException;
038}