Class SimpleRetrievalMethodEncryptedKeyResolverTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.encryption.support.SimpleRetrievalMethodEncryptedKeyResolverTest
-
public class SimpleRetrievalMethodEncryptedKeyResolverTest extends org.opensaml.core.xml.XMLObjectBaseTestCaseTest the encrypted key resolver which dereferences RetrievalMethods.
-
-
Field Summary
Fields Modifier and Type Field Description private org.opensaml.xmlsec.encryption.support.SimpleRetrievalMethodEncryptedKeyResolverresolverThe resolver instance to be tested.
-
Constructor Summary
Constructors Constructor Description SimpleRetrievalMethodEncryptedKeyResolverTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<org.opensaml.xmlsec.encryption.EncryptedKey>generateList(org.opensaml.xmlsec.encryption.EncryptedData encData, org.opensaml.xmlsec.encryption.support.EncryptedKeyResolver ekResolver)Resolve EncryptedKeys and put them in an ordered list.private List<org.opensaml.xmlsec.encryption.EncryptedKey>getEncryptedKeys(SignableSimpleXMLObject sxo)Extract all the EncryptedKey's from the SimpleXMLObject.voidtestMultiEKWithOneRecipient()One recipients specified to resolver, three EncryptedKeys in instance, two RetrievalMethod 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 recipients specified to resolver, one EncryptedKey in instance.voidtestSingleEKWithTransform()One recipients specified to resolver, RetrievalMethod has Transforms, so should fail.-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
-
-
-
Method Detail
-
testSingleEKNoRecipient
public void testSingleEKNoRecipient()
No recipients specified to resolver, one EncryptedKey in instance.
-
testSingleEKWithRecipient
public void testSingleEKWithRecipient()
One recipients specified to resolver, one EncryptedKey in instance.
-
testSingleEKWithTransform
public void testSingleEKWithTransform()
One recipients specified to resolver, RetrievalMethod has Transforms, so should fail.
-
testMultiEKWithOneRecipient
public void testMultiEKWithOneRecipient()
One recipients specified to resolver, three EncryptedKeys in instance, two RetrievalMethod references.
-
testMultiEKWithTwoRecipients
public void testMultiEKWithTwoRecipients()
Two recipients specified to resolver, three EncryptedKeys in instance, two RetrievalMethod references.
-
getEncryptedKeys
private List<org.opensaml.xmlsec.encryption.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<org.opensaml.xmlsec.encryption.EncryptedKey> generateList(org.opensaml.xmlsec.encryption.EncryptedData encData, org.opensaml.xmlsec.encryption.support.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
-
-