abstract class OpenSSH extends OpenSSH (View source)

OpenSSH Formatted RSA Key Handler

Properties

static protected string $comment Default comment from  OpenSSH
static protected bool $binary Binary key flag from  OpenSSH
static protected array $types Supported Key Types

Methods

static 
setComment(string $comment)

Sets the default comment

from  OpenSSH
static array
load(string $key, string $password = '')

Break a public or private key down into its constituent components

static 
setBinaryOutput(bool $enabled)

Toggle between binary and printable keys

from  OpenSSH
static string
wrapPrivateKey(string $publicKey, string $privateKey, string $password, array $options)

Wrap a private key appropriately

from  OpenSSH
static string
savePublicKey(BigInteger $n, BigInteger $e, array $options = [])

Convert a public key to the appropriate format

static string
savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, string $password = '', array $options = [])

Convert a private key to the appropriate format.

Details

static setComment(string $comment)

Sets the default comment

Parameters

string $comment

static array load(string $key, string $password = '')

Break a public or private key down into its constituent components

Parameters

string $key
string $password

Return Value

array

static setBinaryOutput(bool $enabled)

Toggle between binary and printable keys

Printable keys are what are generated by default. These are the ones that go in $HOME/.ssh/authorized_key.

Parameters

bool $enabled

static protected string wrapPrivateKey(string $publicKey, string $privateKey, string $password, array $options)

Wrap a private key appropriately

Parameters

string $publicKey
string $privateKey
string $password
array $options

Return Value

string

static string savePublicKey(BigInteger $n, BigInteger $e, array $options = [])

Convert a public key to the appropriate format

Parameters

BigInteger $n
BigInteger $e
array $options optional

Return Value

string

static string savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, string $password = '', array $options = [])

Convert a private key to the appropriate format.

Parameters

BigInteger $n
BigInteger $e
BigInteger $d
array $primes
array $exponents
array $coefficients
string $password optional
array $options optional

Return Value

string