Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
agoston authored Nov 19, 2018
1 parent 0d700aa commit a5d4863
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add dependency:
<dependency>
<groupId>com.bol</groupId>
<artifactId>spring-data-mongodb-encrypt</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```

Expand Down Expand Up @@ -233,6 +233,20 @@ If you want to use this library to encrypt arbitrary fields directly via mongo-d
}
```

## Ignore decryption failures

Sometimes (see #17) it is useful to bypass the otherwise rigid decryption framework and allow for a best-effort reading of mongodb documents. Using the `EncryptionEventListener.withSilentDecryptionFailure(true)` allows to bypass these failures and leave the failing fields empty. Example:

```java
@Bean
public CachedEncryptionEventListener encryptionEventListener(CryptVault cryptVault) {
return new CachedEncryptionEventListener(cryptVault)
.withSilentDecryptionFailure(true);
}
```

It is also possible to autowire EncryptionEventListener and change this setting on-the-fly.

## Encrypting the whole document

While it was not the use case for this library, it is very well possible to do whole document encryption with it.
Expand Down

0 comments on commit a5d4863

Please sign in to comment.