Class SecurityUtil

java.lang.Object
io.getlime.security.powerauth.lib.cmd.util.SecurityUtil

public class SecurityUtil extends Object
Helper class with security utilities.
Author:
Lukas Lukovsky, lukas.lukovsky@wultra.com
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    static io.getlime.security.powerauth.crypto.lib.encryptor.model.EncryptedRequest
    encryptObject(io.getlime.security.powerauth.crypto.lib.encryptor.ClientEncryptor encryptor, Object value)
    Encrypts an object using the provided encryptor
    static void
    processEncryptedResponse(StepContext<?,io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext, String stepId)
    Process an encrypted response for a step.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 encryptor

      The object will be serialized to json and the json bytes will be then encrypted

      Parameters:
      encryptor - Encyptor instance
      value - 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 occurred
      IOException - 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 Exception
      Process an encrypted response for a step.
      Parameters:
      stepContext - Step context.
      stepId - Step identifier.
      Throws:
      Exception - Thrown in case response decryption fails.