001package com.nimbusds.jose.mint;
002
003import com.nimbusds.jose.JWSSigner;
004import com.nimbusds.jose.jwk.source.JWKSource;
005import com.nimbusds.jose.proc.SecurityContext;
006import com.nimbusds.jose.produce.JWSSignerFactory;
007
008/**
009 * JSON Web Signature (JWS) minter configuration.
010 *
011 * <p>Specifies the required components to mint JWS objects:
012 *
013 * <ul>
014 *     <li>JWK source to determine key candidate(s) for the JWS based on the
015 *     JWS header and application-specific context information.
016 *
017 *     <li>Optional JWS signer factory. Creates the appropriate
018 *     {@link com.nimbusds.jose.JWSSigner} for signing the object.
019 * </ul>
020 *
021 * @author Josh Cummings
022 * @version 2021-01-14
023 */
024public interface JWSMinterConfiguration<C extends SecurityContext> {
025        
026        /**
027         * Gets the source for looking up JWKs.
028         *
029         * @return The {@link JWKSource} in use.
030         */
031        JWKSource<C> getJWKSource();
032
033        
034        /**
035         * Sets the source for to look up JWKs from.
036         *
037         * @param jwkSource The JWK source to use.
038         */
039        void setJWKSource(final JWKSource<C> jwkSource);
040
041        
042        /**
043         * Gets the factory for generating {@link JWSSigner}s.
044         *
045         * @return The {@link JWSSignerFactory} in use.
046         */
047        JWSSignerFactory getJWSSignerFactory();
048
049        
050        /**
051         * Sets the factory for generating {@link JWSSigner}s.
052         *
053         * @param jwsSignerFactory The JWS signer factory to use.
054         */
055        void setJWSSignerFactory(final JWSSignerFactory jwsSignerFactory);
056}