RSA_sign function
RSA_sign signs |digest_len| bytes of digest from |digest| with |rsa| using RSASSA-PKCS1-v1_5. It writes, at most, |RSA_size(rsa)| bytes to |out|. On successful return, the actual number of bytes written is written to |*out_len|.
The |hash_nid| argument identifies the hash function used to calculate |digest| and is embedded in the resulting signature. For example, it might be |NID_sha256|.
It returns 1 on success and zero on error.
WARNING: |digest| must be the result of hashing the data to be signed with |hash_nid|. Passing unhashed inputs will not result in a secure signature scheme.
Implementation
@meta.RecordUse()
@ffi.Native<
ffi.Int Function(
ffi.Int,
ffi.Pointer<ffi.Uint8>,
ffi.Size,
ffi.Pointer<ffi.Uint8>,
ffi.Pointer<ffi.UnsignedInt>,
ffi.Pointer<RSA>,
)
>(symbol: 'bssl_dart_RSA_sign')
external int RSA_sign(
int hash_nid,
ffi.Pointer<ffi.Uint8> digest,
int digest_len,
ffi.Pointer<ffi.Uint8> out,
ffi.Pointer<ffi.UnsignedInt> out_len,
ffi.Pointer<RSA> rsa,
);