Closed mirceanis closed 1 year ago
Looks great! Do you think in a future (smaller) refactor, it would make sense to change some of the strings (e.g. "X25519KeyAgreementKey2019") to be constants in some shared file?
Of course. There's actually a lot more to be refactor here to make the code more friendly, modular and safer. It's just a question of priorities
:tada: This PR is included in version 7.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This PR introduces the
createFullEncrypter
method that should allow users to provide their own implementations for JWE content encryption or key wrapping. A few data types were defined to support this, representing objects that provide this functionality along with a description of the algorithm they implement.:KekCreator
to create key-wrapping keys,KeyWrapper
to wrap the content encryption key,ContentEncrypter
to actually encrypt the payload.This also deprecates some of the method names used to create encrypters/decrypters in favor of the more complete names that include the actual crypto involved.
This repo went through a lot of refactoring:
Example:
This PR would also close #265 #266 #251 and re-enable the automatic dependency management that was blocked by them.