Skip to content

Commit

Permalink
Merge pull request #5 from xmidt-org/add-jwtxt
Browse files Browse the repository at this point in the history
Add a working txt record fetcher that produces the instructions needed.
  • Loading branch information
schmidtw authored Sep 23, 2023
2 parents d5cbf29 + 5cc3a32 commit ed4223b
Show file tree
Hide file tree
Showing 9 changed files with 1,078 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
go.work

xmidt-agent

internal/jwtxt/cmd/example/*
11 changes: 10 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@ go 1.21.0

require (
github.com/alecthomas/kong v0.8.0
github.com/foxcpp/go-mockdns v1.0.0
github.com/golang-jwt/jwt/v5 v5.0.1-0.20230913133926-0cb4fa15e31b
github.com/goschtalt/goschtalt v0.22.1
github.com/goschtalt/yaml-decoder v0.0.1
github.com/goschtalt/yaml-encoder v0.0.3
github.com/stretchr/testify v1.8.4
github.com/xmidt-org/eventor v0.0.0-20230910205925-8ff168bd12ed
github.com/xmidt-org/sallust v0.2.2
github.com/xmidt-org/wrp-go/v3 v3.2.0
go.uber.org/fx v1.20.0
go.uber.org/zap v1.25.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/goschtalt/approx v1.0.0 // indirect
github.com/miekg/dns v1.1.25 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
go.uber.org/dig v1.17.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 // indirect
golang.org/x/net v0.0.0-20190923162816-aa69164e4478 // indirect
golang.org/x/sys v0.4.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
35 changes: 33 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI=
github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4=
github.com/golang-jwt/jwt/v5 v5.0.1-0.20230913133926-0cb4fa15e31b h1:rCJAwcE4lbPSvM8odqRshGj2NF3LDnJ8cv/duU1DeHo=
github.com/golang-jwt/jwt/v5 v5.0.1-0.20230913133926-0cb4fa15e31b/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/goschtalt/approx v1.0.0 h1:q8DMVEOSgwjFUYsupwhLApMWhfbaxRfWeSKT2uTU214=
github.com/goschtalt/approx v1.0.0/go.mod h1:Mh0VbpeEgO2Qo2PKGrSuz241D/nj9q7OPegJNWzrbIU=
github.com/goschtalt/goschtalt v0.22.1 h1:IcfNMSQMouZUsZnlzQlvGeVaDPJX1oB+hPPXXonpRq8=
Expand All @@ -24,6 +30,8 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg=
github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -34,8 +42,14 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/xmidt-org/eventor v0.0.0-20230910205925-8ff168bd12ed h1:KpcgFuumKrt/824H3gtmNI/IvgjsBo6rnlSnwXlFu60=
github.com/xmidt-org/eventor v0.0.0-20230910205925-8ff168bd12ed/go.mod h1:X9Og+8y1Llz7N8F20UmjZUNgrxHubMVfBcroJ5SPtIY=
github.com/xmidt-org/sallust v0.2.2 h1:MrINLEr7cMj6ENx/O76fvpfd5LNGYnk7OipZAGXPYA0=
github.com/xmidt-org/sallust v0.2.2/go.mod h1:ytBoypcPw10OmjM6b92Jx3eoqWX4J5zVXOQozGwz4qs=
github.com/xmidt-org/wrp-go/v3 v3.2.0 h1:XX5c0ZJYaTEvlHFk0lzxadoOMbxg5YtUkPWNXHoxTDE=
github.com/xmidt-org/wrp-go/v3 v3.2.0/go.mod h1:46ily/xzmRUhs8gSbTKNeOA6ztwcHauZFnfr4hRpoHA=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/dig v1.17.0 h1:5Chju+tUvcC+N7N6EV08BJz41UZuO3BmHcN4A287ZLI=
Expand All @@ -44,12 +58,29 @@ go.uber.org/fx v1.20.0 h1:ZMC/pnRvhsthOZh9MZjMq5U8Or3mA9zBSPaLnzs3ihQ=
go.uber.org/fx v1.20.0/go.mod h1:qCUj0btiR3/JnanEr1TYEePfSw6o/4qYJscgvzQ5Ub0=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.13.0 h1:a0T3bh+7fhRyqeNbiC3qVHYmkiQgit3wnNan/2c0HMM=
gonum.org/v1/gonum v0.13.0/go.mod h1:/WPYRckkfWrhWefxyYTfrTtQR0KH4iyHNuzxqXAKyAU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
62 changes: 62 additions & 0 deletions internal/jwtxt/cmd/example/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
// SPDX-License-Identifier: Apache-2.0

package main

import (
"context"
"fmt"
"os"
"time"

"github.com/xmidt-org/xmidt-agent/internal/jwtxt"
"github.com/xmidt-org/xmidt-agent/internal/jwtxt/event"
)

func main() {
url := os.Args[1]
id := os.Args[2]
pemFile := os.Args[3]

pem, err := os.ReadFile(pemFile)
if err != nil {
panic(err)
}

instructions, err := jwtxt.New(
jwtxt.BaseURL(url),
jwtxt.DeviceID(id),
jwtxt.Algorithms("EdDSA",
"ES256", "ES384", "ES512",
"PS256", "PS384", "PS512",
"RS256", "RS384", "RS512"),
jwtxt.WithPEMs(pem),
jwtxt.Timeout(5*time.Second),
jwtxt.WithFetchListener(event.FetchListenerFunc(func(fe event.Fetch) {
fmt.Printf(" FQDN: %s\n", fe.FQDN)
fmt.Printf(" Server: %s\n", fe.Server)
fmt.Printf(" Found: %t\n", fe.Found)
fmt.Printf(" Timeout: %t\n", fe.Timeout)
fmt.Printf("PriorExpiration: %s\n", fe.PriorExpiration)
fmt.Printf(" Expiration: %s\n", fe.Expiration)
fmt.Printf(" TemporaryErr: %t\n", fe.TemporaryErr)
fmt.Printf(" Endpoint: %s\n", fe.Endpoint)
fmt.Printf(" Payload: %s\n", fe.Payload)
if fe.Err != nil {
fmt.Printf(" Err: %s\n", fe.Err)
} else {
fmt.Printf(" Err: nil\n")
}
})),
)
if err != nil {
panic(err)
}

endpoint, err := instructions.Endpoint(context.Background())
if err != nil {
panic(err)
}

fmt.Printf("\n\nEndpoint: '%s'\n", endpoint)
}
53 changes: 53 additions & 0 deletions internal/jwtxt/event/events.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
// SPDX-License-Identifier: Apache-2.0

package event

import (
"time"
)

// Fetch is an event that is emitted when a TXT record fetch is attempted.
type Fetch struct {
// FQDN is the fully qualified domain name of the TXT record.
FQDN string

// Server is the DNS server that was queried.
Server string

// Found indicates whether the TXT record was found.
Found bool

// Timeout indicates whether the query timed out.
Timeout bool

// PriorExpiration is the expiration time of the previous TXT record.
PriorExpiration time.Time

// Expiration is the expiration time of the TXT record.
Expiration time.Time

// TemporaryErr indicates whether a temporary error occurred during the query.
TemporaryErr bool

// The endpoint that was found in the TXT record.
Endpoint string

// Payload is the payload of the TXT record.
Payload []byte

// Err indicates whether an error occurred during the query.
Err error
}

// FetchListener is a sink for registration events.
type FetchListener interface {
OnFetchEvent(Fetch)
}

// FetchListenerFunc is a function type that implements FetchListener.
type FetchListenerFunc func(Fetch)

func (f FetchListenerFunc) OnFetchEvent(fe Fetch) {
f(fe)
}
77 changes: 77 additions & 0 deletions internal/jwtxt/keypairs_for_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
// SPDX-License-Identifier: Apache-2.0

package jwtxt

const (
pemECPublic = "" + //nolint:golint,unused
"-----BEGIN PUBLIC KEY-----\n" +
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2JebmtU5WHi5yHBHmzhyiEGbg6OL\n" +
"r463xYdqs/Nzlh2OkaIikanpi7opOuD6wiqFVd9xaMjA54L5vjb5oLcLuA==\n" +
"-----END PUBLIC KEY-----"

pemECPrivate = "" + //nolint:golint,unused
"-----BEGIN EC PRIVATE KEY-----\n" +
"MHcCAQEEIHJCsQFvPLEV45BXU3DLWEVUPiKSYte8knw7ZtrIj6YxoAoGCCqGSM49\n" +
"AwEHoUQDQgAE2JebmtU5WHi5yHBHmzhyiEGbg6OLr463xYdqs/Nzlh2OkaIikanp\n" +
"i7opOuD6wiqFVd9xaMjA54L5vjb5oLcLuA==\n" +
"-----END EC PRIVATE KEY-----"

pemEdPublic = "" + //nolint:golint,unused
"-----BEGIN PUBLIC KEY-----\n" +
"MCowBQYDK2VwAyEA0WQIwE/DiCikp79XIkJ0H1vDiERaOieGL/1N8B+k7s8=\n" +
"-----END PUBLIC KEY-----\n"

pemEdPrivate = "" + //nolint:golint,unused
"-----BEGIN PRIVATE KEY-----\n" +
"MC4CAQAwBQYDK2VwBCIEIHdPSdNde11yNaBYj+q/4044LbOo2lVAb73u7aL13UcH\n" +
"-----END PRIVATE KEY-----"

pemRSAPublic = "" + //nolint:golint,unused
"-----BEGIN PUBLIC KEY-----\n" +
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx3HGBMr6UCtsABqMkG9s\n" +
"w0DLRuRZK9M4b535T4vC3i37+3YCLHB9wvOhEOo6b7h6lJehX9Px7pL3ppWu+tr9\n" +
"LuCxW+Nz46gpgKAXvVbbuc7VU2O0XUBuus0WsOgUQUzqHN6ZNpA/eY3mMndEKR79\n" +
"DWdJMSNylBPGvS54WEtgIE8hDor/pPx/cTleXGXq3DasfqnoOlD/ALKL0eqkzbnX\n" +
"GGUzN2K79RCw7mm/CQeS5a7mLgRypT83fR3Kg1SgsyXCUjTNPupQVgWggxfWbRIj\n" +
"T5Q1LkBRl3SDKM6OaPb3xh5NncuQktbjSFO5NLlGdL6Ylzfm0OlK3nBvrpfmac46\n" +
"7QIDAQAB\n" +
"-----END PUBLIC KEY-----\n"

pemRSAPrivate = "" + //nolint:golint,unused
"-----BEGIN RSA PRIVATE KEY-----\n" +
"MIIEowIBAAKCAQEAx3HGBMr6UCtsABqMkG9sw0DLRuRZK9M4b535T4vC3i37+3YC\n" +
"LHB9wvOhEOo6b7h6lJehX9Px7pL3ppWu+tr9LuCxW+Nz46gpgKAXvVbbuc7VU2O0\n" +
"XUBuus0WsOgUQUzqHN6ZNpA/eY3mMndEKR79DWdJMSNylBPGvS54WEtgIE8hDor/\n" +
"pPx/cTleXGXq3DasfqnoOlD/ALKL0eqkzbnXGGUzN2K79RCw7mm/CQeS5a7mLgRy\n" +
"pT83fR3Kg1SgsyXCUjTNPupQVgWggxfWbRIjT5Q1LkBRl3SDKM6OaPb3xh5NncuQ\n" +
"ktbjSFO5NLlGdL6Ylzfm0OlK3nBvrpfmac467QIDAQABAoIBADvDuaFdC6YzZNEh\n" +
"I4byhMZ7p45ORfROfoZf8cHm8RVv9SbUpXEYom7lX5n4fltVDhJx348eLUye6KwY\n" +
"BY+xSJYgCbWt0l/hV9Jt5r87hGtI8f7jjTw2XxgF9es8GDm7KRpOj93cWtD7dwQf\n" +
"XiLuYMj/7txVMXPy+yZcgv5+U8dKN18EUbUWxxH+JvS/BHA2klhVMY/S6wneiGli\n" +
"i5ZWFag/NAWWFH5rY0pYZIJ059xzzaDQGXihuAq6MhhoRhvwh50HxUKGnDHNGJ7Q\n" +
"MFs7Mbr16gYDgOGlHT2HGDsdvKp9X3KVyQmUNtCNX2B9CRX1b1d3ofey9VD/tMAT\n" +
"07GE/pcCgYEA7ILWxRFR1nTHc+nNdi39nwULkwsO1Qwc3XKnXPqxl/F2M4HZFGHR\n" +
"rcaWBZ/sTqj8P52AgJq9QNoOZ9dKCpCVfPawHYo6zyPb0XF9Od6mT3KAm8AeDLya\n" +
"0yrh0XCnOhzS09dTueNXbUYIDlHFkK8WXF+J0Gwh0oxEtSnZUf2P+F8CgYEA1+EF\n" +
"CKAiqfd+vKyku6FjoE89O1dc4CuJEMXGhgZ88rn4fec3Eqms6155+4DMwwyo0hvF\n" +
"nyoBeb/5/WJJm2EKnbSjSJ9uxFSeguIeIC2SiZCnQrEwUPMzcG9UjOr9UB67cim7\n" +
"N9d+kcV4DFe2knBqv7Iuvk0YLF6X7XBAXzT4QDMCgYEA43iTh8Y4p8J5coqUCe4B\n" +
"2EfJ8grYoR+dQ39aaJrU5AZgYPmqB2htem1dLNu7M4xjz+t0BDzPeOhAoq71j2Ov\n" +
"4xiAGmkwVrluWeqFPnteCVtfRm1oeWeMoTzFI+Ltc371Zrna1RZKp9aLOPp8wcMk\n" +
"BoP80HCvtwkhq/wsACeXqJECgYAdSJ7gLqjFGZeNjHXEJf5XrqgFtrIYjo9HQSzO\n" +
"3W5xlpyIp6am13FndCdj4HLmOn9kEPRbxNzyYQJORtjpRN6lye0kWswxwbDG3Flt\n" +
"0ADCvGaT+2kscfEWXWPAwdee2KxgrhyBVLAMohbIxdU0RB+W5VrF4btXuXUudj2l\n" +
"LJBIVQKBgCHdEUCWOacO5+B/yZijAbRTnKHH4Ht3B3bYJy6M5qIysSVzG4/Pls90\n" +
"bAQvlAyBG5I+yY1zBfeziI6Uopg/XCrxNNv+8sxiPXt1D8QkCPN08wKulj7DnCuf\n" +
"re3wR8zUZNUhRARSWJa68r7sDJVxxDxZjeh3OywmEBPYpQTBM5sa\n" +
"-----END RSA PRIVATE KEY-----\n"
)

func publicECOption() Option {
return WithPEMs([]byte(pemECPublic))
}

func anyPublicOption() Option {
return WithPEMs([]byte(pemECPublic), []byte(pemEdPublic), []byte(pemRSAPublic))
}
Loading

0 comments on commit ed4223b

Please sign in to comment.