Package A501JavaSDKPackage.WebClients
Class BaseAPIWebClient
java.lang.Object
A501JavaSDKPackage.WebClients.BaseAPIWebClient
- Direct Known Subclasses:
A501WebClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static KeydecryptDataAsymmetrically(String sessionKey, String privatePassword, byte[] privateKeyBytes) protected static StringdecryptDataSymmetrically(Key sessionKey, String encryptedData) protected static StringencryptUsingPublicKey(Key sessionKey, byte[] PublicKey) protected static StringencryptUsingSessionKey(Key sessionKey, String plainText) protected static Keyprotected static PrivateKeygetPrivateKey(byte[] privateKey, String privateKeyPassword) protected static PublicKeyGetPublicKey(byte[] publicKeyBytes) protected static booleanIsNullOrEmpty(String val) protected Stringprotected static StringsignData(PrivateKey _privateKey, String signingParams) protected static booleanverifyJson(EncryptedResponseModel encryptedRespomsemodel, PublicKey publicKey) protected static voidverifySignature(EncryptedResponseModel encryptedRespomsemodel, byte[] publicKeyBytes) static StringWebClientPost(String data, A501ClientRequestModel a501ClientRequestModel)
-
Constructor Details
-
BaseAPIWebClient
public BaseAPIWebClient()
-
-
Method Details
-
IsNullOrEmpty
-
generateSessionKey
-
encryptUsingPublicKey
protected static String encryptUsingPublicKey(Key sessionKey, byte[] PublicKey) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
ReadFile
- Throws:
IOException
-
encryptUsingSessionKey
-
getPrivateKey
protected static PrivateKey getPrivateKey(byte[] privateKey, String privateKeyPassword) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, CertificateException -
signData
-
verifyJson
protected static boolean verifyJson(EncryptedResponseModel encryptedRespomsemodel, PublicKey publicKey) -
verifySignature
protected static void verifySignature(EncryptedResponseModel encryptedRespomsemodel, byte[] publicKeyBytes) throws Exception - Throws:
Exception
-
GetPublicKey
-
decryptDataAsymmetrically
-
decryptDataSymmetrically
-
WebClientPost
public static String WebClientPost(String data, A501ClientRequestModel a501ClientRequestModel) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-