001package com.nimbusds.oauth2.sdk.jose.jwk;
002
003
004import com.nimbusds.oauth2.sdk.id.Identifier;
005import net.jcip.annotations.ThreadSafe;
006
007
008/**
009 * Abstract JSON Web Key (JWK) selector.
010 */
011@ThreadSafe
012public abstract class AbstractJWKSelector {
013
014
015        /**
016         * Identifier for the JWK selector.
017         */
018        private final Identifier id;
019
020
021        /**
022         * Creates a new abstract JWK selector.
023         *
024         * @param id Identifier for the JWK selector. Must not be {@code null}.
025         */
026        public AbstractJWKSelector(final Identifier id) {
027                if (id == null) {
028                        throw new IllegalArgumentException("The identifier must not be null");
029                }
030                this.id = id;
031        }
032
033
034        /**
035         * Returns the the identifier for the JWK selector.
036         *
037         * @return The identifier.
038         */
039        public Identifier getIdentifier() {
040                return id;
041        }
042}