PHP Class XMLSecurityKey

Datei anzeigen Open project: onelogin/php-saml Class Usage Examples

Public Properties

Property Type Description
$encryptedCtx
$guid
$isEncrypted
$iv
$key
$keyChain
$name
$passphrase
$type

Public Methods

Method Description
__construct ( $type, $params = null )
convertRSA ( $modulus, $exponent ) * Modulus and Exponent must already be base64 decoded
decryptData ( $data )
encryptData ( $data )
fromEncryptedKeyElement ( DOMElement $element ) : XMLSecurityKey Create key from an EncryptedKey-element.
generateSessionKey ( )
getAlgorithm ( )
getRawThumbprint ( $cert )
getSymmetricKeySize ( ) : integer | null Retrieve the key size for the symmetric encryption algorithm.
getX509Certificate ( ) : The Retrieve the X509 certificate this key represents.
getX509Thumbprint ( ) * Get the thumbprint of this X509 certificate.
loadKey ( $key, $isFile = false, $isCert = false )
makeAsnSegment ( $type, $string )
serializeKey ( $parent )
signData ( $data )
verifySignature ( $data, $signature )

Private Methods

Method Description
decryptMcrypt ( $data )
decryptOpenSSL ( $data )
encryptMcrypt ( $data )
encryptOpenSSL ( $data )
signOpenSSL ( $data )
verifyOpenSSL ( $data, $signature )

Method Details

__construct() public method

public __construct ( $type, $params = null )

convertRSA() static public method

* Modulus and Exponent must already be base64 decoded
static public convertRSA ( $modulus, $exponent )

decryptData() public method

public decryptData ( $data )

encryptData() public method

public encryptData ( $data )

fromEncryptedKeyElement() public static method

Create key from an EncryptedKey-element.
public static fromEncryptedKeyElement ( DOMElement $element ) : XMLSecurityKey
$element DOMElement The EncryptedKey-element.
return XMLSecurityKey The new key.

generateSessionKey() public method

public generateSessionKey ( )

getAlgorithm() public method

public getAlgorithm ( )

getRawThumbprint() public static method

public static getRawThumbprint ( $cert )

getSymmetricKeySize() public method

. If the key size is unknown, or this isn't a symmetric encryption algorithm, null is returned.
public getSymmetricKeySize ( ) : integer | null
return integer | null The number of bytes in the key.

getX509Certificate() public method

Will return the X509 certificate in PEM-format if this key represents an X509 certificate.
public getX509Certificate ( ) : The
return The X509 certificate or null if this key doesn't represent an X509-certificate.

getX509Thumbprint() public method

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

loadKey() public method

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

makeAsnSegment() static public method

static public makeAsnSegment ( $type, $string )

serializeKey() public method

public serializeKey ( $parent )

signData() public method

public signData ( $data )

verifySignature() public method

public verifySignature ( $data, $signature )

Property Details

$encryptedCtx public_oe property

public $encryptedCtx

$guid public_oe property

public $guid

$isEncrypted public_oe property

public $isEncrypted

$iv public_oe property

public $iv

$key public_oe property

public $key

$keyChain public_oe property

public $keyChain

$name public_oe property

public $name

$passphrase public_oe property

public $passphrase

$type public_oe property

public $type