<docbook><section><title>VirtGenerateX509Cert</title><title> X.509 Certificate Generation</title> X.509 Certificate Generation
<para>The WebID Protocol consumer needs an x509 certificate with v3 extension &quot;Subject Alternate Name&quot;.
This attribute is used for the owner&#39;s WebID.
 For testing purposes, we used the OpenSSL demo CA to generate such certificates.
 If you are not using the OpenSSL demo CA, you must first set up a self-signed CA; refer to <ulink url="https://www.openssl.org/docs/">the OpenSSL documentation</ulink> for how to do this.</para>
<orderedlist spacing="compact"><listitem>Add the following line to the [usr_cert] section of the openssl.cnf file — <programlisting>subjectAltName=$ENV::ALTNAME
</programlisting></listitem>
<listitem>Set the environment variable ALTNAME to the owner&#39;s WebID, e.g., <programlisting>export ALTNAME=URI:http://localhost/dataspace/person/myname#this
</programlisting></listitem>
<listitem>Make a self-signed certificate, e.g., <programlisting>$ CA.pl -newreq (follow the dialog) 
$ CA.pl -sign
</programlisting></listitem>
<listitem>When asked to commit the certificate, make sure you see several lines above, like — <programlisting>X509v3 Subject Alternative Name: 
    URI:http://localhost/dataspace/person/myname#this 
</programlisting></listitem>
<listitem>If your browser wants a PKCS#12 bundle, you must make one — <programlisting>$ openssl pkcs12 -export -in newcert.pem -inkey newkey.pem -out mycert.p12 
</programlisting></listitem>
<listitem>Rename newcert.pem and newkey.pem; for example, to mycert.pem and mykey.pem.
</listitem>
</orderedlist></section></docbook>