setValidity method

void setValidity({
  1. int notBeforeOffset = 0,
  2. int notAfterOffset = 31536000,
})

Sets the validity period in seconds from now.

Implementation

void setValidity({int notBeforeOffset = 0, int notAfterOffset = 31536000}) {
  _ensureUsable();
  final notBefore = _context.bindings.X509_getm_notBefore(_cert);
  final notAfter = _context.bindings.X509_getm_notAfter(_cert);

  _context.bindings.X509_gmtime_adj(notBefore, notBeforeOffset);
  _context.bindings.X509_gmtime_adj(notAfter, notAfterOffset);
}