Skip to content

Commit

Permalink
Extract key authorities from master file into a PEM format certificat…
Browse files Browse the repository at this point in the history
…e list file.
  • Loading branch information
iay committed Sep 4, 2007
1 parent 06c24ca commit 32f9715
Show file tree
Hide file tree
Showing 3 changed files with 384 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -510,4 +510,15 @@
x="statistics.xsl"/>
</target>

<!--
Extract authorities
-->
<target name="extract.authorities">
<echo>Extracting key authorities</echo>
<XALAN
i="master.xml"
o="authorities.pem"
x="extract_authorities.xsl"/>
</target>

</project>
34 changes: 34 additions & 0 deletions build/extract_authorities.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
extract_roots.xsl
XSL stylesheet that takes a SAML 2.0 metadata file and extracts
the certificate authorities in the form of a series of
PEM certificate blocks.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
exclude-result-prefixes="shibmeta md ds wayf">

<!-- Output is plain text -->
<xsl:output method="text"/>

<xsl:template match="//md:EntitiesDescriptor/md:Extensions/shibmeta:KeyAuthority//ds:X509Certificate">
<xsl:text>-----BEGIN CERTIFICATE-----&#x0a;</xsl:text>
<xsl:value-of select="."/>
<xsl:text>-----END CERTIFICATE-----&#x0a;</xsl:text>
</xsl:template>

<xsl:template match="text()">
<!-- do nothing -->
</xsl:template>
</xsl:stylesheet>
Loading

0 comments on commit 32f9715

Please sign in to comment.