Class ChainingEncryptedKeyResolverTest


  • public class ChainingEncryptedKeyResolverTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Test the encrypted key resolver which dereferences RetrievalMethods.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Set<String> recipients  
      private org.opensaml.xmlsec.encryption.support.ChainingEncryptedKeyResolver resolver
      The resolver instance to be tested.
      private List<org.opensaml.xmlsec.encryption.support.EncryptedKeyResolver> resolverChain  
      • Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase

        builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
    • 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 SignableSimpleXMLObject.
      protected void setUp()  
      void testEmptyChain()
      Test error case of empty resolver chain.
      void testMultiEKWithOneRecipient()
      One recipient specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .
      void testMultiEKWithTwoRecipients()
      Two recipients specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .
      void testSingleEKInline()
      One recipient specified to resolver, EncryptedKey in instance inline.
      void testSingleEKRetrievalMethod()
      One recipient specified to resolver, EncryptedKey in instance via RetrievalMethod .
      • 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 org.opensaml.xmlsec.encryption.support.ChainingEncryptedKeyResolver resolver
        The resolver instance to be tested.
      • resolverChain

        private List<org.opensaml.xmlsec.encryption.support.EncryptedKeyResolver> resolverChain
    • Constructor Detail

      • ChainingEncryptedKeyResolverTest

        public ChainingEncryptedKeyResolverTest()
    • Method Detail

      • testEmptyChain

        public void testEmptyChain()
        Test error case of empty resolver chain.
      • testSingleEKInline

        public void testSingleEKInline()
        One recipient specified to resolver, EncryptedKey in instance inline.
      • testSingleEKRetrievalMethod

        public void testSingleEKRetrievalMethod()
        One recipient specified to resolver, EncryptedKey in instance via RetrievalMethod .
      • testMultiEKWithOneRecipient

        public void testMultiEKWithOneRecipient()
        One recipient specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .
      • testMultiEKWithTwoRecipients

        public void testMultiEKWithTwoRecipients()
        Two recipients specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .
      • getEncryptedKeys

        private List<org.opensaml.xmlsec.encryption.EncryptedKey> getEncryptedKeys​(SignableSimpleXMLObject sxo)
        Extract all the EncryptedKey's from the SignableSimpleXMLObject.
        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 context
        ekResolver - the resolver to test
        Returns:
        list of resolved EncryptedKeys