Class DefaultEncryptionParametersResolverTest
- java.lang.Object
-
- net.shibboleth.oidc.security.jose.impl.DefaultEncryptionParametersResolverTest
-
public class DefaultEncryptionParametersResolverTest extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDefaultEncryptionParametersResolverTest.MockStaticCriteriaFilteringCredentialResolver_WrongKeyTypeMock static credential resolver that builds the wrong type of credential for encryption.private static classDefaultEncryptionParametersResolverTest.MockStaticFilteringCredentialResolverMock static credential resolver.
-
Field Summary
Fields Modifier and Type Field Description private net.shibboleth.oidc.security.jose.impl.BasicEncryptionConfigurationconfigprivate net.shibboleth.oidc.security.jose.impl.DefaultEncryptionParametersResolverresolverprivate static StringSYMMETRIC_KEYThe mock symmetric key e.g.
-
Constructor Summary
Constructors Constructor Description DefaultEncryptionParametersResolverTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private CriteriaSetbuildBasicCriteriaSet()private CriteriaSetbuildBasicCriteriaSet(boolean addDataEncryptionAlgs)voidsetUp()voidtestBasicAESKeyWrap()voidtestBasicAESKeyWrap_KeyWrapKeySizeDifferentThanEncryptionMethod()The resolver only needs to resolve key wrapping credentials compatible with the key wrapping algorithm.voidtestBasicAESKeyWrap_WrongKeyAndUsageType()voidtestBasicAESKeyWrap_WrongKeyLength()voidtestBasicAESKeyWrapWhenRSAKeyAlsoExists()voidtestBasicAESKeyWrapWhenRSAKeyAlsoExists_CheckOrderingIsPreserved()voidtestBasicAESKeyWrapWhenRSAKeyAlsoExists_CheckOrderingIsPreserved_RSAFirst()voidtestBasicDirectEncryption()voidtestBasicEC()voidtestBasicRSA()voidtestBasicRSA_NoAlgorithmSpecifiedInJWKCredential()voidtestBasicRSA_noDataEncryptionAlgs()voidtestBasicRSA_WrongAlgorithmInConfig()voidtestBasicRSA_WrongAlgorithmInFirstKey_ChooseSecondKey()
-
-
-
Field Detail
-
SYMMETRIC_KEY
private static final String SYMMETRIC_KEY
The mock symmetric key e.g. for keywrap.- See Also:
- Constant Field Values
-
resolver
private net.shibboleth.oidc.security.jose.impl.DefaultEncryptionParametersResolver resolver
-
config
private net.shibboleth.oidc.security.jose.impl.BasicEncryptionConfiguration config
-
-
Method Detail
-
setUp
@BeforeMethod public void setUp()
-
buildBasicCriteriaSet
private CriteriaSet buildBasicCriteriaSet() throws Exception
- Throws:
Exception
-
buildBasicCriteriaSet
private CriteriaSet buildBasicCriteriaSet(boolean addDataEncryptionAlgs) throws Exception
- Throws:
Exception
-
testBasicRSA_noDataEncryptionAlgs
public void testBasicRSA_noDataEncryptionAlgs() throws Exception- Throws:
Exception
-
testBasicRSA_WrongAlgorithmInConfig
public void testBasicRSA_WrongAlgorithmInConfig() throws Exception- Throws:
Exception
-
testBasicRSA_NoAlgorithmSpecifiedInJWKCredential
public void testBasicRSA_NoAlgorithmSpecifiedInJWKCredential() throws Exception- Throws:
Exception
-
testBasicRSA_WrongAlgorithmInFirstKey_ChooseSecondKey
public void testBasicRSA_WrongAlgorithmInFirstKey_ChooseSecondKey() throws Exception- Throws:
Exception
-
testBasicAESKeyWrap_KeyWrapKeySizeDifferentThanEncryptionMethod
public void testBasicAESKeyWrap_KeyWrapKeySizeDifferentThanEncryptionMethod() throws ExceptionThe resolver only needs to resolve key wrapping credentials compatible with the key wrapping algorithm. It should not matter what the encryption method use is e.g. 192bit key for KW, and 256 bit key used for encryption, we only need to check the key for KW.- Throws:
Exception- on error
-
testBasicAESKeyWrap_WrongKeyLength
public void testBasicAESKeyWrap_WrongKeyLength() throws Exception- Throws:
Exception
-
testBasicAESKeyWrapWhenRSAKeyAlsoExists
public void testBasicAESKeyWrapWhenRSAKeyAlsoExists() throws Exception- Throws:
Exception
-
testBasicAESKeyWrapWhenRSAKeyAlsoExists_CheckOrderingIsPreserved
public void testBasicAESKeyWrapWhenRSAKeyAlsoExists_CheckOrderingIsPreserved() throws Exception- Throws:
Exception
-
testBasicAESKeyWrapWhenRSAKeyAlsoExists_CheckOrderingIsPreserved_RSAFirst
public void testBasicAESKeyWrapWhenRSAKeyAlsoExists_CheckOrderingIsPreserved_RSAFirst() throws Exception- Throws:
Exception
-
testBasicAESKeyWrap_WrongKeyAndUsageType
public void testBasicAESKeyWrap_WrongKeyAndUsageType() throws Exception- Throws:
Exception
-
-