Skip to content

Commit 219e8fa

Browse files
authored
Merge pull request #6 from simonratner/more-docs
Format param names
2 parents 99d90dd + d7a3062 commit 219e8fa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ let encryptedNumber = encryptedAttributes.encryptAttribute(null, secretNumber)
7878
Construct an instance to handle encryption and decryption. You should construct
7979
for each unique set of attributes and keys that you want to encrypt.
8080

81-
| Parameter | Type | Required? | Details |
82-
| :--------- | :--------------- | :--------- | :---------------------------- |
83-
| attributes | array of strings | _Optional_ | List attributes which should be encrypted. These can be specified as top-level string keys, or nested paths using dot-separated notation. This list is used by `encryptAll`/`decryptAll`, and is also useful for creating helper methods on your models. |
84-
| options | dictionary | _Optional_ | See below. |
81+
| Parameter | Type | Required? | Details |
82+
| :----------- | :--------------- | :--------- | :---------------------------- |
83+
| `attributes` | array of strings | _Optional_ | List attributes which should be encrypted. These can be specified as top-level string keys, or nested paths using dot-separated notation. This list is used by `encryptAll`/`decryptAll`, and is also useful for creating helper methods on your models. |
84+
| `options` | dictionary | _Optional_ | See below. |
8585

8686
These options are supported:
8787

88-
| Option | Type | Required? | Details |
89-
| :--------- | :--------------- | :--------- | :---------------------------- |
90-
| keys | dictionary | Required | Dictionary of all relevant data encryption keys, as `base64` strings. Since encrypted strings _embed the key id that was used to encrypt them_, it's important that `keys` contains the appropriate key for any previously encrypted data you might run across. |
91-
| keyId | string | Required | The id of the key to use for all _new encryptions_. This is not necessarily the only key that will be used for decryptions, because the key id gets embedded into the encrypted string. When that string is decrypted, this module unpacks that key id and uses it to determine the appropriate decryption key. This approach allows multiple keys to be used for the same attribute. (Note that this option is only _technically_ required if you need to encrypt new data. If you are only decrypting existing data, you do not need to provide it.) |
92-
| verifyId | boolean | _Optional_ | Whether or not to (a) use the `id` property of a provided source object as an additional piece of metadata during encryption, and (b) expect that metadata to be embedded in encrypted strings during decryption, and throw an error if the expected id does not match. Defaults to `false`. |
88+
| Option | Type | Required? | Details |
89+
| :----------- | :--------------- | :--------- | :---------------------------- |
90+
| `keys` | dictionary | Required | Dictionary of all relevant data encryption keys, as `base64` strings. Since encrypted strings _embed the key id that was used to encrypt them_, it's important that `keys` contains the appropriate key for any previously encrypted data you might run across. |
91+
| `keyId` | string | Required | The id of the key to use for all _new encryptions_. This is not necessarily the only key that will be used for decryptions, because the key id gets embedded into the encrypted string. When that string is decrypted, this module unpacks that key id and uses it to determine the appropriate decryption key. This approach allows multiple keys to be used for the same attribute. (Note that this option is only _technically_ required if you need to encrypt new data. If you are only decrypting existing data, you do not need to provide it.) |
92+
| `verifyId` | boolean | _Optional_ | Whether or not to (a) use the `id` property of a provided source object as an additional piece of metadata during encryption, and (b) expect that metadata to be embedded in encrypted strings during decryption, and throw an error if the expected id does not match the source object. Defaults to `false`. |
9393

9494

9595
### encryptAttribute(sourceObject, plaintextString)

0 commit comments

Comments
 (0)