Class KeyInfoSupportTest


  • public class KeyInfoSupportTest
    extends org.opensaml.core.xml.XMLObjectBaseTestCase
    Test to exercise the KeyInfoSupport methods to convert between XMLObject's contained within KeyInfo and Java security native types.
    • Field Detail

      • cert1SKIPlainBase64

        private final String cert1SKIPlainBase64
        Test cert 1 SKI value. Base64 encoded version of cert's plain (non-DER encoded) subject key identifier, which is: AF:B9:F9:1D:C2:45:18:CC:B8:21:E2:A7:47:BC:49:BD:19:B5:78:28
        See Also:
        Constant Field Values
      • xmlCert1

        private org.opensaml.xmlsec.signature.X509Certificate xmlCert1
      • xmlCert2

        private org.opensaml.xmlsec.signature.X509Certificate xmlCert2
      • xmlCRL1

        private org.opensaml.xmlsec.signature.X509CRL xmlCRL1
      • xmlX509Data

        private org.opensaml.xmlsec.signature.X509Data xmlX509Data
      • keyInfo

        private org.opensaml.xmlsec.signature.KeyInfo keyInfo
      • keyValue

        private org.opensaml.xmlsec.signature.KeyValue keyValue
      • xmlDSAKeyValue1

        private org.opensaml.xmlsec.signature.DSAKeyValue xmlDSAKeyValue1
      • xmlDSAKeyValue1NoParams

        private org.opensaml.xmlsec.signature.DSAKeyValue xmlDSAKeyValue1NoParams
      • xmlRSAKeyValue1

        private org.opensaml.xmlsec.signature.RSAKeyValue xmlRSAKeyValue1
      • numExpectedCerts

        private int numExpectedCerts
      • numExpectedCRLs

        private int numExpectedCRLs
      • javaCRL1

        private X509CRL javaCRL1
      • javaDSAParams1

        private DSAParams javaDSAParams1
    • Constructor Detail

      • KeyInfoSupportTest

        public KeyInfoSupportTest()
        Constructor.
    • Method Detail

      • testCertConversionXMLtoJava

        public void testCertConversionXMLtoJava()
                                         throws CertificateException
        Test converting XML X509Certificate to java.security.cert.X509Certificate.
        Throws:
        CertificateException - ...
      • testCertConversionJavaToXML

        public void testCertConversionJavaToXML()
                                         throws CertificateException
        Test converting java.security.cert.X509Certificate to XML X509Certificate.
        Throws:
        CertificateException - ...
      • testDSAConversionXMLToJava

        public void testDSAConversionXMLToJava()
        Test conversion of DSA public keys from XML to Java security native type.
      • testRSAConversionXMLToJava

        public void testRSAConversionXMLToJava()
        Test conversion of RSA public keys from XML to Java security native type.
      • testDSAConversionJavaToXML

        public void testDSAConversionJavaToXML()
                                        throws net.shibboleth.utilities.java.support.codec.EncodingException
        Test conversion of DSA public keys from Java security native type to XML.
        Throws:
        net.shibboleth.utilities.java.support.codec.EncodingException - on base64 encoding error
      • testRSAConversionJavaToXML

        public void testRSAConversionJavaToXML()
                                        throws net.shibboleth.utilities.java.support.codec.EncodingException
        Test conversion of RSA public keys from Java security native type to XML.
        Throws:
        net.shibboleth.utilities.java.support.codec.EncodingException - on base64 encoding error
      • testGetDSAKey

        public void testGetDSAKey()
        Tests extracting a DSA public key from a KeyValue.
      • testGetRSAKey

        public void testGetRSAKey()
        Tests extracting a RSA public key from a KeyValue.
      • testAddDSAPublicKey

        public void testAddDSAPublicKey()
                                 throws net.shibboleth.utilities.java.support.codec.EncodingException
        Tests adding a public key as a KeyValue to KeyInfo.
        Throws:
        net.shibboleth.utilities.java.support.codec.EncodingException - on base64 encoding error
      • testAddRSAPublicKey

        public void testAddRSAPublicKey()
                                 throws net.shibboleth.utilities.java.support.codec.EncodingException
        Tests adding a public key as a KeyValue to KeyInfo.
        Throws:
        net.shibboleth.utilities.java.support.codec.EncodingException - on base64 encoding error
      • testAddDEREncodedDSAPublicKey

        public void testAddDEREncodedDSAPublicKey()
        Tests adding a public key as a DEREncodedKeyValue to KeyInfo.
      • testAddDEREncodedRSAPublicKey

        public void testAddDEREncodedRSAPublicKey()
        Tests adding a public key as a DEREncodedKeyValue to KeyInfo.
      • testAddX509CRL

        public void testAddX509CRL()
                            throws CRLException
        Tests adding a CRL as a X509Data/X509CRL to KeyInfo.
        Throws:
        CRLException - ...
      • testBuildSubjectName

        public void testBuildSubjectName()
        Tests building a new X509SubjectName.
      • testBuildIssuerSerial

        public void testBuildIssuerSerial()
        Tests building a new X509IssuerSerial.
      • testBuildSubjectKeyIdentifier

        public void testBuildSubjectKeyIdentifier()
                                           throws CertificateException,
                                                  net.shibboleth.utilities.java.support.codec.DecodingException,
                                                  org.opensaml.security.SecurityException
        Tests building a new X509SKI from a certificate containing an SKI value.
        Throws:
        CertificateException - ...
        net.shibboleth.utilities.java.support.codec.DecodingException - if an issue base64-decoding SKI values
        org.opensaml.security.SecurityException - if an issue building X509SKI.
      • testBuildDigest

        public void testBuildDigest()
                             throws CertificateException,
                                    net.shibboleth.utilities.java.support.codec.DecodingException
        Tests building a new X509Digest from a certificate.
        Throws:
        CertificateException - ...
        net.shibboleth.utilities.java.support.codec.DecodingException - if an issue base64-decoding digests.