Closed lgoldstein closed 3 years ago
Thanks -- looks good! I think you might also want to implement Cloneable
for Key
and Subkey
, too, though. Otherwise, if you add keys to an encryptor/decryptor ring before you clone it, you'll end up with multiple encryptor/decryptors sharing the same subkey instances -- which could would cause problems if clearSecrets()
is called on one encryptor/decryptor while other encryptors/decryptors are still using a shared subkey instance (as it will clear the subkey's extracted private key material, as well as any passphrase that could be use to extract it again).
Good catch - done.
The expected use-case is as follows: