| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
… along with existing support.
|
What is a use case for this scenario? |
Sorry, something went wrong.
| /** | ||
| * Populate a X509 encryption certificate object with the certificate data at the given certificate data in bytes. | ||
| */ | ||
| public static Certificate loadEncryptionCertificate(byte[] certificateBytes) throws CertificateException { |
There was a problem hiding this comment.
For more flexibility we could use a InputStream instead of a byte[]. This way we can handle data from various sources, files, network, etc.
This is the choice that was made here: https://github.com/Mastercard/oauth1-signer-java/blob/main/src/main/java/com/mastercard/developer/utils/AuthenticationUtils.java#L28
Sorry, something went wrong.
There was a problem hiding this comment.
I agree, with that change, we still have a single interface and better flexibility
Sorry, something went wrong.
| /** | ||
| * Load a RSA decryption key from key data in bytes. | ||
| */ | ||
| public static PrivateKey loadDecryptionKey(byte[] keyDataBytes) throws GeneralSecurityException { |
There was a problem hiding this comment.
Don't forget to add tests to the EncryptionUtilsTest class, all public methods should be tested.
Sorry, something went wrong.
…byte[] certificateBytes), loadEncryptionCertificate(byte[] certificateBytes)
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
Looks fine
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
EncryptionUtils.loadDecryptionKey and EncryptionUtils.loadEncryptionCertificate now supports bytes array for populating respective object along with existing support for filepath.
Link to issue/feature request:
Description
EncryptionUtils now allow loading Certificate and PrivateKey by passing the data in bytes. Existing functions are still valid and continues to support loading certificate and key using file path.