Skip to content

Commit

Permalink
resolves #9, Updated README to cover support for `KmsDefaultEncrypter…
Browse files Browse the repository at this point in the history
…` and `KmsDefaultDecrypter`. (#16)
  • Loading branch information
debanshuk committed Apr 3, 2024
1 parent 24de34d commit 9ac6dc6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@ In the current version following encryption and signing operations are supported
1. Symmetric encryption (AES based).
1. Classes: `com.nimbusds.jose.aws.kms.crypto.KmsSymmetricEncrypter`
and `com.nimbusds.jose.aws.kms.crypto.KmsSymmetricDecrypter`
2. Asymmetric signing (RSA or ECDSA based).
1. Asymmetric or Symmetric encryption (RSA or ECDSA based for asymmetric keys and AES based for symmetric keys).
1. Classes: `com.nimbusds.jose.aws.kms.crypto.KmsDefaultEncrypter`
and `com.nimbusds.jose.aws.kms.crypto.KmsDefaultDecrypter`
1. Asymmetric signing (RSA or ECDSA based).
1. Classes: `com.nimbusds.jose.aws.kms.crypto.KmsAsymmetricSigner`
and `com.nimbusds.jose.aws.kms.crypto.KmsAsymmetricVerifier`

Above classes should be used in the same way any encryption or signing class, which is directly provided by
nimbus-jose-jwt, is used.

*Note:* For encryption using symmetric KMS keys, you can use either the `KmsDefaultEncrypter` class or the
`KmsSymmetricEncrypter` class (and similarly can use `KmsDefaultDecrypter` or `KmsSymmetricDecrypter`, for decryption).
The difference between these two classes is that `KmsDefaultEncrypter` generates an in-memory CEK and sends it to KMS
for encryption using KMS's [Encrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) API, while
`KmsSymmetricEncrypter` uses KMS's
[GenerateDataKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html) API to generate the CEK
and fetch its plaintext and encrypted versions.

## Encryption Example (Java 11)

```jshelllanguage
Expand Down

0 comments on commit 9ac6dc6

Please sign in to comment.