>

SHA256WithRSA

Description

Sign an input string with an RSA private key using the SHA256withRSA signature algorithm. Useful with JWT authentication.

Syntax

SHA256WithRSA(input_string, key)

Arguments

  input_string (string) - The string to sign.

  key  - a Base 64 encoded PKCS8 key string.

Examples

SHA256WithRSA('my string', '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----')

Return value datatype

binary

Impact of null value

If the input_string is null, null is returned. If the key is null ,an error is thrown.