public static function sign($message, PrivateKey $rsaPrivateKey)
    {
        $rsa = self::getRsa(RSA::SIGNATURE_PSS);

        $return = $rsa->loadKey($rsaPrivateKey->getKey());
        if ($return === false) {
            throw new InvalidKeyException('Signing failed due to invalid key');
        }

        return $rsa->sign($message);
    }
public static function sign($message, PrivateKey $rsaPrivateKey)
    {
        $rsa = self::getRsa(RSA::SIGNATURE_PSS);

        $return = $rsa->loadKey($rsaPrivateKey->getKey());
        if ($return === false) {
            throw new InvalidKeyException('Signing failed due to invalid key');
        }

        return $rsa->sign($message);
    }
public static function sign ( $ message , PrivateKey $ rsaPrivateKey ) { $ rsa = self :: getRsa ( RSA :: SIGNATURE_PSS ) ; $ return = $ rsa -> loadKey ( $ rsaPrivateKey -> getKey ( ) ) ; if ( $ return === false ) { throw new InvalidKeyException ( 'Signing failed due to invalid key' ) ; } return $ rsa -> sign ( $ message ) ; }
Sign with RSASS-PSS + MGF1+SHA256

@param string $message
@param PrivateKey $rsaPrivateKey
@return string
Sign with RSASS - PSS + MGF1 + SHA256