add server/issuer/client examples, and lots of sanding

This commit is contained in:
Michael Muré
2025-02-03 16:17:30 +01:00
committed by Michael Muré
parent 1098a834fb
commit 55f38fef4a
7 changed files with 563 additions and 12 deletions

View File

@@ -0,0 +1,24 @@
package example
import (
"encoding/base64"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/ucan-wg/go-ucan/did"
)
// Endpoints
var ServerUrl = ":8080"
var IssuerUrl = ":8081"
// Service
var ServicePrivKey crypto.PrivKey
var ServiceDid did.DID
func init() {
privRaw, _ := base64.StdEncoding.DecodeString("CAESQGs7hPBRBmxH1UmHrdcPrBkecuFUuCWHK0kMJvZYCBqIa35SGxUdXVGuigQDkMpf7xO4C2C2Acl8QTtSrYS7Cnc=")
ServicePrivKey, _ = crypto.UnmarshalPrivateKey(privRaw)
ServiceDid, _ = did.FromPrivKey(ServicePrivKey)
}