Encryption Service is used to secure sensitive data that is being stored in the database.
Before you proceed with the documentation, make sure the following pre-requisites are met -
- Java 8.
- Kafka server is up and running.
Encryption Service offers following features :
- 1.Encrypt - The service will encrypt the data based on given input parameters and data to be encrypted. The encrypted data will be mandatorily of type string.
- 2.Decrypt - The decryption will happen solely based on the input data (any extra parameters are not required). The encrypted data will have identity of the key used at the time of encryption, the same key will be used for decryption.
- 3.Sign - Encryption Service can hash and sign the data which can be used as unique identifier of the data. This can also be used for searching gicen value from a datastore.
- 4.Verify - Based on the input sign and the claim, it can verify if the the given sign is correct for the provided claim.
- 5.Rotate Key - Encryption Service supports changing the key used for encryption. The old key will still remain with the service which will be used to decrypt old data. All the new data will be encrypted by the new key.
Following are the properties in application.properties file in egov-enc-service which are configurable.
- 1.Deploy the latest version of Encryption Service.
- 2.Add Role-Action mapping for API’s.
The Encryption service is used to encrypt sensitive data that needs to be stored in the database.
- Can perform encryption without having to re-write encryption logic everytime in every service.
- 1.To integrate, host of encryption-services module should be overwritten in helm chart.
/crypto/v1/_encryptshould be added as endpoint for encrypting input data in the system
/crypto/v1/_decryptshould be added as the decryption endpoint.
/crypto/v1/_signshould be added as the endpoint for providing signature for a given value.
/crypto/v1/_verifyshould be added as the endpoint for verifying whether the signature for the provided value is correct.
/crypto/v1/_rotatekeyshould be added as endpoint to deactivate the keys and generate new keys for a given tenant.
Encrypts the given input value/s OR values of the object.
Decrypts the given input value/s OR values of the object.
Provide signature for a given value.
Check if the signature is correct for the provided value.
Deactivate the keys for the given tenant and generate new keys. It will deactivate both symmetric and asymmetric keys for the provided tenant.