3.4.7.1 Generate a Kubernetes Secret for an Encryption Key
To support asynchronous calls, MicroTx stores the authorization and refresh tokens. To store the tokens, encrypt them as you can't store the tokens directly. To encrypt the tokens, create encryption keys.
authTokenPropagationEnabled property under authorization. The encryption key that you generate must have the following attributes.
- Symmetric algorithm: AES-256
- Cipher mode: AES in GCM mode
- Key length: 32 bytes
- Length of initialization vectors: 96 bits
MicroTx encrypts the access and refresh tokens, and then uses it later while making calls to participant services. For each transaction, MicroTx generates a new value for the initialization vectors. Each transaction record contains the encrypted metadata information, such as key version and initialization vector value.
Generate a Kubernetes Secret for an Encryption Key for MicroTx Workflows
- Run the following command to generate an encryption key, that is 32-bytes
long.
openssl rand -hex 32 > encryption.keyThis creates an encryption key file named
encryption.key. - Use the encryption key file to create a Kubernetes secret. You must create
this secret in the namespace where you want to install MicroTx Workflows. The following sample command creates a Kubernetes secret with
the name
encryption-secret-key1in theotmmnamespace.kubectl create secret generic encryption-secret --from-file=encryption.key -n otmm - Note down the name of the Kubernetes secret and the file name stored in the secret. You
will provide these values for the
secretNameandfileNamefields underworkflow.server.encryptionin thevalues.yamlfile.
Generate a Kubernetes Secret for an Encryption Key for MicroTx Distributed Transactions
Parent topic: Authenticate and Authorize