fix: Encrypt name to result by seebees · Pull Request #211 · aws/aws-encryption-sdk-javascript
Javascript stimulates named parameters with objects. The previous version used `ciphertext` to denote the usable result from a call to `encrypt`. However, this caused some cogitative load. Ciphertext is used to denote encrypted data, however the result of a call to `encrypt` in not _only_ encrypted data. The AWS Encryption SDK uses envelop encryption, so the result of a call to `encrypt` include not only the encrypted data, but also, the encrypted data keys, metadata, and the encryption context. By returning both the `messageHeader` *and* the `ciphertext` users are confused about what exactly was *in* `ciphertext`. This is compounded by returning `messageHeader` which is just a parsed version of the header that is already returned by the result of `encrypt` The named parameter is now call `result`. This makes it clear that this is the important return value from `encrypt` that is the only value needed for `decrypt`.