MultipartEncrypted.encrypt

Attempts to encrypt (and conditionally sign) the entity MIME part to the public keys of recipients using the ctx encryption context. If successful, a new multipart/encrypted object is returned.

Parameters

ctx gmime.crypto_context.CryptoContext

a #GMimeCryptoContext

entity gmime.object.ObjectWrap

MIME part to encrypt

sign bool

true if the content should also be signed or false otherwise

userid string

user id to use for signing (only used if sign is true)

flags gmime.types.EncryptFlags

a #GMimeEncryptFlags

recipients string[]

an array of recipients to encrypt to

Return Value

Type: gmime.multipart_encrypted.MultipartEncrypted

a new #GMimeMultipartEncrypted object on success or null on fail. If encrypting fails, an exception will be set on err to provide information as to why the failure occurred.

Throws