Class SimpleKeyInfoReferenceEncryptedKeyResolverTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.encryption.support.SimpleKeyInfoReferenceEncryptedKeyResolverTest
-
public class SimpleKeyInfoReferenceEncryptedKeyResolverTest extends XMLObjectBaseTestCase
Test the encrypted key resolver which dereferences KeyInfoReferences.
-
-
Field Summary
Fields Modifier and Type Field Description private SimpleKeyInfoReferenceEncryptedKeyResolverresolverThe resolver instance to be tested.-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description SimpleKeyInfoReferenceEncryptedKeyResolverTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<EncryptedKey>generateList(EncryptedData encData, EncryptedKeyResolver ekResolver)Resolve EncryptedKeys and put them in an ordered list.private List<EncryptedKey>getEncryptedKeys(SignableSimpleXMLObject sxo)Extract all the EncryptedKey's from the SimpleXMLObject.voidtestMultiEKWithOneRecipient()One recipient specified to resolver, three EncryptedKeys in instance, two KeyInfoReference references.voidtestMultiEKWithTwoRecipients()Two recipients specified to resolver, three EncryptedKeys in instance, two RetrievalMethod references.voidtestSingleEKNoRecipient()No recipients specified to resolver, one EncryptedKey in instance.voidtestSingleEKWithRecipient()One recipient specified to resolver, one EncryptedKey in instance.-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
resolver
private SimpleKeyInfoReferenceEncryptedKeyResolver resolver
The resolver instance to be tested.
-
-
Method Detail
-
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.
-
getEncryptedKeys
private List<EncryptedKey> getEncryptedKeys(SignableSimpleXMLObject sxo)
Extract all the EncryptedKey's from the SimpleXMLObject.- Parameters:
sxo- the mock object to process- Returns:
- a list of EncryptedKey elements
-
generateList
private List<EncryptedKey> generateList(EncryptedData encData, EncryptedKeyResolver ekResolver)
Resolve EncryptedKeys and put them in an ordered list.- Parameters:
encData- the EncryptedData contextekResolver- the resolver to test- Returns:
- list of resolved EncryptedKeys
-
-