コード例 #1
0
 /**
  * Getter for the value of the private number
  *
  * @param string $type
  * @return string
  */
 public function getPrivateKey($type = self::NUMBER)
 {
     if (!$this->hasPrivateKey()) {
         $this->setPrivateKey($this->_generatePrivateKey(), self::BINARY);
     }
     if ($type == self::BINARY) {
         return $this->_math->toBinary($this->_privateKey);
     } elseif ($type == self::BTWOC) {
         return $this->_math->btwoc($this->_math->toBinary($this->_privateKey));
     }
     return $this->_privateKey;
 }