Emarref\Jwt\Algorithm\RsaSsaPkcs::sign PHP Method

sign() public method

public sign ( string $value, string | resource $privateKey ) : string
$value string
$privateKey string | resource
return string
    public function sign($value, $privateKey)
    {
        $result = openssl_sign($value, $signature, $privateKey, $this->getAlgorithm());
        if (false === $result) {
            throw new \RuntimeException('Failed to encrypt value. ' . implode("\n", $this->getSslErrors()));
        }
        return $signature;
    }