KEINOS / go-totp

Simple Go package to implement TOTP authentication functionality to the Go app. It supports ECDH as well.
MIT License
11 stars 0 forks source link

Feature: add additional fields for PEM output #39

Open KEINOS opened 2 months ago

KEINOS commented 2 months ago

Currently, exporting the generated Key object in PEM format supports the least fields by default.

For the future usage (such as ECDH support, #37), PEM key may require additional fields. Context or protocol versions for example.

- func (k *Key) PEM() (string, error)
+ func (k *Key) PEM[T string|int](optField ...[string]T) (string, error)
KEINOS commented 2 months ago

We need to be careful implementing this.

Including custom fields (headers) to PEM is easy, but reading the PEM file and generate a new Key object will not include those customized fields.