Skip to content

Commit

Permalink
Gets example github actions pktoken
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanHeilman committed Jul 28, 2024
1 parent 81d2115 commit 6b906a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ghasign

import (
"context"
"encoding/base64"
"fmt"
"testing"

Expand All @@ -25,10 +26,15 @@ func TestGithub(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, pkt)
fmt.Println("New PK token generated")
pktCom, _ := pkt.Compact()

b64pktCom := base64.StdEncoding.EncodeToString(pktCom)
fmt.Println(string(b64pktCom))

ver, err := verifier.New(op)
require.NoError(t, err)

err = ver.VerifyPKToken(context.TODO(), pkt)
require.NoError(t, err)
require.Error(t, err)
}

0 comments on commit 6b906a4

Please sign in to comment.