final class ParsedKey implements Key

Constants

private MINIMUM_KEY_LENGTH

private KEY_TYPES

Methods

static ParsedKey
fromPrivateKey(string $contents, string $passphrase = '')

Parse a private key once for repeated signing.

static ParsedKey
fromPublicKey(string $contents)

Parse a public key once for repeated verification.

string
contents()

Return the original PEM contents.

string
passphrase()

Return the private key's passphrase.

OpenSSLAsymmetricKey
getKey()

Return the parsed OpenSSL key.

string
getPublicKey()

Return the public key's PEM contents.

string
getKeyId()

Return the public key's JWK thumbprint.

array
getJwk()

Return the public JSON Web Key.

static string
opensslErrors()

Collect the OpenSSL errors for a failed key or signature operation.

Details

at line 73
static ParsedKey fromPrivateKey(string $contents, string $passphrase = '')

Parse a private key once for repeated signing.

Parameters

string $contents
string $passphrase

Return Value

ParsedKey

at line 81
static ParsedKey fromPublicKey(string $contents)

Parse a public key once for repeated verification.

Parameters

string $contents

Return Value

ParsedKey

at line 91
string contents()

Return the original PEM contents.

Return Value

string

at line 99
string passphrase()

Return the private key's passphrase.

Return Value

string

at line 107
OpenSSLAsymmetricKey getKey()

Return the parsed OpenSSL key.

Return Value

OpenSSLAsymmetricKey

at line 115
string getPublicKey()

Return the public key's PEM contents.

Return Value

string

at line 123
string getKeyId()

Return the public key's JWK thumbprint.

Return Value

string

at line 133
array getJwk()

Return the public JSON Web Key.

Return Value

array

at line 149
static string opensslErrors()

Collect the OpenSSL errors for a failed key or signature operation.

Return Value

string