001package com.nimbusds.jose; 002 003 004import com.nimbusds.jose.util.Base64URL; 005 006 007/** 008 * Interface for signing JSON Web Signature (JWS) objects. 009 * 010 * <p>Callers can query the signer to determine its algorithm capabilities. 011 * 012 * @author Vladimir Dzhuvinov 013 * @version $version$ (2014-07-08) 014 */ 015public interface JWSSigner extends JWSAlgorithmProvider { 016 017 018 /** 019 * Signs the specified {@link JWSObject#getSigningInput input} of a 020 * {@link JWSObject JWS object}. 021 * 022 * @param header The JSON Web Signature (JWS) header. Must 023 * specify a supported JWS algorithm and must not 024 * be {@code null}. 025 * @param signingInput The input to sign. Must not be {@code null}. 026 * 027 * @return The resulting signature part (third part) of the JWS object. 028 * 029 * @throws JOSEException If the JWS algorithm is not supported or if 030 * signing failed for some other reason. 031 */ 032 public Base64URL sign(final JWSHeader header, final byte[] signingInput) 033 throws JOSEException; 034}