[TASK] Remove function index
[Packages/TYPO3.CMS.git] / typo3 / sysext / rsaauth / sv1 / backends / class.tx_rsaauth_keypair.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009-2011 Dmitry Dulepov <dmitry@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25
26 /**
27 * This class contain an RSA keypair class. Its purpose is to keep to keys
28 * and trasnfer these keys between other PHP classes.
29 *
30 * @author Dmitry Dulepov <dmitry@typo3.org>
31 * @package TYPO3
32 * @subpackage tx_rsaauth
33 */
34 final class tx_rsaauth_keypair {
35
36 /**
37 * RSA public exponent (3 or 0x10001)
38 *
39 * @var int
40 */
41 protected $exponent = 0x10001;
42
43 /**
44 * The private key
45 *
46 * @var string
47 */
48 protected $privateKey = '';
49
50 /**
51 * The public key modulus
52 *
53 * @var string
54 */
55 protected $publicKeyModulus = '';
56
57 /**
58 * Retrieves the exponent.
59 *
60 * @return string The exponent
61 */
62 public function getExponent() {
63 return $this->exponent;
64 }
65
66 /**
67 * Sets the private key
68 *
69 * @param string $privateKey The new private key
70 * @return void
71 */
72 public function setExponent($exponent) {
73 $this->exponent = $exponent;
74 }
75
76 /**
77 * Retrieves the private key.
78 *
79 * @return string The private key
80 */
81 public function getPrivateKey() {
82 return $this->privateKey;
83 }
84
85 /**
86 * Sets the private key
87 *
88 * @param string $privateKey The new private key
89 * @return void
90 */
91 public function setPrivateKey($privateKey) {
92 $this->privateKey = $privateKey;
93 }
94
95 /**
96 * Retrieves the public key modulus
97 *
98 * @return string The public key modulus
99 */
100 public function getPublicKeyModulus() {
101 return $this->publicKeyModulus;
102 }
103
104 /**
105 * Sets the public key modulus
106 *
107 * @param string $publicKeyModulus The new public key modulus
108 * @return void
109 */
110 public function setPublicKey($publicKeyModulus) {
111 $this->publicKeyModulus = $publicKeyModulus;
112 }
113 }
114
115 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/rsaauth/sv1/backends/class.tx_rsaauth_keypair.php'])) {
116 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/rsaauth/sv1/backends/class.tx_rsaauth_keypair.php']);
117 }
118
119 ?>