‪TYPO3CMS  9.5
TYPO3\CMS\Rsaauth\Backend\PhpBackend Class Reference
Inheritance diagram for TYPO3\CMS\Rsaauth\Backend\PhpBackend:
TYPO3\CMS\Rsaauth\Backend\AbstractBackend

Public Member Functions

TYPO3 CMS Rsaauth Keypair null createNewKeyPair ()
 
string null decrypt ($privateKey, $data)
 
bool isAvailable ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Rsaauth\Backend\AbstractBackend
string getLastError ()
 

Protected Member Functions

int extractExponent ($data)
 
string extractPublicKeyModulus ($data)
 

Additional Inherited Members

- ‪Protected Attributes inherited from ‪TYPO3\CMS\Rsaauth\Backend\AbstractBackend
string $error = ''
 

Detailed Description

This class contains a PHP OpenSSL backend for the TYPO3 RSA authentication service. See class \TYPO3\CMS\Rsaauth\Backend\AbstractBackend for the information on using backends.

Definition at line 22 of file PhpBackend.php.

Member Function Documentation

◆ createNewKeyPair()

TYPO3 CMS Rsaauth Keypair null TYPO3\CMS\Rsaauth\Backend\PhpBackend::createNewKeyPair ( )

Creates a new key pair for the encryption or gets the existing key pair (if one already has been generated).

There should only be one key pair per request because the second private key would overwrites the first private key. So the submitting the form with the first public key would not work anymore.

Returns
‪\TYPO3\CMS\Rsaauth\Keypair|null a key pair or NULL in case of error

Reimplemented from TYPO3\CMS\Rsaauth\Backend\AbstractBackend.

Definition at line 32 of file PhpBackend.php.

References TYPO3\CMS\Rsaauth\Backend\PhpBackend\extractExponent(), and TYPO3\CMS\Rsaauth\Backend\PhpBackend\extractPublicKeyModulus().

◆ decrypt()

string null TYPO3\CMS\Rsaauth\Backend\PhpBackend::decrypt (   $privateKey,
  $data 
)

Decrypts data using the private key. This implementation uses PHP OpenSSL extension.

Parameters
string$privateKey‪The private key (obtained from a call to createNewKeyPair())
string$data‪Data to decrypt (base64-encoded)
Returns
‪string|null Decrypted data or NULL in case of an error
See also
‪\TYPO3\CMS\Rsaauth\Backend\AbstractBackend::decrypt()

Reimplemented from TYPO3\CMS\Rsaauth\Backend\AbstractBackend.

Definition at line 77 of file PhpBackend.php.

◆ extractExponent()

int TYPO3\CMS\Rsaauth\Backend\PhpBackend::extractExponent (   $data)
protected

Extracts the exponent from the OpenSSL CSR

Parameters
string$data‪The result of openssl_csr_export()
Returns
‪int The exponent as a number

Definition at line 115 of file PhpBackend.php.

Referenced by TYPO3\CMS\Rsaauth\Backend\PhpBackend\createNewKeyPair().

◆ extractPublicKeyModulus()

string TYPO3\CMS\Rsaauth\Backend\PhpBackend::extractPublicKeyModulus (   $data)
protected

Extracts public key modulus from the OpenSSL CSR.

Parameters
string$data‪The result of openssl_csr_export()
Returns
‪string Modulus as uppercase hex string

Definition at line 129 of file PhpBackend.php.

Referenced by TYPO3\CMS\Rsaauth\Backend\PhpBackend\createNewKeyPair().

◆ isAvailable()

bool TYPO3\CMS\Rsaauth\Backend\PhpBackend::isAvailable ( )

Checks if this backend is available for calling. In particular checks if PHP OpenSSl extension is installed and functional.

Returns
‪bool
See also
‪\TYPO3\CMS\Rsaauth\Backend\AbstractBackend::isAvailable()

Reimplemented from TYPO3\CMS\Rsaauth\Backend\AbstractBackend.

Definition at line 93 of file PhpBackend.php.