betz Thu Aug 1 19:02:59 2002 EDT
Added files:
/phpdoc/en/reference/openssl constants.xml
Modified files:
/phpdoc/en/reference/openssl reference.xml
Log:
new structure applied and constants added
Index: phpdoc/en/reference/openssl/reference.xml
diff -u phpdoc/en/reference/openssl/reference.xml:1.2
phpdoc/en/reference/openssl/reference.xml:1.3
--- phpdoc/en/reference/openssl/reference.xml:1.2 Mon Apr 15 17:57:12 2002
+++ phpdoc/en/reference/openssl/reference.xml Thu Aug 1 19:02:59 2002
@@ -1,179 +1,138 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<reference id="ref.openssl">
<title>OpenSSL functions</title>
<titleabbrev>OpenSSL</titleabbrev>
<partintro>
- &warn.experimental;
- <section id="openssl.intro">
- <title>Introduction</title>
- <para>
- This module uses the functions of <ulink
- url="&url.openssl;">OpenSSL</ulink> for generation and verification
- of signatures and for sealing (encrypting) and opening (decrypting)
- data. PHP-4.0.4pl1 requires OpenSSL >= 0.9.6, but PHP-4.0.5 and greater
- with also work with OpenSSL >= 0.9.5.
- </para>
- <note>
- <para>Please keep in mind that this extension is still considered
- experimental!</para>
- </note>
- <para>
- OpenSSL offers many features that this module currently doesn't support.
- Some of these may be added in the future.
- </para>
- </section>
- <section id="openssl.certparams">
- <title>Key/Certificate parameters</title>
- <para>
- Quite a few of the openssl functions require a key or a certificate
- parameter. PHP 4.0.5 and earlier have to use a key or certificate resource
- returned by one of the openssl_get_xxx functions. Later versions may use
- one of the following methods:
- <itemizedlist>
- <listitem>
- <para>
- Certificates
- <orderedlist>
- <listitem><simpara>An X.509 resource returned from
- openssl_x509_read</simpara></listitem>
- <listitem><simpara>A string having the format
- <filename>file://path/to/cert.pem</filename>; the named file must
- contain a PEM encoded certificate</simpara></listitem>
- <listitem><simpara>A string containing the content of a certificate,
- PEM encoded</simpara></listitem>
- </orderedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- Public/Private Keys
- <orderedlist>
- <listitem><simpara>A key resource returned from
- <function>openssl_get_publickey</function> or
- <function>openssl_get_privatekey</function></simpara></listitem>
- <listitem><simpara>For public keys only: an X.509
- resource</simpara></listitem>
- <listitem><simpara>A string having the format
- <filename>file://path/to/file.pem</filename> - the named file must
- contain a PEM encoded certificate/private key (it may contain
- both)</simpara></listitem>
- <listitem><simpara>A string containing the content of a
- certificate/key, PEM encoded</simpara></listitem>
- <listitem><simpara>For private keys, you may also use the syntax
- <emphasis>array($key, $passphrase)</emphasis> where $key represents a
- key specified using the file:// or textual content notation above, and
- $passphrase represents a string containing the passphrase for that
- private key</simpara></listitem>
- </orderedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section id="openssl.cert.verification">
- <title>Certificate Verification</title>
- <para>
- When calling a function that will verify a signature/certificate, the
- <emphasis>cainfo</emphasis> parameter is an array containing file and
- directory names the specify the locations of trusted CA files. If a
- directory is specified, then it must be a correctly formed hashed directory
- as the <command>openssl</command> command would use.
- </para>
- </section>
- <section id="openssl.pkcs7.flags">
- <title>PKCS7 Flags/Constants</title>
- <para>
- The S/MIME functions make use of flags which are specified using a
- bitfield which can include one or more of the following values:
-
- <table>
- <title>PKCS7 CONSTANTS</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Constant</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>PKCS7_TEXT</entry>
- <entry>adds text/plain content type headers to encrypted/signed
- message. If decrypting or verifying, it strips those headers from
- the output - if the decrypted or verified message is not of MIME type
- text/plain then an error will occur.</entry>
- </row>
- <row>
- <entry>PKCS7_BINARY</entry>
- <entry>normally the input message is converted to "canonical" format
- which is effectively using CR and LF as end of line: as required by
- the S/MIME specification. When this options is present, no
- translation occurs. This is useful when handling binary data which
- may not be in MIME format.</entry>
- </row>
- <row>
- <entry>PKCS7_NOINTERN</entry>
- <entry>when verifying a message, certificates (if
- any) included in the message are normally searched for the
- signing certificate. With this option only the
- certificates specified in the <parameter>extracerts</parameter>
- parameter of <function>openssl_pkcs7_verify</function> are
- used. The supplied certificates can still be used as
- untrusted CAs however.
- </entry>
- </row>
- <row>
- <entry>PKCS7_NOVERIFY</entry>
- <entry>do not verify the signers certificate of a signed
- message.</entry>
- </row>
- <row>
- <entry>PKCS7_NOCHAIN</entry>
- <entry>do not chain verification of signers certificates: that is
- don't use the certificates in the signed message as untrusted CAs.
- </entry>
- </row>
- <row>
- <entry>PKCS7_NOCERTS</entry>
- <entry>when signing a message the signer's certificate is normally
- included - with this option it is excluded. This will reduce the
- size of the signed message but the verifier must have a copy of the
- signers certificate available locally (passed using the
- <parameter>extracerts</parameter> to
- <function>openssl_pkcs7_verify</function> for example.
- </entry>
- </row>
- <row>
- <entry>PKCS7_NOATTR</entry>
- <entry>normally when a message is signed, a set of attributes are
- included which include the signing time and the supported symmetric
- algorithms. With this option they are not included.
- </entry>
- </row>
- <row>
- <entry>PKCS7_DETACHED</entry>
- <entry>When signing a message, use cleartext signing with the MIME
- type multipart/signed. This is the default if the
- <parameter>flags</parameter> parameter to
- <function>openssl_pkcs7_sign</function> if you do not specify any
- flags. If you turn this option off, the message will be signed using
- opaque signing, which is more resistant to translation by mail relays
- but cannot be read by mail agents that do not support S/MIME.</entry>
- </row>
- <row>
- <entry>PKCS7_NOSIGS</entry>
- <entry>Don't try and verify the signatures on a message</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <note>
- <para>These constants were added in 4.0.6.</para>
- </note>
+ &warn.experimental;
+ <section id="openssl.intro">
+ &reftitle.intro;
+ <para>
+ This module uses the functions of <ulink
+ url="&url.openssl;">OpenSSL</ulink> for generation and verification
+ of signatures and for sealing (encrypting) and opening (decrypting)
+ data. OpenSSL offers many features that this module currently doesn't
+ support. Some of these may be added in the future.
+ </para>
+ </section>
+
+ <section id="openssl.requirenments">
+ &reftitle.required;
+ <para>
+ In order to use the OpenSSL functions you need to install the <ulink
+ url="&url.openssl;">OpenSSL</ulink> package.
+ PHP-4.0.4pl1 requires OpenSSL >= 0.9.6, but PHP-4.0.5 and greater
+ will also work with OpenSSL >= 0.9.5.
+ </para>
+ </section>
+
+ <section id="openssl.installation">
+ &reftitle.install;
+ <para>
+ To use PHP's OpenSSL support you must also compile PHP <option
+ role="configure">--with-openssl[=DIR]</option>.
+ </para>
+ </section>
+
+ <section id="openssl.configuration">
+ &reftitle.runtime;
+ &no.config;
+ </section>
+
+ <section id="openssl.resources">
+ &reftitle.resources;
+ <para>
+ </para>
+ </section>
+
+ <section id="openssl.certparams">
+ <title>Key/Certificate parameters</title>
+ <para>
+ Quite a few of the openssl functions require a key or a certificate
+ parameter. PHP 4.0.5 and earlier have to use a key or certificate
+ <type>resource</type> returned by one of the openssl_get_xxx functions.
+ Later versions may use one of the following methods:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Certificates
+ <orderedlist>
+ <listitem>
+ <simpara>
+ An X.509 resource returned from
+ <function>openssl_x509_read</function>
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>A string having the format
+ <filename>file://path/to/cert.pem</filename>; the named file must
+ contain a PEM encoded certificate
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A string containing the content of a certificate, PEM encoded
+ </simpara>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Public/Private Keys
+ <orderedlist>
+ <listitem>
+ <simpara>A key resource returned from
+ <function>openssl_get_publickey</function> or
+ <function>openssl_get_privatekey</function>
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>For public keys only: an X.509 resource</simpara>
+ </listitem>
+ <listitem>
+ <simpara>A string having the format
+ <filename>file://path/to/file.pem</filename> - the named file must
+ contain a PEM encoded certificate/private key (it may contain both)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ A string containing the content of a certificate/key, PEM encoded
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ For private keys, you may also use the syntax
+ <emphasis>array($key, $passphrase)</emphasis> where $key represents a
+ key specified using the file:// or textual content notation above, and
+ $passphrase represents a string containing the passphrase for that
+ private key
+ </simpara>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+
+ <section id="openssl.cert.verification">
+ <title>Certificate Verification</title>
+ <para>
+ When calling a function that will verify a signature/certificate, the
+ <emphasis>cainfo</emphasis> parameter is an array containing file and
+ directory names that specify the locations of trusted CA files. If a
+ directory is specified, then it must be a correctly formed hashed
+ directory as the <command>openssl</command> command would use.
+ </para>
+ </section>
+
+ &reference.openssl.constants;
+
- </section>
</partintro>
&reference.openssl.functions;
Index: phpdoc/en/reference/openssl/constants.xml
+++ phpdoc/en/reference/openssl/constants.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<section id="openssl.constants">
&reftitle.constants;
&extension.constants;
<variablelist>
<varlistentry>
<term>
<constant>X509_PURPOSE_SSL_CLIENT</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>X509_PURPOSE_SSL_SERVER</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>X509_PURPOSE_NS_SSL_SERVER</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>X509_PURPOSE_SMIME_SIGN</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>X509_PURPOSE_SMIME_ENCRYPT</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>X509_PURPOSE_CRL_SIGN</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>X509_PURPOSE_ANY</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_PKCS1_PADDING</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_SSLV23_PADDING</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_NO_PADDING</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_PKCS1_OAEP_PADDING</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_KEYTYPE_RSA</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_KEYTYPE_DSA</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>OPENSSL_KEYTYPE_DH</constant>
(<link linkend="language.types.integer">integer</link>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
</variablelist>
<section id="openssl.pkcs7.flags">
<title>PKCS7 Flags/Constants</title>
<para>
The S/MIME functions make use of flags which are specified using a
bitfield which can include one or more of the following values:
<table>
<title>PKCS7 CONSTANTS</title>
<tgroup cols="2">
<thead>
<row>
<entry>Constant</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>PKCS7_TEXT</entry>
<entry>adds text/plain content type headers to encrypted/signed
message. If decrypting or verifying, it strips those headers from
the output - if the decrypted or verified message is not of MIME type
text/plain then an error will occur.</entry>
</row>
<row>
<entry>PKCS7_BINARY</entry>
<entry>normally the input message is converted to "canonical" format
which is effectively using CR and LF as end of line: as required by
the S/MIME specification. When this options is present, no
translation occurs. This is useful when handling binary data which
may not be in MIME format.</entry>
</row>
<row>
<entry>PKCS7_NOINTERN</entry>
<entry>when verifying a message, certificates (if
any) included in the message are normally searched for the
signing certificate. With this option only the
certificates specified in the <parameter>extracerts</parameter>
parameter of <function>openssl_pkcs7_verify</function> are
used. The supplied certificates can still be used as
untrusted CAs however.
</entry>
</row>
<row>
<entry>PKCS7_NOVERIFY</entry>
<entry>do not verify the signers certificate of a signed
message.</entry>
</row>
<row>
<entry>PKCS7_NOCHAIN</entry>
<entry>do not chain verification of signers certificates: that is
don't use the certificates in the signed message as untrusted CAs.
</entry>
</row>
<row>
<entry>PKCS7_NOCERTS</entry>
<entry>when signing a message the signer's certificate is normally
included - with this option it is excluded. This will reduce the
size of the signed message but the verifier must have a copy of the
signers certificate available locally (passed using the
<parameter>extracerts</parameter> to
<function>openssl_pkcs7_verify</function> for example.
</entry>
</row>
<row>
<entry>PKCS7_NOATTR</entry>
<entry>normally when a message is signed, a set of attributes are
included which include the signing time and the supported symmetric
algorithms. With this option they are not included.
</entry>
</row>
<row>
<entry>PKCS7_DETACHED</entry>
<entry>When signing a message, use cleartext signing with the MIME
type multipart/signed. This is the default if the
<parameter>flags</parameter> parameter to
<function>openssl_pkcs7_sign</function> if you do not specify any
flags. If you turn this option off, the message will be signed using
opaque signing, which is more resistant to translation by mail relays
but cannot be read by mail agents that do not support S/MIME.</entry>
</row>
<row>
<entry>PKCS7_NOSIGS</entry>
<entry>Don't try and verify the signatures on a message</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<note>
<para>These constants were added in 4.0.6.</para>
</note>
</section>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php