X509CrlToXmlDoc (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{Template:String:X509CrlToXmlDoc subtitle}}
{{Template:String:X509CrlToXmlDoc subtitle}}


This page is [[under construction]].
X509 is a general authentication framework that establishes standard formats for for public-key certificates, certificate revocation list (CRLs), and more. <var>X509CrlToXmlDoc</var> converts a string (<var>Longstring</var>) that contains a CRL to an <var>[[XmlDoc]]</var>.
 
==Syntax==
==Syntax==
{{Template:String:X509CrlToXmlDoc syntax}}
{{Template:String:X509CrlToXmlDoc syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 14: Line 16:
==Usage notes==
==Usage notes==
<ul>
<ul>
<li><var>X509CrlToXmlDoc</var> is very similar to 
<var>[[DerToXmlDoc (String function)|DerToXmlDoc]]</var>, except that <var>X509CrlToXmlDoc</var> understands the semantics of the CRL tags, so it provides more meaningful XML element names. Contrast the [[DerToXmlDoc (String function)#Examples|DerToXmlDoc example]] with the <var>X509CrlToXmlDoc</var> [[X509CrlToXmlDoc (String function)#Examples|example]], below.
<li>Currently, no method is available to produce a DER stream from an <var>XmlDoc</var>.
<li>Currently, no method is available to produce a DER stream from an <var>XmlDoc</var>.
</ul>
</ul>


==Examples==
==Examples==
[[PemToString (Stringlist function)#Examples|The PemToString example]] loads a <var>Longstring</var> with the contents of the base64 encoded CRL (Certificate Revocation List). If that <var>Longstring</var> is <code>%ls</code> below, the following statement converts that string to the XmlDoc whose contents are printed thereafter:
<p class="code">%ls:x509CrlToXmlDoc:print</code> </p>
The result is shown in part below:
<p class="code">
<CertificateList>
  <tbsCertList>
      <signature>
        <algorithm name="md5WithRSAEncryption">
            1.2.840.113549.1.1.4
        </algorithm>
        <parameters/>
      </signature>
      <issuer>
        <RelativeDistinguishedName>
            <countryName>AU</countryName>
        </RelativeDistinguishedName>
        <RelativeDistinguishedName>
            <stateOrProvinceName type="PrintableString">
              QLD
            </stateOrProvinceName>
        </RelativeDistinguishedName>
        ...
      </issuer>
      <thisUpdate type="UTCTime">
        20010115162657.000Z
      </thisUpdate> 
      <nextUpdate type="UTCTime">
        20010214162657.000Z
      </nextUpdate>
      <revokedCertificates>
        <revokedCertificate>
            <userCertificate>1</userCertificate>
            <revocationDate type="UTCTime">     
              19951009233205.000Z 
            </revocationDate>
        </revokedCertificate>
        <revokedCertificate>
            <userCertificate>3</userCertificate>
            <revocationDate type="UTCTime">   
              19951201010000.000Z
            </revocationDate>
        </revokedCertificate>
        <revokedCertificate>
            <userCertificate>4660</userCertificate>
            <revocationDate type="UTCTime">
              20010115161947.000Z
            </revocationDate>
        </revokedCertificate>
        ...
      </revokedCertificates>
  </tbsCertList>
  ...
</CertificateList>
</p>
==See also==
==See also==
{{Template:String:X509CrlToXmlDoc footer}}
{{Template:String:X509CrlToXmlDoc footer}}

Revision as of 21:16, 16 April 2012

Convert BER encoded X.509 CRL to XML (String class)

[Introduced in Sirius Mods 8.0]


X509 is a general authentication framework that establishes standard formats for for public-key certificates, certificate revocation list (CRLs), and more. X509CrlToXmlDoc converts a string (Longstring) that contains a CRL to an XmlDoc.

Syntax

%doc = string:X509CrlToXmlDoc Throws InvalidBerData

Syntax terms

%doc An XmlDoc object variable to contain the decoded value of the method object, string.
string A DER encoded string that contains the contents of a CRL (Certificate Revocation List).

Usage notes

  • X509CrlToXmlDoc is very similar to DerToXmlDoc, except that X509CrlToXmlDoc understands the semantics of the CRL tags, so it provides more meaningful XML element names. Contrast the DerToXmlDoc example with the X509CrlToXmlDoc example, below.
  • Currently, no method is available to produce a DER stream from an XmlDoc.

Examples

The PemToString example loads a Longstring with the contents of the base64 encoded CRL (Certificate Revocation List). If that Longstring is %ls below, the following statement converts that string to the XmlDoc whose contents are printed thereafter:

%ls:x509CrlToXmlDoc:print

The result is shown in part below:

<CertificateList> <tbsCertList> <signature> <algorithm name="md5WithRSAEncryption"> 1.2.840.113549.1.1.4 </algorithm> <parameters/> </signature> <issuer> <RelativeDistinguishedName> <countryName>AU</countryName> </RelativeDistinguishedName> <RelativeDistinguishedName> <stateOrProvinceName type="PrintableString"> QLD </stateOrProvinceName> </RelativeDistinguishedName> ... </issuer> <thisUpdate type="UTCTime"> 20010115162657.000Z </thisUpdate> <nextUpdate type="UTCTime"> 20010214162657.000Z </nextUpdate> <revokedCertificates> <revokedCertificate> <userCertificate>1</userCertificate> <revocationDate type="UTCTime"> 19951009233205.000Z </revocationDate> </revokedCertificate> <revokedCertificate> <userCertificate>3</userCertificate> <revocationDate type="UTCTime"> 19951201010000.000Z </revocationDate> </revokedCertificate> <revokedCertificate> <userCertificate>4660</userCertificate> <revocationDate type="UTCTime"> 20010115161947.000Z </revocationDate> </revokedCertificate> ... </revokedCertificates> </tbsCertList> ... </CertificateList>

See also