Steps
The following sections describe the steps necessary to encrypt a file sent from an OFI to a BFI through the RFI endpoint.Step 1: Generate a random 128-bit AES key
Using your chosen implementation language, generate a random 128-bit AES key for AES-128-GCM encryption.Java
Step 2: Generate a 12-byte IV
Using your chosen implementation language, generate a 12-byte IV.Java
Step 3: Encrypt the file contents
Encrypt the file contents using AES-128-GCM using the key and IV from the previous steps.Java
Step 4: Encrypt the AES key
Using the JWK data from the quote response, encrypt the AES key that was used to encrypt the file contents with the following parameters using JWE:Java
Step 5: Transmit the encrypted payload
After performing the encryption steps from the previous steps, you should have the AES-encrypted file, the compact JWE string representing the AES key, and the 12-byte IV. Assemble those components into amultipart/form-data request as
shown below and send it to the
upload RFI file endpoint. A
200 response from the API indicates that the encryption was performed
correctly and the BFI can decrypt the file’s contents.