Interface ClientCryptoService


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

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

      • signData

        byte[] signData​(@NotNull
                        @javax.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
                                  @javax.validation.constraints.NotNull byte[] signature,
                                  @NotNull
                                  @javax.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
                                 @javax.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
                                 @javax.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
      • isTPMInstance

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

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