Beispiel #1
0
 /**
  * Create action.  Creates a new key and redirects back to the index action.
  */
 public function createAction()
 {
     $name = $this->_getParam('name');
     $secret = $this->_getParam('secret');
     if ($secret === '') {
         $secret = null;
     }
     CryptoModel::generateNewRijndael256Key($name, $secret);
     $this->flash('notice', 'New key successfully created');
     $this->_redirector->gotoRoute(array('action' => 'index'));
 }
Beispiel #2
0
 public function testDuplicateProfileNameProducesException()
 {
     CryptoModel::generateNewRijndael256Key('testdupe');
     try {
         CryptoModel::generateNewRijndael256Key('testdupe');
     } catch (Exception $e) {
         return;
     }
     $this->fail('Generating another key profile with the same name should throw an exception');
 }