Пример #1
0
 public function testConstructorLoadsPassphrasedKeys()
 {
     $rsa = new RSA();
     $config = array('privateKeyBits' => 512, 'passPhrase' => '0987654321');
     $keys = $rsa->generateKeys($config);
     try {
         $rsa = new RSA(array('passPhrase' => '0987654321', 'pemString' => $keys->privateKey->toString()));
     } catch (Crypt\Exception $e) {
         $this->fail('Passphrase loading failed of a private key');
     }
 }
Пример #2
0
 public function testConstructorLoadsPassphrasedKeys()
 {
     if (!$this->openSslConf) {
         $this->markTestSkipped('No openssl.cnf found or defined; cannot generate keys');
     }
     $rsa = new RSA();
     $config = array('config' => $this->openSslConf, 'privateKeyBits' => 512, 'passPhrase' => '0987654321');
     $keys = $rsa->generateKeys($config);
     try {
         $rsa = new RSA(array('passPhrase' => '0987654321', 'pemString' => $keys->privateKey->toString()));
     } catch (Crypt\Exception $e) {
         $this->fail('Passphrase loading failed of a private key');
     }
 }