Skip to content

ImportKeyResult ​

ImportKeyResult ​

Success-or-failure result returned by the public import* key functions.

On failure, code is 'malformed' for structurally invalid input, algorithm mismatches, and wrong-password decryption failures alike (see the throwing *OrThrow variants for raw error messages), and 'limit_exceeded' for an implementation limit.

ts
type ImportKeyResult<T> = {
  readonly ok: true;
  readonly value: T
} | ErrorResult<ImportKeyErrorCode, Record<never, never>, ImportKeyFailure>

Released under the MIT License.