mirror of
https://github.com/google/nomulus.git
synced 2025-06-28 23:33:36 +02:00
Store encrypted file in Base64 encoding
It is better to store it ASCII armored so that it can be easily diffed to see if a file has changed ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=200045488
This commit is contained in:
parent
db60f0fd12
commit
6ca28386cd
2 changed files with 4 additions and 3 deletions
|
@ -176,8 +176,8 @@ created earlier:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ gcloud kms encrypt --plaintext-file <combined_secret.pem> \
|
$ gcloud kms encrypt --plaintext-file <combined_secret.pem> \
|
||||||
--ciphertext-file <combined_secret.pem.enc> \
|
--ciphertext-file - --key <key-name> --keyring <keyring-name> --location \
|
||||||
--key <key-name> --keyring <keyring-name> --location global
|
global | base64 > <combined_secret.pem.enc>
|
||||||
```
|
```
|
||||||
|
|
||||||
This encrypted file is then uploaded to a GCS bucket specified in the
|
This encrypted file is then uploaded to a GCS bucket specified in the
|
||||||
|
|
|
@ -49,6 +49,7 @@ import io.netty.handler.ssl.SslProvider;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Base64;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -249,7 +250,7 @@ public class ProxyModule {
|
||||||
.objects()
|
.objects()
|
||||||
.get(config.gcs.bucket, config.gcs.sslPemFilename)
|
.get(config.gcs.bucket, config.gcs.sslPemFilename)
|
||||||
.executeMediaAndDownloadTo(outputStream);
|
.executeMediaAndDownloadTo(outputStream);
|
||||||
return outputStream.toByteArray();
|
return Base64.getMimeDecoder().decode(outputStream.toByteArray());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
String.format(
|
String.format(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue