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

Public Member Functions

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

Public Attributes

const DEFAULT_EXPONENT = 65537
 

Protected Attributes

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

Detailed Description

This class contains an OpenSSL backend for the TYPO3 RSA authentication service. It uses shell version of OpenSSL to perform tasks. See class \TYPO3\CMS\Rsaauth\Backend\AbstractBackend for the information on using backends.

Definition at line 28 of file CommandLineBackend.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::__construct ( )

Creates an instance of this class. It obtains a path to the OpenSSL binary.

Definition at line 53 of file CommandLineBackend.php.

References TYPO3\CMS\Core\Utility\CommandUtility\getCommand(), and TYPO3\CMS\Core\Core\Environment\getVarPath().

Member Function Documentation

◆ __wakeup()

TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::__wakeup ( )

Denies deserialization.

Definition at line 68 of file CommandLineBackend.php.

◆ createNewKeyPair()

TYPO3 CMS Rsaauth Keypair null TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::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 87 of file CommandLineBackend.php.

References TYPO3\CMS\Core\Utility\CommandUtility\exec(), TYPO3\CMS\Core\Utility\StringUtility\getUniqueId(), and TYPO3\CMS\Core\Core\Environment\isWindows().

◆ decrypt()

string TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::decrypt (   $privateKey,
  $data 
)
Parameters
string$privateKey‪The private key (obtained from a call to createNewKeyPair())
string$data‪Data to decrypt (base64-encoded)
Returns
‪string 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 141 of file CommandLineBackend.php.

References $output, TYPO3\CMS\Core\Utility\CommandUtility\exec(), and TYPO3\CMS\Core\Utility\StringUtility\getUniqueId().

◆ isAvailable()

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

Checks if command line version of the OpenSSL is available and can be executed successfully.

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

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

Definition at line 166 of file CommandLineBackend.php.

References TYPO3\CMS\Core\Utility\CommandUtility\exec().

Member Data Documentation

◆ $opensslPath

string bool TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::$opensslPath
protected

A path to the openssl binary or FALSE if the binary does not exist

Definition at line 39 of file CommandLineBackend.php.

◆ $temporaryDirectory

string TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::$temporaryDirectory
protected

Temporary directory. It is best of it is outside of the web site root and not publicly readable. For now we use Environment::getVarPath() . '/transient' (stored in the variable without the trailing slash).

Definition at line 47 of file CommandLineBackend.php.

◆ DEFAULT_EXPONENT

const TYPO3\CMS\Rsaauth\Backend\CommandLineBackend::DEFAULT_EXPONENT = 65537