Class SimpleKeyInfoReferenceEncryptedKeyResolverTest
java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.encryption.support.tests.SimpleKeyInfoReferenceEncryptedKeyResolverTest
public class SimpleKeyInfoReferenceEncryptedKeyResolverTest
extends org.opensaml.core.testing.XMLObjectBaseTestCase
Test the encrypted key resolver which dereferences KeyInfoReferences.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe resolver instance to be tested.Fields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<EncryptedKey>generateList(EncryptedData encData, EncryptedKeyResolver ekResolver, Set<String> recipients) Resolve EncryptedKeys and put them in an ordered list.private List<EncryptedKey>Extract all the EncryptedKey's from the SimpleXMLObject.voidOne recipient specified to resolver, three EncryptedKeys in instance, two KeyInfoReference references.voidTwo recipients specified to resolver, three EncryptedKeys in instance, two RetrievalMethod references.voidMulti recipient specified to resolver via ctor and method args.voidNo recipients specified to resolver, one EncryptedKey in instance.voidOne recipient specified to resolver, one EncryptedKey in instance.Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElementMethods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
Field Details
-
resolver
The resolver instance to be tested.
-
-
Constructor Details
-
SimpleKeyInfoReferenceEncryptedKeyResolverTest
public SimpleKeyInfoReferenceEncryptedKeyResolverTest()
-
-
Method Details
-
testSingleEKNoRecipient
public void testSingleEKNoRecipient()No recipients specified to resolver, one EncryptedKey in instance. -
testSingleEKWithRecipient
public void testSingleEKWithRecipient()One recipient specified to resolver, one EncryptedKey in instance. -
testMultiEKWithOneRecipient
public void testMultiEKWithOneRecipient()One recipient specified to resolver, three EncryptedKeys in instance, two KeyInfoReference references. -
testMultiEKWithTwoRecipients
public void testMultiEKWithTwoRecipients()Two recipients specified to resolver, three EncryptedKeys in instance, two RetrievalMethod references. -
testMultiRecipientsCtorAndArgs
public void testMultiRecipientsCtorAndArgs()Multi recipient specified to resolver via ctor and method args. -
getEncryptedKeys
Extract all the EncryptedKey's from the SimpleXMLObject.- Parameters:
sxo- the mock object to process- Returns:
- a list of EncryptedKey elements
-
generateList
@Nonnull private List<EncryptedKey> generateList(@Nonnull EncryptedData encData, @Nonnull EncryptedKeyResolver ekResolver, @Nullable Set<String> recipients) Resolve EncryptedKeys and put them in an ordered list.- Parameters:
encData- the EncryptedData contextekResolver- the resolver to testrecipients- the valid recipients for resolution- Returns:
- list of resolved EncryptedKeys
-