Deduplicate Code
Problem:
The functions
createViewCryptor2
and
createFileCryptor2
essentially provide the same functionality: provide a read-only access
to a document.
Consequences:
It is harder to understand and maintain what the two functions do.
Suggestions:
Merge the two functions and make them callable with and without a .
Drawbacks:
The of createViewCryptor2
is 16 bytes long, while the one of
createFileCryptor2
has 24 bytes. Furthermore, createFileCryptor2
does not use the secondary signing key pair that is produced by
createViewCryptor2
.