001 package com.nimbusds.jose;
002
003
004 import 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$ (2012-10-04)
014 */
015 public interface JWSSigner extends JWSAlgorithmProvider {
016
017
018 /**
019 * Signs the specified {@link JWSObject#getSignableContent signable
020 * content} of a {@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 signableContent The content 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 ReadOnlyJWSHeader header, final byte[] signableContent)
033 throws JOSEException;
034 }