Scalr\Service\Aws\Ec2\V20150415\Ec2Api::createKeyPair PHP Метод

createKeyPair() публичный Метод

Creates a new 2048-bit RSA key pair with the specified name. The public key is stored by Amazon EC2 and the private key is returned to you. The private key is returned as an unencrypted PEM encoded PKCS#8 private key. If a key with the specified name already exists, Amazon EC2 returns an error. Tip! The key pair returned to you works only in the region you're using when you create the key pair. To create a key pair that works in all regions, use ImportKeyPair
public createKeyPair ( string $keyName ) : Scalr\Service\Aws\Ec2\DataType\KeyPairData
$keyName string A unique name for the key pair.
Результат Scalr\Service\Aws\Ec2\DataType\KeyPairData Returns KeyPairData on success
    public function createKeyPair($keyName)
    {
        $result = null;
        $options = ['KeyName' => (string) $keyName];
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = new KeyPairData();
            $result->setEc2($this->ec2);
            $result->keyName = (string) $sxml->keyName;
            $result->keyFingerprint = (string) $sxml->keyFingerprint;
            $result->keyMaterial = (string) $sxml->keyMaterial;
        }
        return $result;
    }
Ec2Api