TYPO3 CMS  TYPO3_6-2
Keypair.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Rsaauth;
3 
29  protected $exponent = 0;
30 
36  protected $privateKey = '';
37 
43  protected $publicKeyModulus = 0;
44 
50  public function isReady() {
51  return $this->hasExponent() && $this->hasPrivateKey() && $this->hasPublicKeyModulus();
52  }
53 
59  public function getExponent() {
60  return $this->exponent;
61  }
62 
74  public function setExponent($exponent) {
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  return $this->getExponent() !== 0;
89  }
90 
96  public function getPrivateKey() {
97  return $this->privateKey;
98  }
99 
111  public function setPrivateKey($privateKey) {
112  if ($this->hasPrivateKey()) {
113  throw new \BadMethodCallException('setPrivateKey() must not be called more than one time.', 1296062831);
114  }
115 
116  $this->privateKey = $privateKey;
117  }
118 
124  protected function hasPrivateKey() {
125  return $this->getPrivateKey() !== '';
126  }
127 
133  public function getPublicKeyModulus() {
135  }
136 
148  public function setPublicKey($publicKeyModulus) {
149  if ($this->hasPublicKeyModulus()) {
150  throw new \BadMethodCallException('setPublicKey() must not be called more than one time.', 1296062832);
151  }
152 
153  $this->publicKeyModulus = $publicKeyModulus;
154  }
155 
161  protected function hasPublicKeyModulus() {
162  return $this->getPublicKeyModulus() !== 0;
163  }
164 }
setExponent($exponent)
Definition: Keypair.php:74
setPrivateKey($privateKey)
Definition: Keypair.php:111
setPublicKey($publicKeyModulus)
Definition: Keypair.php:148