Interface

PublicKey

PublicKey

Methods

# clone() → {PublicKey}

Clone and return a new instance of this PublicKey

View Source public-key.ts, line 138

PublicKey
Example
const keyA = keyGenerator.createPublicKey()
const keyB = keyA.clone()
// keyB holds a copy of keyA

# copy(key)

Copy an existing PublicKey and overwrite this instance
Parameters:
Name Type Description
key PublicKey PublicKey to copy

View Source public-key.ts, line 118

Example
const keyA = keyGenerator.createPublicKey()
const keyB = seal.PublicKey()
keyB.copy(keyA)
// keyB holds a copy of keyA

# delete()

Delete the underlying WASM instance. Should be called before dereferencing this object to prevent the WASM heap from growing indefinitely.

View Source public-key.ts, line 39

# load(context, encoded)

Load a PublicKey from a base64 string
Parameters:
Name Type Description
context Context Encryption context to enforce
encoded string Base64 encoded string

View Source public-key.ts, line 86

# loadArray(context, array)

Load a PublicKey from an Uint8Array holding binary data
Parameters:
Name Type Description
context Context Encryption context to enforce
array Uint8Array TypedArray containing binary data

View Source public-key.ts, line 102

# move(key)

Move a PublicKey into this one and delete the old reference
Parameters:
Name Type Description
key PublicKey PublicKey to move

View Source public-key.ts, line 164

Example
const keyA = keyGenerator.createPublicKey()
const keyB = seal.PublicKey()
keyB.move(keyA)
// keyB holds a the instance of keyA.
// keyA no longer holds an instance

# save(compressionopt) → {string}

Save the Encryption Parameters to a base64 string
Parameters:
Name Type Attributes Default Description
compression ComprModeType <optional>
ComprModeType.zstd The compression mode to use

View Source public-key.ts, line 53

Base64 encoded string
string

# saveArray(compressionopt) → {Uint8Array}

Save the PublicKey as a binary Uint8Array
Parameters:
Name Type Attributes Default Description
compression ComprModeType <optional>
ComprModeType.zstd The compression mode to use

View Source public-key.ts, line 69

A byte array containing the PublicKey in binary form
Uint8Array