File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,15 @@ func (r *Recipient) Name() string {
5252 return r .name
5353}
5454
55+ // String returns the recipient encoding string ("age1name1...") or
56+ // "<identity-based recipient>" if r was created by [Identity.Recipient].
57+ func (r * Recipient ) String () string {
58+ if r .identity {
59+ return "<identity-based recipient>"
60+ }
61+ return r .encoding
62+ }
63+
5564func (r * Recipient ) Wrap (fileKey []byte ) (stanzas []* age.Stanza , err error ) {
5665 stanzas , _ , err = r .WrapWithLabels (fileKey )
5766 return
@@ -193,6 +202,11 @@ func (i *Identity) Name() string {
193202 return i .name
194203}
195204
205+ // String returns the identity encoding string ("AGE-PLUGIN-NAME-1...").
206+ func (i * Identity ) String () string {
207+ return i .encoding
208+ }
209+
196210// Recipient returns a Recipient wrapping this identity. When that Recipient is
197211// used to encrypt a file key, the identity encoding is provided as-is to the
198212// plugin, which is expected to support encrypting to identities.
You can’t perform that action at this time.
0 commit comments