Hosting de Calidad
  • Inicio
  • Precios y servicios
  • F.a.q y ayudas
  • Realizar pedido
  • Webs alojadas
  • Quienes somos
  • Foro HyD
  • Contacto

    Zona Dominios

    Entrar
    registro de dominios


    Zona Hosting

    Entrar
    alojamiento web


    5 Métodos de Pago
    Tarjeta de crédito
    Domiciliación
    Transferencia
    Soporte Epagado
    Soporte Paypal

    Liberalización .es

    Ver mas
    dominios .es


  •  
     
     
    OpenSSL functions

    LXXIV_ OpenSSL functions

    Introducción

    This module uses the functions of OpenSSL 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_

    Requerimientos

    In order to use the OpenSSL functions you need to install the OpenSSL 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_

    Instalación

    To use PHP's OpenSSL support you must also compile PHP __with_openssl[=DIR]_

    Note to Win32 Users: In order to enable this module on a Windows environment, you must copy libeay32_dll from the DLL folder of the PHP/Win32 binary package to the SYSTEM32 folder of your windows machine_ (Ex: C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32)

    Additionally, if you are planning to use the key generation and certificate signing functions, you will need to install a valid openssl_cnf on your system_ As of PHP 4_3_0, we include a sample configuration file in the openssl of our win32 binary distribution_ If you are using PHP 4_2_0 or later and are missing the file, you can obtain it from the OpenSSL home page or by downloading the PHP 4_3_0 release and using the configuration file from there_

    Note to Win32 Users: PHP will search for the openssl_cnf using the following logic:

    • the OPENSSL_CONF environmental variable, if set, will be used as the path (including filename) of the configuration file_

    • the SSLEAY_CONF environmental variable, if set, will be used as the path (including filename) of the configuration file_

    • The file openssl_cnf will be assumed to be found in the default certificate area, as configured at the time that the openssl DLL was compiled_ This is usually means that the default filename is c:\usr\local\ssl\openssl_cnf_

    In your installation, you need to decide whether to install the configuration file at c:\usr\local\ssl\openssl_cnf or whether to install it someplace else and use environmental variables (possibly on a per_virtual_host basis) to locate the configuration file_ Note that it is possible to override the default path from the script using the configargs of the functions that require a configuration file_

    Configuración en tiempo de ejecución

    Esta extensión no tiene directivas de configuración en php_ini_

    Tipos de recursos

    Key/Certificate parameters

    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:

    • Certificates

      1. An X_509 resource returned from openssl_x509_read()

      2. A string having the format file://path/to/cert_pem; the named file must contain a PEM encoded certificate

      3. A string containing the content of a certificate, PEM encoded

    • Public/Private Keys

      1. A key resource returned from openssl_get_publickey() or openssl_get_privatekey()

      2. For public keys only: an X_509 resource

      3. A string having the format file://path/to/file_pem _ the named file must contain a PEM encoded certificate/private key (it may contain both)

      4. A string containing the content of a certificate/key, PEM encoded

      5. For private keys, you may also use the syntax array($key, $passphrase) 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

    Certificate Verification

    When calling a function that will verify a signature/certificate, the cainfo 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 openssl command would use_

    Constantes predefinidas

    Estas constantes están definidas por esta extensión y estarán disponibles solamente cuando la extensión ha sido o bien compilada dentro de PHP o grabada dinámicamente en tiempo de ejecución_

    Purpose checking flags

    X509_PURPOSE_SSL_CLIENT (integer)

    X509_PURPOSE_SSL_SERVER (integer)

    X509_PURPOSE_NS_SSL_SERVER (integer)

    X509_PURPOSE_SMIME_SIGN (integer)

    X509_PURPOSE_SMIME_ENCRYPT (integer)

    X509_PURPOSE_CRL_SIGN (integer)

    X509_PURPOSE_ANY (integer)

    Padding flags

    OPENSSL_PKCS1_PADDING (integer)

    OPENSSL_SSLV23_PADDING (integer)

    OPENSSL_NO_PADDING (integer)

    OPENSSL_PKCS1_OAEP_PADDING (integer)

    Key types

    OPENSSL_KEYTYPE_RSA (integer)

    OPENSSL_KEYTYPE_DSA (integer)

    OPENSSL_KEYTYPE_DH (integer)

    PKCS7 Flags/Constants

    The S/MIME functions make use of flags which are specified using a bitfield which can include one or more of the following values:

    Tabla 1_ PKCS7 CONSTANTS

    ConstantDescription
    PKCS7_TEXTadds 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_
    PKCS7_BINARYnormally 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_
    PKCS7_NOINTERNwhen 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 extracerts parameter of openssl_pkcs7_verify() are used_ The supplied certificates can still be used as untrusted CAs however_
    PKCS7_NOVERIFYdo not verify the signers certificate of a signed message_
    PKCS7_NOCHAINdo not chain verification of signers certificates: that is don't use the certificates in the signed message as untrusted CAs_
    PKCS7_NOCERTSwhen 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 extracerts to openssl_pkcs7_verify() for example_
    PKCS7_NOATTRnormally 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_
    PKCS7_DETACHEDWhen signing a message, use cleartext signing with the MIME type multipart/signed_ This is the default if the flags parameter to openssl_pkcs7_sign() 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_
    PKCS7_NOSIGSDon't try and verify the signatures on a message

    Nota: These constants were added in 4_0_6_

    Tabla de contenidos
    openssl_csr_export_to_file __ Exports a CSR to a file
    openssl_csr_export __ Exports a CSR as a string
    openssl_csr_new __ Generates a CSR
    openssl_csr_sign __ Sign a CSR with another certificate (or itself) and generate a certificate
    openssl_error_string __ Return openSSL error message
    openssl_free_key __ Free key resource
    openssl_get_privatekey __ Get a private key
    openssl_get_publickey __ Extract public key from certificate and prepare it for use
    openssl_open __ Open sealed data
    openssl_pkcs7_decrypt __ Decrypts an S/MIME encrypted message
    openssl_pkcs7_encrypt __ Encrypt an S/MIME message
    openssl_pkcs7_sign __ sign an S/MIME message
    openssl_pkcs7_verify __ Verifies the signature of an S/MIME signed message
    openssl_pkey_export_to_file __ Gets an exportable representation of a key into a file
    openssl_pkey_export __ Gets an exportable representation of a key into a string
    openssl_pkey_get_private __ Get a private key
    openssl_pkey_get_public __ Extract public key from certificate and prepare it for use
    openssl_pkey_new __ Generates a new private key
    openssl_private_decrypt __ Decrypts data with private key
    openssl_private_encrypt __ Encrypts data with private key
    openssl_public_decrypt __ Decrypts data with public key
    openssl_public_encrypt __ Encrypts data with public key
    openssl_seal __ Seal (encrypt) data
    openssl_sign __ Generate signature
    openssl_verify __ Verify signature
    openssl_x509_check_private_key __ Checks if a private key corresponds to a certificate
    openssl_x509_checkpurpose __ Verifies if a certificate can be used for a particular purpose
    openssl_x509_export_to_file __ Exports a certificate to file
    openssl_x509_export __ Exports a certificate as a string
    openssl_x509_free __ Free certificate resource
    openssl_x509_parse __ Parse an X509 certificate and return the information as an array
    openssl_x509_read __ Parse an X_509 certificate and return a resource identifier for it
     
       



    registro de dominios | alojamiento web | hosting por publicidad

       

     

    Manual de linux Manual de apache Manual de php Manual de mysql Manual de SQL Manual del Plesk Como funciona Paypal Manual de html