Automattic\WooCommerce\StoreApi\Utilities

JsonWebToken::generate_signature()private staticWC 1.0

Generates a sha256 signature for the provided string using the provided secret.

Method of the class: JsonWebToken{}

No Hooks.

Return

false|String.

Usage

$result = JsonWebToken::generate_signature( $string, $secret );
$string(string) (required)
Header + Payload token substring.
$secret(string) (required)
The secret used to generate the signature.

JsonWebToken::generate_signature() code WC 9.0.1

private static function generate_signature( string $string, string $secret ) {
	return hash_hmac(
		'sha256',
		$string,
		$secret,
		true
	);
}