diff options
| author | Shulhan <ms@kilabit.info> | 2026-03-30 19:38:32 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-03-30 21:07:31 +0700 |
| commit | 7af6aa612bc60df120d7580c9e436b24d2326394 (patch) | |
| tree | 3dcff3ecc05c43c33653c511aff7925a1258965b /lib/paseto/v2/public_mode.go | |
| parent | 61a44bf239f5545080af83f890d488ceaf257a80 (diff) | |
| download | pakakeh.go-7af6aa612bc60df120d7580c9e436b24d2326394.tar.xz | |
lib/paseto: rename the field Public and Private in Peer
Diffstat (limited to 'lib/paseto/v2/public_mode.go')
| -rw-r--r-- | lib/paseto/v2/public_mode.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/paseto/v2/public_mode.go b/lib/paseto/v2/public_mode.go index c10a7a42..b4714e43 100644 --- a/lib/paseto/v2/public_mode.go +++ b/lib/paseto/v2/public_mode.go @@ -37,7 +37,7 @@ func NewPublicMode(our paseto.Peer) (auth *PublicMode, err error) { if len(our.ID) == 0 { return nil, errors.New(`empty key ID`) } - if len(our.Private) == 0 { + if len(our.PrivateKey) == 0 { return nil, errors.New(`empty private key`) } auth = &PublicMode{ @@ -85,7 +85,7 @@ func (auth *PublicMode) AddPeer(k paseto.Peer) (err error) { if len(k.ID) == 0 { return errors.New(`empty key ID`) } - if len(k.Public) == 0 { + if len(k.PublicKey) == 0 { return errors.New(`empty public key`) } auth.peers.upsert(k) @@ -133,7 +133,7 @@ func (auth *PublicMode) Pack(audience, subject string, data []byte, footer map[s return "", err } - return Sign(auth.our.Private, msg, rawfooter) + return Sign(auth.our.PrivateKey, msg, rawfooter) } // Unpack the token to get the Payload and the data. @@ -171,7 +171,7 @@ func (auth *PublicMode) Unpack(token string) (msg *paseto.Message, err error) { return nil, err } - payload, err := Verify(peerKey.Public, msgSig, rawfooter) + payload, err := Verify(peerKey.PublicKey, msgSig, rawfooter) if err != nil { return nil, err } |
