public function __construct(KeyStorageInterface $storage)
 {
     $this->setKeyStorage($storage);
     parent::__construct('netglue_key_generation');
     $this->add(array('name' => 'keyName', 'type' => 'text', 'options' => array('label' => 'Key Pair Name'), 'attributes' => array('id' => 'keyName', 'title' => 'Provide a unique name for the new encrytion keys')));
     $this->add(array('name' => 'keyPassPhrase', 'type' => 'password', 'options' => array('label' => 'Pass Phrase'), 'attributes' => array('id' => 'keyPassPhrase', 'title' => 'Provide a password used to encrypt your private key')));
     $this->add($this->getHashSelect('digestAlgo'));
     $this->add($this->getKeySizeSelect('keySize'));
     $this->add($this->getOutputSelect('outputType'));
     $this->add(array('name' => 'saveKeys', 'type' => 'button', 'attributes' => array('id' => 'saveKeys', 'type' => 'submit'), 'options' => array('label' => 'Generate Keys')));
 }
Example #2
0
 public function setKeyStorage(KeyStorageInterface $storage)
 {
     parent::setKeyStorage($storage);
     $this->add($this->getKeyListSelect('keyName'));
     $this->add(array('name' => 'keyPassPhrase', 'type' => 'password', 'options' => array('label' => 'Pass Phrase'), 'attributes' => array('id' => 'keyPassPhrase', 'title' => 'Provide the password associated with your private key')));
     $dir = new \Zend\Form\Element\Select('direction');
     $dir->setAttributes(array('id' => 'direction'));
     $opt = array('encrypt' => 'Encrypt', 'decrypt' => 'Decrypt');
     $dir->setValueOptions($opt);
     $dir->setLabel('Encrypt or Decrypt');
     $this->add($dir);
     $out = $this->getOutputSelect('outputType');
     $out->setLabel('Set encrypted output format');
     $this->add($out);
     $this->add(array('name' => 'sourceText', 'type' => 'textarea', 'options' => array('label' => 'Input Text'), 'attributes' => array('id' => 'sourceText')));
     $this->add(array('name' => 'processText', 'type' => 'button', 'attributes' => array('id' => 'processText', 'type' => 'submit'), 'options' => array('label' => 'Encrypt/Decrypt')));
 }
 public function __construct()
 {
     parent::__construct('netglue_encrypt_set_pass');
     $this->add(array('name' => 'keyPassPhrase', 'type' => 'password', 'options' => array('label' => 'Pass Phrase'), 'attributes' => array('id' => 'keyPassPhrase', 'title' => 'Provide the password associated with your private key')));
     $this->add(array('name' => 'setPass', 'type' => 'button', 'attributes' => array('id' => 'setPass', 'type' => 'submit'), 'options' => array('label' => 'Set Pass Phrase')));
 }