Class X509KeyInfoGeneratorTest


  • public class X509KeyInfoGeneratorTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Tests the factory and impl for X509KeyInfoGenerator.
    • Field Detail

      • subjectAltNameExtensionOID

        private static String subjectAltNameExtensionOID
      • credential

        private org.opensaml.security.x509.BasicX509Credential credential
      • factory

        private org.opensaml.xmlsec.keyinfo.impl.X509KeyInfoGeneratorFactory factory
      • generator

        private org.opensaml.xmlsec.keyinfo.KeyInfoGenerator generator
      • keyNameFoo

        private String keyNameFoo
      • keyNameBar

        private String keyNameBar
      • entityID

        private String entityID
      • entityCertBase64

        private String entityCertBase64
      • entityCertSKIBase64

        private String entityCertSKIBase64
      • entityCertDigestBase64

        private String entityCertDigestBase64
      • caCertBase64

        private String caCertBase64
      • subjectCN

        private String subjectCN
      • subjectKeyIdentifier

        private byte[] subjectKeyIdentifier
      • x509Digest

        private byte[] x509Digest
      • altName1

        private String altName1
      • altName2

        private String altName2
      • altName3

        private String altName3
      • altName1Type

        private Integer altName1Type
      • altName2Type

        private Integer altName2Type
      • altName3Type

        private Integer altName3Type
      • caCRLBase64

        private String caCRLBase64
    • Constructor Detail

      • X509KeyInfoGeneratorTest

        public X509KeyInfoGeneratorTest()
    • Method Detail

      • testNoOptions

        public void testNoOptions()
                           throws org.opensaml.security.SecurityException
        Test no options - should produce null KeyInfo.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitPublicKey

        public void testEmitPublicKey()
                               throws org.opensaml.security.SecurityException,
                                      KeyException
        Test emit public key.
        Throws:
        org.opensaml.security.SecurityException - ...
        KeyException - ...
      • testEmitKeynames

        public void testEmitKeynames()
                              throws org.opensaml.security.SecurityException
        Test emit credential key names.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitEntityIDAsKeyName

        public void testEmitEntityIDAsKeyName()
                                       throws org.opensaml.security.SecurityException
        Test emit entity ID as key name.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitEntityCert

        public void testEmitEntityCert()
                                throws org.opensaml.security.SecurityException,
                                       CertificateException
        Test emit entity cert.
        Throws:
        org.opensaml.security.SecurityException - ...
        CertificateException - ...
      • testEmitEntityCertChain

        public void testEmitEntityCertChain()
                                     throws org.opensaml.security.SecurityException,
                                            CertificateException
        Test emit entity cert chain in X509Data.
        Throws:
        org.opensaml.security.SecurityException - ...
        CertificateException - ...
      • testEmitCertAndChainCombo

        public void testEmitCertAndChainCombo()
                                       throws org.opensaml.security.SecurityException,
                                              CertificateException
        Test combo options of cert and chain - don't emit duplicate of entity cert.
        Throws:
        org.opensaml.security.SecurityException - ...
        CertificateException - ...
      • testEmitCRLs

        public void testEmitCRLs()
                          throws org.opensaml.security.SecurityException,
                                 CRLException
        Test emit CRLs.
        Throws:
        org.opensaml.security.SecurityException - ...
        CRLException - ...
      • testEmitX509SubjectName

        public void testEmitX509SubjectName()
                                     throws org.opensaml.security.SecurityException
        Test emit subject name in X509Data.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitX509IssuerSerial

        public void testEmitX509IssuerSerial()
                                      throws org.opensaml.security.SecurityException
        Test emit issuer name and serial number in X509Data.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitX509SKI

        public void testEmitX509SKI()
                             throws org.opensaml.security.SecurityException,
                                    net.shibboleth.utilities.java.support.codec.DecodingException
        Test emit subject key identifier in X509Data.
        Throws:
        org.opensaml.security.SecurityException - ...
        net.shibboleth.utilities.java.support.codec.DecodingException - if the base64 key identifier can not be decoded.
      • testEmitX509Digest

        public void testEmitX509Digest()
                                throws org.opensaml.security.SecurityException,
                                       net.shibboleth.utilities.java.support.codec.DecodingException
        Test emit X509Digest in X509Data.
        Throws:
        org.opensaml.security.SecurityException - ...
        net.shibboleth.utilities.java.support.codec.DecodingException - if the base64 digest value can not be decoded.
      • testEmitSubjectDNAsKeyName

        public void testEmitSubjectDNAsKeyName()
                                        throws org.opensaml.security.SecurityException
        Test emit subject DN as key name.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitSubjectCNAsKeyName

        public void testEmitSubjectCNAsKeyName()
                                        throws org.opensaml.security.SecurityException
        Test emit subject CN as key name.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testEmitSubjectAltNamesAsKeyNames

        public void testEmitSubjectAltNamesAsKeyNames()
                                               throws org.opensaml.security.SecurityException,
                                                      CertificateParsingException
        Test emit subject alt names as key names.
        Throws:
        org.opensaml.security.SecurityException - ...
        CertificateParsingException - ...
      • testEmitKeyNamesCombo

        public void testEmitKeyNamesCombo()
                                   throws org.opensaml.security.SecurityException
        Test emitting combinations of key names.
        Throws:
        org.opensaml.security.SecurityException - ...
      • testProperOptionsCloning

        public void testProperOptionsCloning()
                                      throws org.opensaml.security.SecurityException
        Test that the options passed to the generator are really cloned. After newInstance() is called, changes to the factory options should not be reflected in the generator.
        Throws:
        org.opensaml.security.SecurityException - ...