Options
All
  • Public
  • Public/Protected
  • All
Menu

Meeco password-derived, key-encryption and data-encryption keys are all symmetric keys (there is one key that is used to both encrypt and decrypt things).

This wrapper ensures that keys can be safely serialized as JSON (by encoding them as URL-Safe Base64) and avoids confusion when dealing with converting to and from this encoded format, as well as encrypting UTF-8 strings or other keys.

Hierarchy

  • SymmetricKey

Index

Accessors

key

  • get key(): Uint8Array

Methods

decryptKey

  • Used to decrypt generated bytes such as encryption keys or verification keys. N.B.. Encryption keys are considered binary data even though they are often represented as strings

    Parameters

    • serialized: string

    Returns Promise<SymmetricKey>

decryptString

  • decryptString(serialized: null | string): Promise<null | string>
  • Used to decrypt user-entered data such as birthdays or name. Should not be used to decrypt keys - use decryptKey instead.

    Accepts string or null for compatibility with API return types, and returns null only when input is null.

    Parameters

    • serialized: null | string

    Returns Promise<null | string>

encryptKey

  • encryptKey(key: { key: Uint8Array }): Promise<string>
  • Used to encrypt generated bytes such as encryption keys or verification keys. N.B.. Encryption keys are considered binary data even though they are often represented as strings.

    Parameters

    • key: { key: Uint8Array }
      • key: Uint8Array

    Returns Promise<string>

    Base 64 encoded encrypted string.

encryptString

  • encryptString(value: null | string): Promise<null | string>
  • Used to encrypt user-entered data such as birthdays or name. Should not be used to encrypt keys - use encryptKey instead. Empty string input will produce a null result.

    Parameters

    • value: null | string

    Returns Promise<null | string>

    Base 64 encoded encrypted string.

toJSON

  • toJSON(): string

Static fromBytes

Static fromCryppoKey

Static fromSerialized

Static generate

Generated using TypeDoc