From feb95e14e9c9941681ac6d2fc5880691b61afff7 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 17 Jan 2025 12:55:57 +0100 Subject: [PATCH] Add missing elements X509CRL and X509SKI --- src/XML/ds/X509CRL.php | 26 +++++++++++++ src/XML/ds/X509SKI.php | 26 +++++++++++++ tests/XML/ds/X509CRLTest.php | 62 ++++++++++++++++++++++++++++++ tests/XML/ds/X509SKITest.php | 62 ++++++++++++++++++++++++++++++ tests/resources/xml/ds_X509CRL.xml | 1 + tests/resources/xml/ds_X509SKI.xml | 1 + 6 files changed, 178 insertions(+) create mode 100644 src/XML/ds/X509CRL.php create mode 100644 src/XML/ds/X509SKI.php create mode 100644 tests/XML/ds/X509CRLTest.php create mode 100644 tests/XML/ds/X509SKITest.php create mode 100644 tests/resources/xml/ds_X509CRL.xml create mode 100644 tests/resources/xml/ds_X509SKI.xml diff --git a/src/XML/ds/X509CRL.php b/src/XML/ds/X509CRL.php new file mode 100644 index 00000000..e40c3c77 --- /dev/null +++ b/src/XML/ds/X509CRL.php @@ -0,0 +1,26 @@ +setContent($content); + } +} diff --git a/src/XML/ds/X509SKI.php b/src/XML/ds/X509SKI.php new file mode 100644 index 00000000..0bb61594 --- /dev/null +++ b/src/XML/ds/X509SKI.php @@ -0,0 +1,26 @@ +setContent($content); + } +} diff --git a/tests/XML/ds/X509CRLTest.php b/tests/XML/ds/X509CRLTest.php new file mode 100644 index 00000000..c59beb9e --- /dev/null +++ b/tests/XML/ds/X509CRLTest.php @@ -0,0 +1,62 @@ +assertEquals( + XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation), + strval($X509CRL), + ); + } + + + /** + */ + public function testMarshallingNotBase64(): void + { + $this->expectException(AssertionFailedException::class); + new X509CRL('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + } +} diff --git a/tests/XML/ds/X509SKITest.php b/tests/XML/ds/X509SKITest.php new file mode 100644 index 00000000..a3eb849d --- /dev/null +++ b/tests/XML/ds/X509SKITest.php @@ -0,0 +1,62 @@ +assertEquals( + XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation), + strval($X509SKI), + ); + } + + + /** + */ + public function testMarshallingNotBase64(): void + { + $this->expectException(AssertionFailedException::class); + new X509SKI('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + } +} diff --git a/tests/resources/xml/ds_X509CRL.xml b/tests/resources/xml/ds_X509CRL.xml new file mode 100644 index 00000000..563042ad --- /dev/null +++ b/tests/resources/xml/ds_X509CRL.xml @@ -0,0 +1 @@ +/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI= diff --git a/tests/resources/xml/ds_X509SKI.xml b/tests/resources/xml/ds_X509SKI.xml new file mode 100644 index 00000000..f6bba588 --- /dev/null +++ b/tests/resources/xml/ds_X509SKI.xml @@ -0,0 +1 @@ +/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=