Package com.mastercard.developer.utils
Class EncryptionUtils
- java.lang.Object
-
- com.mastercard.developer.utils.EncryptionUtils
-
public final class EncryptionUtils extends Object
Utility class for loading certificates and keys.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PrivateKeyloadDecryptionKey(String keyFilePath)Load a RSA decryption key from a file (PEM or DER).static PrivateKeyloadDecryptionKey(String pkcs12KeyFilePath, String decryptionKeyAlias, String decryptionKeyPassword)Load a RSA decryption key out of a PKCS#12 container.static CertificateloadEncryptionCertificate(String certificatePath)Populate a X509 encryption certificate object with the certificate data at the given file path.static StringsanitizeJson(String json)
-
-
-
Method Detail
-
loadEncryptionCertificate
public static Certificate loadEncryptionCertificate(String certificatePath) throws CertificateException, FileNotFoundException
Populate a X509 encryption certificate object with the certificate data at the given file path.
-
loadDecryptionKey
public static PrivateKey loadDecryptionKey(String keyFilePath) throws GeneralSecurityException, IOException
Load a RSA decryption key from a file (PEM or DER).- Throws:
GeneralSecurityExceptionIOException
-
loadDecryptionKey
public static PrivateKey loadDecryptionKey(String pkcs12KeyFilePath, String decryptionKeyAlias, String decryptionKeyPassword) throws GeneralSecurityException, IOException
Load a RSA decryption key out of a PKCS#12 container.- Throws:
GeneralSecurityExceptionIOException
-
-