001package com.nimbusds.openid.connect.provider.spi.tokens; 002 003 004import java.security.SecureRandom; 005import java.util.Properties; 006 007import com.nimbusds.openid.connect.provider.spi.InvocationContext; 008import com.nimbusds.openid.connect.provider.spi.crypto.HMACComputer; 009import com.nimbusds.openid.connect.provider.spi.crypto.JWSVerifier; 010import com.nimbusds.openid.connect.provider.spi.crypto.JWTSigner; 011 012 013/** 014 * Token encoder and decoder context. 015 */ 016public interface TokenCodecContext extends InvocationContext { 017 018 019 /** 020 * Returns an initialised secure random generator. 021 * 022 * @return The secure random generator. 023 */ 024 SecureRandom getSecureRandom(); 025 026 027 /** 028 * Returns the JSON Web Token (JWT) signer. 029 * 030 * @return The JWT signer. 031 */ 032 JWTSigner getJWTSigner(); 033 034 035 /** 036 * Returns the JSON Web Signature (JWS) verifier. 037 * 038 * @return The JWS verifier. 039 */ 040 JWSVerifier getJWSVerifier(); 041 042 043 /** 044 * Returns the Hash-based Message Authentication Code (HMAC) computer. 045 * 046 * @return The HMAC computer. 047 */ 048 HMACComputer getHMACComputer(); 049 050 051 /** 052 * The access token encoder and decoder properties prefix. 053 */ 054 String CODEC_PROPERTIES_PREFIX = "authzStore.accessToken.codec."; 055 056 057 /** 058 * Returns the token encoder and decoder properties, if set in the 059 * Connect2id server configuration with prefix 060 * {@link #CODEC_PROPERTIES_PREFIX authzStore.accessToken.codec.*}. 061 * 062 * @return The properties, empty if none. 063 */ 064 Properties getCodecProperties(); 065}