RSA_private_decrypt function

  1. @RecordUse.new()
  2. @Native<Int Function(Size, Pointer<Uint8>, Pointer<Uint8>, Pointer<RSA>, Int)>(ffi.Size, ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>, ffi.Pointer<RSA>, ffi.Int)>(symbol: 'bssl_dart_RSA_private_decrypt')
int RSA_private_decrypt(
  1. int flen,
  2. Pointer<Uint8> from,
  3. Pointer<Uint8> to,
  4. Pointer<RSA> rsa,
  5. int padding,
)

RSA_private_decrypt decrypts flen bytes from from with the public key in rsa and writes the plaintext to to. The to buffer must have at least RSA_size bytes of space. It returns the number of bytes written, or -1 on error. The padding argument must be one of the RSA_*_PADDING values. If in doubt, use RSA_PKCS1_OAEP_PADDING for new protocols. Passing RSA_PKCS1_PADDING into this function is deprecated and insecure. See RSA_decrypt.

When padding is RSA_PKCS1_OAEP_PADDING, this function has no way to set the OAEP or MGF-1 digest, so it is always SHA-1. For other OAEP parameters, wrap rsa in an EVP_PKEY and use EVP_PKEY_decrypt with EVP_PKEY_CTX_set_rsa_padding and related functions.

WARNING: this function is dangerous because it breaks the usual return value convention. Use RSA_decrypt instead.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Size,
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<RSA>,
    ffi.Int,
  )
>(symbol: 'bssl_dart_RSA_private_decrypt')
external int RSA_private_decrypt(
  int flen,
  ffi.Pointer<ffi.Uint8> from,
  ffi.Pointer<ffi.Uint8> to,
  ffi.Pointer<RSA> rsa,
  int padding,
);