class OpenSslSigner implements Signer

Reuse parsed keys without duplicating lcobucci's ECDSA signature conversion.

This depends on its internal algorithm(), pointLength(), expectedKeyLength() and SignatureConverter / MultibyteStringConverter APIs. Check OpenSslSignerTest's interoperability cases when upgrading lcobucci.

Constants

protected MINIMUM_RSA_BITS

protected KEY_TYPES

Properties

protected SignatureConverter|null $converter

Methods

__construct(Rsa|Ecdsa $signer)

Reuse parsed keys with lcobucci's RSA and ECDSA algorithm definitions.

string
algorithmId()

Return the JWT algorithm identifier.

string
sign(string $payload, Key $key)

Sign the payload with the supplied key.

bool
verify(string $expected, string $payload, Key $key)

Verify the signature with the supplied key.

void
validateKey(ParsedKey $key)

Apply lcobucci's type and size requirements to the supplied key.

Details

at line 40
__construct(Rsa|Ecdsa $signer)

Reuse parsed keys with lcobucci's RSA and ECDSA algorithm definitions.

Parameters

Rsa|Ecdsa $signer

at line 50
string algorithmId()

Return the JWT algorithm identifier.

Return Value

string

at line 61
string sign(string $payload, Key $key)

Sign the payload with the supplied key.

Parameters

string $payload
Key $key

Return Value

string

at line 84
bool verify(string $expected, string $payload, Key $key)

Verify the signature with the supplied key.

Parameters

string $expected
string $payload
Key $key

Return Value

bool

at line 106
protected void validateKey(ParsedKey $key)

Apply lcobucci's type and size requirements to the supplied key.

Parameters

ParsedKey $key

Return Value

void