Sign a string with a given key and algorithm.
public static sign ( string $msg, string | resource $key, string $method = 'HS256' ) : string | ||
$msg | string | The message to sign |
$key | string | resource | The secret key |
$method | string | The signing algorithm. Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256' |
Résultat | string | An encrypted message |