Encrypts message text/data with public keys, passwords or both at once. At least either public keys or passwords
must be specified. If private keys are specified, those will be used to sign the message.

Parameters:

Name

Type

Description

message

Message

message to be encrypted as created by openpgp.message.fromText or openpgp.message.fromBinary

publicKeys

Key
|
Array.<Key>

(optional) array of keys or single key, used to encrypt the message

privateKeys

Key
|
Array.<Key>

(optional) private keys for signing. If omitted message will not be signed

passwords

String
|
Array.<String>

(optional) array of passwords or a single password to encrypt the message

(optional) override the creation date of the key and the key signatures

subkeys

Array.<Object>

(optional) options for each subkey, default to main key options. e.g. [{sign: true, passphrase: '123'}]
sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt

Parameters:

Returns:

Type

Object

(inner) nativeAEAD() → {Boolean}

Check for native AEAD support and configuration by the user. Only
browsers that implement the current WebCrypto specification support
native GCM. Native EAX is built on CTR and CBC, which current
browsers support. OCB and CFB are not natively supported.