TYPO3 API  SVNRelease
class.tx_rsaauth_keypair.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2009-2011 Dmitry Dulepov <dmitry@typo3.org>
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *
00017 *  This script is distributed in the hope that it will be useful,
00018 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 *  GNU General Public License for more details.
00021 *
00022 *  This copyright notice MUST APPEAR in all copies of the script!
00023 ***************************************************************/
00024 
00025 /**
00026  * [CLASS/FUNCTION INDEX of SCRIPT]
00027  *
00028  * $Id: class.tx_rsaauth_keypair.php 10120 2011-01-18 20:03:36Z ohader $
00029  */
00030 
00031 
00032 /**
00033  * This class contain an RSA keypair class. Its purpose is to keep to keys
00034  * and trasnfer these keys between other PHP classes.
00035  *
00036  * @author  Dmitry Dulepov <dmitry@typo3.org>
00037  * @package TYPO3
00038  * @subpackage  tx_rsaauth
00039  */
00040 final class tx_rsaauth_keypair {
00041 
00042     /**
00043      * RSA public exponent (3 or 0x10001)
00044      *
00045      * @var int
00046      */
00047     protected   $exponent = 0x10001;
00048 
00049     /**
00050      * The private key
00051      *
00052      * @var string
00053      */
00054     protected   $privateKey = '';
00055 
00056     /**
00057      * The public key modulus
00058      *
00059      * @var string
00060      */
00061     protected   $publicKeyModulus = '';
00062 
00063     /**
00064      * Retrieves the exponent.
00065      *
00066      * @return  string  The exponent
00067      */
00068     public function getExponent() {
00069         return $this->exponent;
00070     }
00071 
00072     /**
00073      * Sets the private key
00074      *
00075      * @param   string  $privateKey The new private key
00076      * @return  void
00077      */
00078     public function setExponent($exponent) {
00079         $this->exponent = $exponent;
00080     }
00081 
00082     /**
00083      * Retrieves the private key.
00084      *
00085      * @return  string  The private key
00086      */
00087     public function getPrivateKey() {
00088         return $this->privateKey;
00089     }
00090 
00091     /**
00092      * Sets the private key
00093      *
00094      * @param   string  $privateKey The new private key
00095      * @return  void
00096      */
00097     public function setPrivateKey($privateKey) {
00098         $this->privateKey = $privateKey;
00099     }
00100 
00101     /**
00102      * Retrieves the public key modulus
00103      *
00104      * @return  string  The public key modulus
00105      */
00106     public function getPublicKeyModulus() {
00107         return $this->publicKeyModulus;
00108     }
00109 
00110     /**
00111      * Sets the public key modulus
00112      *
00113      * @param   string  $publicKeyModulus   The new public key modulus
00114      * @return  void
00115      */
00116     public function setPublicKey($publicKeyModulus) {
00117         $this->publicKeyModulus = $publicKeyModulus;
00118     }
00119 }
00120 
00121 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/rsaauth/sv1/backends/class.tx_rsaauth_keypair.php'])) {
00122     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/rsaauth/sv1/backends/class.tx_rsaauth_keypair.php']);
00123 }
00124 
00125 ?>