ASN1_item_digest function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<ASN1_ITEM>, Pointer<EVP_MD>, Pointer<Void>, Pointer<UnsignedChar>, Pointer<UnsignedInt>)>(ffi.Pointer<ASN1_ITEM>, ffi.Pointer<EVP_MD>, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.UnsignedChar>, ffi.Pointer<ffi.UnsignedInt>)>(symbol: 'bssl_dart_ASN1_item_digest')
int ASN1_item_digest(
  1. Pointer<ASN1_ITEM> it,
  2. Pointer<EVP_MD> type,
  3. Pointer<Void> data,
  4. Pointer<UnsignedChar> md,
  5. Pointer<UnsignedInt> len,
)

ASN1_item_digest serializes data with it and then hashes the result with type. On success, it returns one, writes the digest to md, and sets *len to the digest length if non-NULL. On error, it returns zero.

EVP_MD_CTX_size bytes are written, which is at most EVP_MAX_MD_SIZE. The buffer must have sufficient space for this output.

WARNING: data must be a pointer with the same type as it's corresponding C type. Using the wrong type is a potentially exploitable memory error.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<ASN1_ITEM>,
    ffi.Pointer<EVP_MD>,
    ffi.Pointer<ffi.Void>,
    ffi.Pointer<ffi.UnsignedChar>,
    ffi.Pointer<ffi.UnsignedInt>,
  )
>(symbol: 'bssl_dart_ASN1_item_digest')
external int ASN1_item_digest(
  ffi.Pointer<ASN1_ITEM> it,
  ffi.Pointer<EVP_MD> type,
  ffi.Pointer<ffi.Void> data,
  ffi.Pointer<ffi.UnsignedChar> md,
  ffi.Pointer<ffi.UnsignedInt> len,
);