ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\Certificate\X509 Class Reference

Specific Certificate Key. More...

+ Inheritance diagram for SAML2\Certificate\X509:
+ Collaboration diagram for SAML2\Certificate\X509:

Public Member Functions

 offsetSet ($offset, $value)
 {} Best place to ensure the logic is encapsulated in a single place More...
 
 getCertificate ()
 Get the certificate representation. More...
 
 getFingerprint ()
 
- Public Member Functions inherited from SAML2\Certificate\Key
 __construct (array $keyData)
 
 canBeUsedFor ($usage)
 Whether or not the key is configured to be used for usage given. More...
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 

Static Public Member Functions

static createFromCertificateData ($certificateContents)
 
- Static Public Member Functions inherited from SAML2\Certificate\Key
static getValidKeyUsages ()
 Returns the list of valid key usage options. More...
 

Private Attributes

 $fingerprint
 

Additional Inherited Members

- Data Fields inherited from SAML2\Certificate\Key
const USAGE_SIGNING = 'signing'
 
const USAGE_ENCRYPTION = 'encryption'
 
- Protected Member Functions inherited from SAML2\Certificate\Key
 assertIsString ($test)
 Asserts that the parameter is of type string. More...
 
- Protected Attributes inherited from SAML2\Certificate\Key
 $keyData = array()
 

Detailed Description

Specific Certificate Key.

Definition at line 8 of file X509.php.

Member Function Documentation

◆ createFromCertificateData()

static SAML2\Certificate\X509::createFromCertificateData (   $certificateContents)
static

Definition at line 15 of file X509.php.

16 {
17 $data = array(
18 'encryption' => true,
19 'signing' => true,
20 'type' => 'X509Certificate',
21 'X509Certificate' => $certificateContents
22 );
23
24 return new self($data);
25 }

References $data.

Referenced by SAML2\Certificate\KeyLoader\loadCertificateData(), and SAML2\Certificate\KeyLoader\loadCertificateFile().

+ Here is the caller graph for this function:

◆ getCertificate()

SAML2\Certificate\X509::getCertificate ( )

Get the certificate representation.

Returns
string

Definition at line 44 of file X509.php.

45 {
46 return "-----BEGIN CERTIFICATE-----\n"
47 . chunk_split($this->keyData['X509Certificate'], 64)
48 . "-----END CERTIFICATE-----\n";
49 }

◆ getFingerprint()

SAML2\Certificate\X509::getFingerprint ( )
Returns
\SAML2\Certificate\Fingerprint
Deprecated:
Please use full certificates instead.

Definition at line 56 of file X509.php.

57 {
58 if (isset($this->fingerprint)) {
59 return $this->fingerprint;
60 }
61
62 $fingerprint = strtolower(sha1(base64_decode($this->keyData['X509Certificate'])));
63
64 return $this->fingerprint = new Fingerprint($fingerprint);
65 }

References SAML2\Certificate\X509\$fingerprint.

◆ offsetSet()

SAML2\Certificate\X509::offsetSet (   $offset,
  $value 
)

{} Best place to ensure the logic is encapsulated in a single place

Reimplemented from SAML2\Certificate\Key.

Definition at line 30 of file X509.php.

31 {
32 if ($offset === 'X509Certificate') {
33 $value = preg_replace('~\s+~', '', $value);
34 }
35
36 parent::offsetSet($offset, $value);
37 }

Field Documentation

◆ $fingerprint

SAML2\Certificate\X509::$fingerprint
private

Definition at line 13 of file X509.php.

Referenced by SAML2\Certificate\X509\getFingerprint().


The documentation for this class was generated from the following file: