TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Rsaauth\Backend\AbstractBackend Class Reference
Inheritance diagram for TYPO3\CMS\Rsaauth\Backend\AbstractBackend:
tx_rsaauth_abstract_backend TYPO3\CMS\Rsaauth\Backend\CommandLineBackend TYPO3\CMS\Rsaauth\Backend\PhpBackend tx_rsaauth_cmdline_backend tx_rsaauth_php_backend

Public Member Functions

 createNewKeyPair ()
 
 decrypt ($privateKey, $data)
 
 isAvailable ()
 
 getLastError ()
 

Protected Attributes

 $error = ''
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! This class contains an abstract SSL backend for the TYPO3 RSA authentication service.

There are two steps:

  • prepare data for encoding
  • decode incoming data

To prepare data for encoding, the createNewKeyPair() method should be called. This method returns an instance of class, which contains the private and public keys. Public key is sent to the client to encode data. Private key should be stored somewhere (preferably in user's session).

To decode data, the decrypt() method should be called with the private key created at the previous step and the data to decode. If the data is decoded successfully, the result is a string. Otherwise it is NULL.

Author
Dmitry Dulepov dmitr.nosp@m.y@ty.nosp@m.po3.o.nosp@m.rg

Definition at line 35 of file AbstractBackend.php.

Member Function Documentation

◆ createNewKeyPair()

TYPO3\CMS\Rsaauth\Backend\AbstractBackend::createNewKeyPair ( )
abstract

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
|NULL a key pair or NULL in case of error

Referenced by TYPO3\CMS\Rsaauth\Backend\CommandLineBackend\__construct().

◆ decrypt()

TYPO3\CMS\Rsaauth\Backend\AbstractBackend::decrypt (   $privateKey,
  $data 
)
abstract

Decripts the data using the private key.

Parameters
string$privateKeyThe private key (obtained from a call to createNewKeyPair())
string$dataData to decrypt (base64-encoded)
Returns
string Decrypted data or NULL in case of a error

◆ getLastError()

TYPO3\CMS\Rsaauth\Backend\AbstractBackend::getLastError ( )

Retrieves a error message.

Returns
string A error message or empty string if there were no error

Definition at line 76 of file AbstractBackend.php.

References TYPO3\CMS\Rsaauth\Backend\AbstractBackend\$error.

◆ isAvailable()

TYPO3\CMS\Rsaauth\Backend\AbstractBackend::isAvailable ( )
abstract

Checks if this backend is available for calling.

Returns
void

Member Data Documentation

◆ $error

TYPO3\CMS\Rsaauth\Backend\AbstractBackend::$error = ''
protected