Class SecurityUtil
java.lang.Object
io.getlime.security.powerauth.lib.cmd.util.SecurityUtil
Helper class with security utilities.
- Author:
- Lukas Lukovsky, lukas.lukovsky@wultra.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.getlime.security.powerauth.rest.api.model.request.EciesEncryptedRequestcreateEncryptedRequest(io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptedRequest encryptedRequest) Creates an encrypted request instancestatic io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptedRequestencryptObject(io.getlime.security.powerauth.crypto.lib.encryptor.ClientEncryptor encryptor, Object value) Encrypts an object using the provided encryptorstatic voidprocessEncryptedResponse(StepContext<?, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext, String stepId) Process an encrypted response for a step.
-
Constructor Details
-
SecurityUtil
public SecurityUtil()
-
-
Method Details
-
encryptObject
public static io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptedRequest encryptObject(io.getlime.security.powerauth.crypto.lib.encryptor.ClientEncryptor encryptor, Object value) throws io.getlime.security.powerauth.crypto.lib.encryptor.exception.EncryptorException, IOException Encrypts an object using the provided encryptorThe object will be serialized to json and the json bytes will be then encrypted
- Parameters:
encryptor- Encyptor instancevalue- Object value to be encrypted- Returns:
- Cryptogram value of the provided object.
- Throws:
io.getlime.security.powerauth.crypto.lib.encryptor.exception.EncryptorException- when an error during object encryption occurredIOException- when an error during object encryption occurred
-
createEncryptedRequest
public static io.getlime.security.powerauth.rest.api.model.request.EciesEncryptedRequest createEncryptedRequest(io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptedRequest encryptedRequest) Creates an encrypted request instance- Parameters:
encryptedRequest- Ecies payload data to be sent- Returns:
- Encrypted request instance
-
processEncryptedResponse
public static void processEncryptedResponse(StepContext<?, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext, String stepId) throws ExceptionProcess an encrypted response for a step.- Parameters:
stepContext- Step context.stepId- Step identifier.- Throws:
Exception- Thrown in case response decryption fails.
-