RSA_verify_raw function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<RSA> rsa, Pointer<Size> out_len, Pointer<Uint8> out, Size max_out, Pointer<Uint8> in$, Size in_len, Int padding)>(ffi.Pointer<RSA>, ffi.Pointer<ffi.Size>, ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Int)>(symbol: 'bssl_dart_RSA_verify_raw')
int RSA_verify_raw(
  1. Pointer<RSA> rsa,
  2. Pointer<Size> out_len,
  3. Pointer<Uint8> out,
  4. int max_out,
  5. Pointer<Uint8> in$,
  6. int in_len,
  7. int padding,
)

RSA_verify_raw performs the public key portion of verifying |in_len| bytes of signature from |in| using the public key from |rsa|. On success, it returns one and writes, at most, |max_out| bytes of output to |out|. The |max_out| argument must be, at least, |RSA_size| in order to ensure the output fits. On failure or invalid input, it returns zero.

If |padding| is |RSA_PKCS1_PADDING|, this function checks the padding portion of RSASSA-PKCS1-v1_5 and outputs the remainder of the encoded digest. The caller is responsible for checking the output is a DigestInfo-wrapped digest of the message.

If |padding| is |RSA_NO_PADDING|, this function only performs the raw public key operation. The caller is responsible for checking the output is a valid result for the signature scheme being implemented.

WARNING: This function is a building block for a signature scheme, not a complete one. Checking for arbitrary strings in |out| will not result in a secure signature scheme.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<RSA>,
    ffi.Pointer<ffi.Size>,
    ffi.Pointer<ffi.Uint8>,
    ffi.Size,
    ffi.Pointer<ffi.Uint8>,
    ffi.Size,
    ffi.Int,
  )
>(symbol: 'bssl_dart_RSA_verify_raw')
external int RSA_verify_raw(
  ffi.Pointer<RSA> rsa,
  ffi.Pointer<ffi.Size> out_len,
  ffi.Pointer<ffi.Uint8> out,
  int max_out,
  ffi.Pointer<ffi.Uint8> in$,
  int in_len,
  int padding,
);