RSASSA-PSS (RFC 8017, 8.1), the signature scheme of the seals for an RSA key, with MGF1 over the digest of the message (9.1, B.2.1).
openssl_sign() and openssl_verify() take no padding parameter: they
sign and verify with PKCS#1 v1.5 only. The encoding EMSA-PSS is therefore
written here, and the RSA operation itself is left to OpenSSL, without
padding (OPENSSL_NO_PADDING): openssl_private_encrypt() computes the
signature of the encoded message, openssl_public_decrypt() gives back the
encoded message of a signature. The encoded message is one bit shorter than
the modulus, its leftmost bits cleared: as a number, it is smaller than the
modulus, which OpenSSL requires.
| Methods | ||
|---|---|---|
public
static
|
sign(string $data, resource|OpenSSLAsymmetricKey $privateKey, string $hash, int|null $saltLength = null): string
|
# |
public
static
|
verify(
string $data,
string $signature,
resource|OpenSSLAsymmetricKey $publicKey,
string $hash,
int|null $saltLength = null,
): boolean
|
# |
| Constants | |||
|---|---|---|---|
public
|
TRAILER = "\xbc"
|
# | |