OpenSSH
extends OpenSSH
in package
AbstractYes
OpenSSH Formatted RSA Key Handler
Tags
Table of Contents
Properties
- $binary : bool
- Binary key flag
- $comment : string
- Default comment
- $types : array<string|int, mixed>
- Supported Key Types
Methods
- load() : array<string|int, mixed>
- Break a public or private key down into its constituent components
- savePrivateKey() : string
- Convert a private key to the appropriate format.
- savePublicKey() : string
- Convert a public key to the appropriate format
- setBinaryOutput() : mixed
- Toggle between binary and printable keys
- setComment() : mixed
- Sets the default comment
- wrapPrivateKey() : string
- Wrap a private key appropriately
- checkType() : mixed
- Checks to see if the type is valid
Properties
$binary
Binary key flag
protected
static bool
$binary
= false
Tags
$comment
Default comment
protected
static string
$comment
= 'phpseclib-generated-key'
Tags
$types
Supported Key Types
protected
static array<string|int, mixed>
$types
= ['ssh-rsa']
Methods
load()
Break a public or private key down into its constituent components
public
static load(string $key[, string $password = '' ]) : array<string|int, mixed>
Parameters
- $key : string
- $password : string = ''
-
optional
Tags
Return values
array<string|int, mixed>savePrivateKey()
Convert a private key to the appropriate format.
public
static savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array<string|int, mixed> $primes, array<string|int, mixed> $exponents, array<string|int, mixed> $coefficients[, string $password = '' ][, array<string|int, mixed> $options = [] ]) : string
Parameters
- $n : BigInteger
- $e : BigInteger
- $d : BigInteger
- $primes : array<string|int, mixed>
- $exponents : array<string|int, mixed>
- $coefficients : array<string|int, mixed>
- $password : string = ''
-
optional
- $options : array<string|int, mixed> = []
-
optional
Tags
Return values
stringsavePublicKey()
Convert a public key to the appropriate format
public
static savePublicKey(BigInteger $n, BigInteger $e[, array<string|int, mixed> $options = [] ]) : string
Parameters
- $n : BigInteger
- $e : BigInteger
- $options : array<string|int, mixed> = []
-
optional
Tags
Return values
stringsetBinaryOutput()
Toggle between binary and printable keys
public
static setBinaryOutput(bool $enabled) : mixed
Printable keys are what are generated by default. These are the ones that go in $HOME/.ssh/authorized_key.
Parameters
- $enabled : bool
Tags
setComment()
Sets the default comment
public
static setComment(string $comment) : mixed
Parameters
- $comment : string
Tags
wrapPrivateKey()
Wrap a private key appropriately
protected
static wrapPrivateKey(string $publicKey, string $privateKey, string $password, array<string|int, mixed> $options) : string
Parameters
- $publicKey : string
- $privateKey : string
- $password : string
- $options : array<string|int, mixed>
Tags
Return values
stringcheckType()
Checks to see if the type is valid
private
static checkType(string $candidate) : mixed
Parameters
- $candidate : string