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 textbyte[]asymmetricEncrypt(@javax.validation.constraints.NotNull byte[] plainData)Encrypts the input datavoidcloseSecurityInstance()Closes underlying security implementationbyte[]getEncryptionPublicPart()byte[]getSigningPublicPart()booleanisTPMInstance()byte[]signData(@javax.validation.constraints.NotNull byte[] dataToSign)Signs the input data by private key providedbooleanvalidateSignature(@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 ClientCryptoExceptionSigns 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 ClientCryptoExceptionValidates the signed data against the actual data using the public part of underlying security module- Parameters:
signature- - signature to verify againstactualData- - plain data- Returns:
- true if successful signature verification
- Throws:
ClientCryptoException
-
asymmetricEncrypt
byte[] asymmetricEncrypt(@NotNull @javax.validation.constraints.NotNull byte[] plainData) throws ClientCryptoExceptionEncrypts 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 ClientCryptoExceptionDecrypts 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 ClientCryptoExceptionCloses 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
-
-