Class StaticKeyInfoGeneratorTest


  • public class StaticKeyInfoGeneratorTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Test the static KeyInfo generator.
    • Field Detail

      • generator

        private org.opensaml.xmlsec.keyinfo.impl.StaticKeyInfoGenerator generator
      • origKeyInfo

        private org.opensaml.xmlsec.signature.KeyInfo origKeyInfo
      • expectedKeyName1

        private String expectedKeyName1
      • expectedKeyName2

        private String expectedKeyName2
      • expectedKeyAlgorithm

        private String expectedKeyAlgorithm
      • expectedKeyValue

        private PublicKey expectedKeyValue
    • Constructor Detail

      • StaticKeyInfoGeneratorTest

        public StaticKeyInfoGeneratorTest()
        Constructor.
    • Method Detail

      • testSimple

        public void testSimple()
                        throws org.opensaml.security.SecurityException,
                               KeyException
        Simple test, should return the same instance every time.
        Throws:
        org.opensaml.security.SecurityException - ...
        KeyException - ...
      • testWithCloningNoDOMCache

        public void testWithCloningNoDOMCache()
                                       throws org.opensaml.security.SecurityException,
                                              KeyException
        Test with cloning, original KeyInfo has no cached DOM.
        Throws:
        org.opensaml.security.SecurityException - ...
        KeyException - ...
      • testWithCloningWithDOMCache

        public void testWithCloningWithDOMCache()
                                         throws org.opensaml.security.SecurityException,
                                                KeyException,
                                                org.opensaml.core.xml.io.MarshallingException
        Test with cloning, original KeyInfo has a cached DOM.
        Throws:
        org.opensaml.security.SecurityException - ...
        KeyException - ...
        org.opensaml.core.xml.io.MarshallingException - ...
      • checkKeyInfo

        private void checkKeyInfo​(org.opensaml.xmlsec.signature.KeyInfo keyInfo)
                           throws KeyException
        Check the correctness of the generated KeyInfo.
        Parameters:
        keyInfo - the KeyInfo to check
        Throws:
        KeyException - if there is an error extracting the Java key from the KeyInfo