// Parse the unseal keys from the stdout returned from the vault init command.
//
// The format we're expecting is:
//
// Unseal Key 1: Gi9xAX9rFfmHtSi68mYOh0H3H2eu8E77nvRm/0fsuwQB
// Unseal Key 2: ecQjHmaXc79GtwJN/hYWd/N2skhoNgyCmgCfGqRMTPIC
// Unseal Key 3: LEOa/DdZDgLHBqK0JoxbviKByUAgxfm2dwK4y1PX6qED
// Unseal Key 4: ZY87ijsj9/f5fO7ufgr4yhPWU/2ZZM3BGuSQRDFZpwoE
// Unseal Key 5: MAiCaGrtikp4zU4XppC1A8IhKPXRlzj19+a3lcbCAVkF
Parse the unseal keys from the stdout returned from the vault init command.

The format we're expecting is.

Unseal Key 1: Gi9xAX9rFfmHtSi68mYOh0H3H2eu8E77nvRm/0fsuwQB
Unseal Key 2: ecQjHmaXc79GtwJN/hYWd/N2skhoNgyCmgCfGqRMTPIC
Unseal Key 3: LEOa/DdZDgLHBqK0JoxbviKByUAgxfm2dwK4y1PX6qED
Unseal Key 4: ZY87ijsj9/f5fO7ufgr4yhPWU/2ZZM3BGuSQRDFZpwoE
Unseal Key 5: MAiCaGrtikp4zU4XppC1A8IhKPXRlzj19+a3lcbCAVkF
// Parse the unseal keys from the stdout returned from the vault init command . // // The format we ' re expecting is : // // Unseal Key 1 : Gi9xAX9rFfmHtSi68mYOh0H3H2eu8E77nvRm / 0fsuwQB // Unseal Key 2 : ecQjHmaXc79GtwJN / hYWd / N2skhoNgyCmgCfGqRMTPIC // Unseal Key 3 : LEOa / DdZDgLHBqK0JoxbviKByUAgxfm2dwK4y1PX6qED // Unseal Key 4 : ZY87ijsj9 / f5fO7ufgr4yhPWU / 2ZZM3BGuSQRDFZpwoE // Unseal Key 5 : MAiCaGrtikp4zU4XppC1A8IhKPXRlzj19 + a3lcbCAVkF
func parseUnsealKeysFromVaultInitResponse(t *testing.T, vaultInitResponse string) []string {
	lines := strings.Split(vaultInitResponse, "\n")
	if len(lines) < 3 {
		t.Fatalf("Did not find at least three lines of in the vault init stdout: %s", vaultInitResponse)
	}
	unsealKey1 := parseUnsealKey(t, lines[0])
	unsealKey2 := parseUnsealKey(t, lines[1])
	unsealKey3 := parseUnsealKey(t, lines[2])
	return []string{unsealKey1, unsealKey2, unsealKey3}
}
func parseUnsealKeysFromVaultInitResponse ( t * testing . T , vaultInitResponse string ) [ ] string { lines := strings . Split ( vaultInitResponse , " \n " ) if len ( lines ) < 3 { t . Fatalf ( " " , vaultInitResponse ) } unsealKey1 := parseUnsealKey ( t , lines [ 0 ] ) unsealKey2 := parseUnsealKey ( t , lines [ 1 ] ) unsealKey3 := parseUnsealKey ( t , lines [ 2 ] ) return [ ] string { unsealKey1 , unsealKey2 , unsealKey3 } }
Parse the unseal keys from the stdout returned from the vault init command.
Parse the unseal keys from the stdout returned from the vault init command .
// By default, Vault requires 3 unseal keys out of 5, so just parse those first three