TYPO3
7.6
Users
bogdan
Projects
Kapeli
Resources
Dash
Docsets
TYPO3
src
typo3
sysext
rsaauth
Classes
Keypair.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Rsaauth;
3
4
/*
5
* This file is part of the TYPO3 CMS project.
6
*
7
* It is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU General Public License, either version 2
9
* of the License, or any later version.
10
*
11
* For the full copyright and license information, please read the
12
* LICENSE.txt file that was distributed with this source code.
13
*
14
* The TYPO3 project - inspiring people to share!
15
*/
16
21
class
Keypair
implements
\TYPO3\CMS\Core\SingletonInterface
22
{
28
protected
$exponent
= 0;
29
35
protected
$privateKey
=
''
;
36
42
protected
$publicKeyModulus
= 0;
43
49
public
function
isReady
()
50
{
51
return
$this->
hasExponent
() && $this->
hasPrivateKey
() && $this->
hasPublicKeyModulus
();
52
}
53
59
public
function
getExponent
()
60
{
61
return
$this->exponent
;
62
}
63
73
public
function
setExponent
(
$exponent
)
74
{
75
if
($this->
hasExponent
()) {
76
throw
new \BadMethodCallException(
'setExponent() must not be called more than one time.'
, 1296062830);
77
}
78
79
$this->exponent =
$exponent
;
80
}
81
87
protected
function
hasExponent
()
88
{
89
return
$this->
getExponent
() !== 0;
90
}
91
97
public
function
getPrivateKey
()
98
{
99
return
$this->privateKey
;
100
}
101
111
public
function
setPrivateKey
(
$privateKey
)
112
{
113
if
($this->
hasPrivateKey
()) {
114
throw
new \BadMethodCallException(
'setPrivateKey() must not be called more than one time.'
, 1296062831);
115
}
116
117
$this->privateKey =
$privateKey
;
118
}
119
125
protected
function
hasPrivateKey
()
126
{
127
return
$this->
getPrivateKey
() !==
''
;
128
}
129
135
public
function
getPublicKeyModulus
()
136
{
137
return
$this->publicKeyModulus
;
138
}
139
149
public
function
setPublicKey
(
$publicKeyModulus
)
150
{
151
if
($this->
hasPublicKeyModulus
()) {
152
throw
new \BadMethodCallException(
'setPublicKey() must not be called more than one time.'
, 1296062832);
153
}
154
155
$this->publicKeyModulus =
$publicKeyModulus
;
156
}
157
163
protected
function
hasPublicKeyModulus
()
164
{
165
return
$this->
getPublicKeyModulus
() !== 0;
166
}
167
}
Generated on Wed Nov 11 2015 01:51:59 for TYPO3 by
1.8.3