Interface ClientCryptoService

All Known Implementing Classes:
AndroidClientCryptoServiceImpl

public interface ClientCryptoService
Since:
1.1.2
Author:
Anusha Sunkada
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    asymmetricDecrypt(@jakarta.validation.constraints.NotNull byte[] cipher)
    Decrypts provided cipher text
    byte[]
    asymmetricEncrypt(@jakarta.validation.constraints.NotNull byte[] plainData)
    Encrypts the input data
    void
    Closes underlying security implementation
    byte[]
     
    byte[]
     
    boolean
     
    byte[]
    signData(@jakarta.validation.constraints.NotNull byte[] dataToSign)
    Signs the input data by private key provided
    boolean
    validateSignature(@jakarta.validation.constraints.NotNull byte[] signature, @jakarta.validation.constraints.NotNull byte[] actualData)
    Validates the signed data against the actual data using the public part of underlying security module
  • Method Details

    • signData

      byte[] signData(@NotNull @jakarta.validation.constraints.NotNull byte[] dataToSign) throws ClientCryptoException
      Signs the input data by private key provided
      Parameters:
      dataToSign - plain data to be signed
      Returns:
      signature bytes
      Throws:
      ClientCryptoException
    • validateSignature

      boolean validateSignature(@NotNull @jakarta.validation.constraints.NotNull byte[] signature, @NotNull @jakarta.validation.constraints.NotNull byte[] actualData) throws ClientCryptoException
      Validates the signed data against the actual data using the public part of underlying security module
      Parameters:
      signature - - signature to verify against
      actualData - - plain data
      Returns:
      true if successful signature verification
      Throws:
      ClientCryptoException
    • asymmetricEncrypt

      byte[] asymmetricEncrypt(@NotNull @jakarta.validation.constraints.NotNull byte[] plainData) throws ClientCryptoException
      Encrypts the input data
      Parameters:
      plainData - - plain data to encrypt
      Returns:
      encrypted data
      Throws:
      ClientCryptoException
    • asymmetricDecrypt

      byte[] asymmetricDecrypt(@NotNull @jakarta.validation.constraints.NotNull byte[] cipher) throws ClientCryptoException
      Decrypts provided cipher text
      Parameters:
      cipher - - encrypted data
      Returns:
      plain data
      Throws:
      ClientCryptoException
    • getSigningPublicPart

      byte[] getSigningPublicPart()
      Returns:
      public key as byte array
    • closeSecurityInstance

      void closeSecurityInstance() throws ClientCryptoException
      Closes underlying security implementation
      Throws:
      ClientCryptoException
    • isTPMInstance

      boolean isTPMInstance()
      Returns:
      true if the implementation was specific to TPM
    • getEncryptionPublicPart

      byte[] getEncryptionPublicPart()
      Returns:
      public key as byte array