-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tool for generating KMS-encrypted CA keys
Previously you had to run ssh-keygen temporarily storing the output in a file before using this utility to encrypt the key. Now you can simply have this tool generate the key and send the private directly to KMS for encryption. This should be both simpler and more secure.
- Loading branch information
Showing
4 changed files
with
143 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestRsaGeneration(t *testing.T) { | ||
rsaKey, err := generateRsa() | ||
if err != nil { | ||
t.Errorf("failed to generate rsa key: %s", err) | ||
} | ||
if !strings.Contains(string(rsaKey), "RSA PRIVATE KEY") { | ||
t.Errorf("Didn't generate an RSA key?: %s", rsaKey) | ||
} | ||
} | ||
|
||
func TestEcdsaGeneration(t *testing.T) { | ||
ecdsaKey, err := generateEcdsa() | ||
if err != nil { | ||
t.Errorf("failed to generate ecdsa key: %s", err) | ||
} | ||
if !strings.Contains(string(ecdsaKey), "EC PRIVATE KEY") { | ||
t.Errorf("Didn't generate an ECDSA key?: %s", ecdsaKey) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters