Class ChainingEncryptedKeyResolverTest

java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.encryption.support.tests.ChainingEncryptedKeyResolverTest

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

  • Constructor Details

    • ChainingEncryptedKeyResolverTest

      public ChainingEncryptedKeyResolverTest()
  • Method Details

    • setUp

      @BeforeMethod protected void setUp() throws Exception
      Throws:
      Exception
    • 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 .
    • testMultiRecipientsCtorAndArgs

      public void testMultiRecipientsCtorAndArgs()
      Multi recipient specified to resolver via ctor and method args.
    • getEncryptedKeys

      private List<EncryptedKey> getEncryptedKeys(@Nonnull SignableSimpleXMLObject sxo)
      Extract all the EncryptedKey's from the SignableSimpleXMLObject.
      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 context
      ekResolver - the resolver to test
      recipients - the valid recipients for resolution
      Returns:
      list of resolved EncryptedKeys