Class ExplicitKeySignatureTrustEngineTest


  • public class ExplicitKeySignatureTrustEngineTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Test explicit key signature trust engine.
    • Field Detail

      • signingCertBase64

        private String signingCertBase64
      • signingPrivateKey

        private PrivateKey signingPrivateKey
      • signingPrivateKeyBase64

        private String signingPrivateKeyBase64
      • otherCert1Base64

        private String otherCert1Base64
      • credResolver

        private org.opensaml.security.credential.impl.CollectionCredentialResolver credResolver
      • trustedCredentials

        private List<org.opensaml.security.credential.Credential> trustedCredentials
      • signingX509Cred

        private org.opensaml.security.x509.BasicX509Credential signingX509Cred
      • engine

        private org.opensaml.xmlsec.signature.support.impl.ExplicitKeySignatureTrustEngine engine
      • criteriaSet

        private net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet
      • signingEntityID

        private String signingEntityID
      • rawAlgorithmURI

        private String rawAlgorithmURI
      • rawData

        private String rawData
      • rawControlSignature

        private byte[] rawControlSignature
    • Constructor Detail

      • ExplicitKeySignatureTrustEngineTest

        public ExplicitKeySignatureTrustEngineTest()
        Constructor.
    • Method Detail

      • testSuccess

        public void testSuccess()
                         throws org.opensaml.security.SecurityException
        Test valid signature.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testUntrustedCredential

        public void testUntrustedCredential()
                                     throws org.opensaml.security.SecurityException
        Test valid signature, untrusted signing credential.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testInvalidSignature

        public void testInvalidSignature()
                                  throws org.opensaml.security.SecurityException
        Test invalid signature, trusted signing credential.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testWhitelistedAlgorithms

        public void testWhitelistedAlgorithms()
                                       throws org.opensaml.security.SecurityException
        Test whitelisted signature and digest method algorithm URIs.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testBlacklistedSignatureAlgorithm

        public void testBlacklistedSignatureAlgorithm()
                                               throws org.opensaml.security.SecurityException
        Test blacklisted signature method algorithm URI.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testBlacklistedDigestAlgorithm

        public void testBlacklistedDigestAlgorithm()
                                            throws org.opensaml.security.SecurityException
        Test blacklisted digest method algorithm URI.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testRawSuccess

        public void testRawSuccess()
                            throws org.opensaml.security.SecurityException
        Test valid raw signature, trusted signing credential.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testRawUntrustedCredential

        public void testRawUntrustedCredential()
                                        throws org.opensaml.security.SecurityException
        Test valid raw signature, untrusted signing credential.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testRawInvalidSignature

        public void testRawInvalidSignature()
                                     throws org.opensaml.security.SecurityException
        Test invalid raw signature, trusted signing credential.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testRawWhitelistedAlgorithm

        public void testRawWhitelistedAlgorithm()
                                         throws org.opensaml.security.SecurityException
        Test valid raw signature with whitelisted signature algorithm.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testRawBlacklistedAlgorithm

        public void testRawBlacklistedAlgorithm()
                                         throws org.opensaml.security.SecurityException
        Test valid raw signature with whitelisted signature algorithm.
        Throws:
        org.opensaml.security.SecurityException - ...
      • getValidSignedObject

        protected org.opensaml.xmlsec.signature.SignableXMLObject getValidSignedObject()
        Get a signed object containing the signature to be validated.
        Returns:
        a signed object
      • getInvalidSignedObject

        protected org.opensaml.xmlsec.signature.SignableXMLObject getInvalidSignedObject()
        Get a signed object containing the signature to be validated. Signature should be invalid when valid (i.e. signed content modified, etc ).
        Returns:
        a signed object, with invalid signature
      • buildSignedObject

        protected org.opensaml.xmlsec.signature.SignableXMLObject buildSignedObject()
                                                                             throws org.opensaml.xmlsec.signature.support.SignatureException
        Build a signed object.
        Returns:
        a signed object
        Throws:
        org.opensaml.xmlsec.signature.support.SignatureException - ...