Returns a binary signature for the specified data by generating a cryptographic digital signature using the private key associated with priv_key_id. Note that the data itself is not encrypted.

openssl:sign(STRING data
, private_key_id
, signature_alg: 1) : STRING

$private_key = "-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBANDiE2+Xi/WnO+s120NiiJhNyIButVu6zxqlVzz0wy2j4kQVUC4Z
RZD80IY+4wIiX2YxKBZKGnd2TtPkcJ/ljkUCAwEAAQJAL151ZeMKHEU2c1qdRKS9
sTxCcc2pVwoAGVzRccNX16tfmCf8FjxuM3WmLdsPxYoHrwb1LFNxiNk1MXrxjH3R
6QIhAPB7edmcjH4bhMaJBztcbNE1VRCEi/bisAwiPPMq9/2nAiEA3lyc5+f6DEIJ
h1y6BWkdVULDSM+jpi1XiV/DevxuijMCIQCAEPGqHsF+4v7Jj+3HAgh9PU6otj2n
Y79nJtCYmvhoHwIgNDePaS4inApN7omp7WdXyhPZhBmulnGDYvEoGJN66d0CIHra
I2SvDkQ5CmrzkW5qPaE2oO7BSqAhRZxiYpZFb5CI
-----END RSA PRIVATE KEY-----"

        $signature = openssl:sign('Data wish to turn into signature!', $private_key, "sha256WithRSAEncryption")
        base64:encode($signature)
        #=> "gGRkEf3JNUQ2S6UMIW/Cxu+Vhv+F35/nS6TWba7tVhC42ogMjHuJvCFlhdzseus0JrmeRnpGsDIEi/916LgsPg=="

Copyright ©2013-2022 SunSed®. All rights reserved.