github.com/storacha/go-ucanto@v0.7.2/principal/lib.go (about) 1 package principal 2 3 import ( 4 "github.com/storacha/go-ucanto/ucan" 5 ) 6 7 // Signer is the principal that can issue UCANs (and sign payloads). While it's 8 // primary role is to sign payloads it also provides a `Verifier` interface so 9 // it can be used for verifying signed payloads as well. 10 type Signer interface { 11 ucan.Signer 12 Code() uint64 13 Verifier() Verifier 14 Encode() []byte 15 // Raw encodes the bytes of the private key without multiformats tags. 16 Raw() []byte 17 } 18 19 // Verifier is the principal that issued a UCAN. In usually represents remote 20 // principal and is used to verify that certain payloads were signed by it. 21 type Verifier interface { 22 ucan.Verifier 23 Code() uint64 24 Encode() []byte 25 // Raw encodes the bytes of the public key without multiformats tags. 26 Raw() []byte 27 }