ASN1_TIME_diff function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<Int>, Pointer<Int>, Pointer<ASN1_OCTET_STRING>, Pointer<ASN1_OCTET_STRING>)>(ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>, ffi.Pointer<ASN1_TIME>, ffi.Pointer<ASN1_TIME>)>(symbol: 'bssl_dart_ASN1_TIME_diff')
int ASN1_TIME_diff(
  1. Pointer<Int> out_days,
  2. Pointer<Int> out_seconds,
  3. Pointer<ASN1_OCTET_STRING> from,
  4. Pointer<ASN1_OCTET_STRING> to,
)

ASN1_TIME_diff computes |to| - |from|. On success, it sets |*out_days| to the difference in days, rounded towards zero, sets |*out_seconds| to the remainder, and returns one. On error, it returns zero.

If |from| is before |to|, both outputs will be <= 0, with at least one negative. If |from| is after |to|, both will be >= 0, with at least one positive. If they are equal, ignoring fractional seconds, both will be zero.

Note this function may fail on overflow, or if |from| or |to| cannot be decoded.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ASN1_TIME>,
    ffi.Pointer<ASN1_TIME>,
  )
>(symbol: 'bssl_dart_ASN1_TIME_diff')
external int ASN1_TIME_diff(
  ffi.Pointer<ffi.Int> out_days,
  ffi.Pointer<ffi.Int> out_seconds,
  ffi.Pointer<ASN1_TIME> from,
  ffi.Pointer<ASN1_TIME> to,
);