get() public static method

public static get ( $privateKeyFile )
コード例 #1
0
ファイル: Instance.php プロジェクト: AOEpeople/StackFormation
 public function getPrivateKey()
 {
     $keyName = $this->getKeyName();
     if (empty($keyName)) {
         return null;
         // throw new \Exception('No KeyName found');
     }
     return PrivateKey::get('keys/' . $keyName . '.pem');
 }
コード例 #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $key = $input->getArgument('key');
     $identity = new \AwsInspector\Ssh\Identity(\AwsInspector\Ssh\PrivateKey::get($key), true);
     $identity->loadIdentity();
 }
コード例 #3
0
 /**
  * @test
  */
 public function withPrivateKey()
 {
     $connection = new Connection('TestUsername', '1.2.3.4', PrivateKey::get(FIXTURE_ROOT . 'foo.pem'));
     $this->assertEquals('ssh -i ' . FIXTURE_ROOT . 'foo.pem -o ConnectTimeout=5 -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null TestUsername@1.2.3.4', $connection->__toString());
 }