encrypt


Description:

public virtual int encrypt (bool sign, string? userid, EncryptFlags flags, GenericArray<string> recipients, Stream istream, Stream ostream) throws Error

Encrypts (and optionally signs) the cleartext input stream and writes the resulting ciphertext to the output stream.

Parameters:

this

a CryptoContext

sign

sign as well as encrypt

userid

the key id (or email address) to use when signing (assuming sign is true)

flags

a set of EncryptFlags

recipients

an array of recipient key ids and/or email addresses

istream

cleartext input stream

ostream

ciphertext output stream

Returns:

0 on success or %-1 on fail.