WSCOMUN  2.1.0
Web Services Comunes para PHP/GVHidra
Métodos públicos | Métodos públicos estáticos | Campos de datos
Referencia de la Clase XMLSecurityKey

Métodos públicos

 __construct ($type, $params=null)
 
 getSymmetricKeySize ()
 
 generateSessionKey ()
 
 loadKey ($key, $isFile=false, $isCert=false)
 
 encryptData ($data)
 
 decryptData ($data)
 
 signData ($data)
 
 verifySignature ($data, $signature)
 
 getAlgorith ()
 
 getAlgorithm ()
 
 serializeKey ($parent)
 
 getX509Certificate ()
 
 getX509Thumbprint ()
 

Métodos públicos estáticos

static getRawThumbprint ($cert)
 
static makeAsnSegment ($type, $string)
 
static convertRSA ($modulus, $exponent)
 
static fromEncryptedKeyElement (DOMElement $element)
 

Campos de datos

const TRIPLEDES_CBC = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc'
 
const AES128_CBC = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc'
 
const AES192_CBC = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc'
 
const AES256_CBC = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'
 
const RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5'
 
const RSA_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p'
 
const DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
 
const RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
 
const RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
 
const RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
 
const RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
 
const HMAC_SHA1 = 'http://www.w3.org/2000/09/xmldsig#hmac-sha1'
 
 $type = 0
 
 $key = null
 
 $passphrase = ""
 
 $iv = null
 
 $name = null
 
 $keyChain = null
 
 $isEncrypted = false
 
 $encryptedCtx = null
 
 $guid = null
 

Descripción detallada

xmlseclibs.php

Copyright (c) 2007-2015, Robert Richards rrich.nosp@m.ards.nosp@m.@cdat.nosp@m.azon.nosp@m.e.org. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Autor
Robert Richards rrich.nosp@m.ards.nosp@m.@cdat.nosp@m.azon.nosp@m.e.org

Definición en la línea 41 del archivo XMLSecurityKey.php.

Documentación del constructor y destructor

◆ __construct()

__construct (   $type,
  $params = null 
)
Parámetros
string$type
null | array$params
Excepciones
Exception

Definición en la línea 95 del archivo XMLSecurityKey.php.

Documentación de las funciones miembro

◆ convertRSA()

static convertRSA (   $modulus,
  $exponent 
)
static

Hint: Modulus and Exponent must already be base64 decoded

Parámetros
string$modulus
string$exponent
Devuelve
string

Definición en la línea 673 del archivo XMLSecurityKey.php.

◆ decryptData()

decryptData (   $data)

Decrypts the given data (string) using the regarding php-extension, depending on the library assigned to algorithm in the contructor.

Parámetros
string$data
Devuelve
mixed|string

Definición en la línea 559 del archivo XMLSecurityKey.php.

◆ encryptData()

encryptData (   $data)

Encrypts the given data (string) using the regarding php-extension, depending on the library assigned to algorithm in the contructor.

Parámetros
string$data
Devuelve
mixed|string

Definición en la línea 542 del archivo XMLSecurityKey.php.

◆ fromEncryptedKeyElement()

static fromEncryptedKeyElement ( DOMElement  $element)
static

Create key from an EncryptedKey-element.

Parámetros
DOMElement$elementThe EncryptedKey-element.
Excepciones
Exception
Devuelve
XMLSecurityKey The new key.

Definición en la línea 738 del archivo XMLSecurityKey.php.

◆ generateSessionKey()

generateSessionKey ( )

Generates a session key using the openssl-extension or using the mcrypt-extension as a fallback. In case of using DES3-CBC the key is checked for a proper parity bits set - Mcrypt doesn't care about the parity bits, but others may care.

Devuelve
string
Excepciones
Exception

Definición en la línea 244 del archivo XMLSecurityKey.php.

◆ getAlgorith()

getAlgorith ( )
Obsoleto:
Ver también
getAlgorithm()
Devuelve
mixed

Definición en la línea 613 del archivo XMLSecurityKey.php.

◆ getAlgorithm()

getAlgorithm ( )
Devuelve
mixed

Definición en la línea 622 del archivo XMLSecurityKey.php.

◆ getRawThumbprint()

static getRawThumbprint (   $cert)
static

Get the raw thumbprint of a certificate

Parámetros
string$cert
Devuelve
null|string

Definición en la línea 292 del archivo XMLSecurityKey.php.

◆ getSymmetricKeySize()

getSymmetricKeySize ( )

Retrieve the key size for the symmetric encryption algorithm..

If the key size is unknown, or this isn't a symmetric encryption algorithm, null is returned.

Devuelve
int|null The number of bytes in the key.

Definición en la línea 227 del archivo XMLSecurityKey.php.

◆ getX509Certificate()

getX509Certificate ( )

Retrieve the X509 certificate this key represents.

Will return the X509 certificate in PEM-format if this key represents an X509 certificate.

Devuelve
string The X509 certificate or null if this key doesn't represent an X509-certificate.

Definición en la línea 710 del archivo XMLSecurityKey.php.

◆ getX509Thumbprint()

getX509Thumbprint ( )

Get the thumbprint of this X509 certificate.

Returns: The thumbprint as a lowercase 40-character hexadecimal number, or null if this isn't a X509 certificate.

Devuelve
string Lowercase 40-character hexadecimal number of thumbprint

Definición en la línea 724 del archivo XMLSecurityKey.php.

◆ loadKey()

loadKey (   $key,
  $isFile = false,
  $isCert = false 
)

Loads the given key, or - with isFile set true - the key from the keyfile.

Parámetros
string$key
bool$isFile
bool$isCert
Excepciones
Exception

Definición en la línea 330 del archivo XMLSecurityKey.php.

◆ makeAsnSegment()

static makeAsnSegment (   $type,
  $string 
)
static
Parámetros
int$type
string$string
Devuelve
null|string

Definición en la línea 633 del archivo XMLSecurityKey.php.

◆ serializeKey()

serializeKey (   $parent)
Parámetros
mixed$parent

Definición en la línea 698 del archivo XMLSecurityKey.php.

◆ signData()

signData (   $data)

Signs the data (string) using the extension assigned to the type in the constructor.

Parámetros
string$data
Devuelve
mixed|string

Definición en la línea 576 del archivo XMLSecurityKey.php.

◆ verifySignature()

verifySignature (   $data,
  $signature 
)

Verifies the data (string) against the given signature using the extension assigned to the type in the constructor.

Parámetros
string$data
string$signature
Devuelve
bool|int

Definición en la línea 594 del archivo XMLSecurityKey.php.


La documentación para esta clase fue generada a partir del siguiente fichero: