SealdSdk_RenewKeys method

int SealdSdk_RenewKeys(
  1. Pointer<NativeSealdSdk> sealdSdk,
  2. int keyExpireAfter,
  3. Pointer<Utf8> preGeneratedEncryptionKey,
  4. Pointer<Utf8> preGeneratedSigningKey,
  5. Pointer<Uint8> preparedRenewal,
  6. int preparedRenewalLen,
  7. Pointer<Pointer<NativeSealdError>> error,
)

Renew the keys of the current device, extending their validity. If the current device has expired, you will need to call SealdSdk_RenewKeys before you are able to do anything else. Warning: if the identity of the current device is stored externally, for example on SSKS, you will want to re-export it and store it again, otherwise the previously stored identity will not be recognized anymore.

@param sealdSdk The SealdSdk instance. @param keyExpireAfter The duration during which the renewed device key will be valid without further renewal, in Milliseconds. Optional, defaults to 5 years. @param preGeneratedEncryptionKey A B64 encoding of a pre-generated key, or NULL. Either both must be passed, or neither. @param preGeneratedSigningKey A B64 encoding of a pre-generated key, or NULL. Either both must be passed, or neither. @param preparedRenewal Optional. The preparedRenewal generated by calling SealdSdk_RenewKeys. If preparedRenewal is given, preGeneratedEncryptionKey and preGeneratedSigningKey will be ignored. @param preparedRenewalLen The length of preparedRenewal. @param error A pointer to a SealdError* where details will be stored in case of error. @return Error code: -1 if an error happened, 0 for success.

Implementation

int SealdSdk_RenewKeys(
  ffi.Pointer<NativeSealdSdk> sealdSdk,
  int keyExpireAfter,
  ffi.Pointer<pkg_ffi.Utf8> preGeneratedEncryptionKey,
  ffi.Pointer<pkg_ffi.Utf8> preGeneratedSigningKey,
  ffi.Pointer<ffi.Uint8> preparedRenewal,
  int preparedRenewalLen,
  ffi.Pointer<ffi.Pointer<NativeSealdError>> error,
) {
  return _SealdSdk_RenewKeys(
    sealdSdk,
    keyExpireAfter,
    preGeneratedEncryptionKey,
    preGeneratedSigningKey,
    preparedRenewal,
    preparedRenewalLen,
    error,
  );
}