MasterKeyFromRecipient takes a Bech32-encoded age public key, parses it, and returns a new MasterKey.
(recipient string)
| 117 | // MasterKeyFromRecipient takes a Bech32-encoded age public key, parses it, and |
| 118 | // returns a new MasterKey. |
| 119 | func MasterKeyFromRecipient(recipient string) (*MasterKey, error) { |
| 120 | recipient = strings.TrimSpace(recipient) |
| 121 | parsedRecipient, err := parseRecipient(recipient) |
| 122 | if err != nil { |
| 123 | return nil, err |
| 124 | } |
| 125 | return &MasterKey{ |
| 126 | Recipient: recipient, |
| 127 | parsedRecipient: parsedRecipient, |
| 128 | }, nil |
| 129 | } |
| 130 | |
| 131 | // ParsedIdentities contains a set of parsed age identities. |
| 132 | // It allows for creating a (local) keyservice.KeyServiceServer which parses |