Documentation ¶
Index ¶
- Constants
- func EncodeSignature(sig, pubKey []byte) ([]byte, error)
- func ExtractPubKey(ownerProof []byte) ([]byte, error)
- func OwnerProofer(signer Signer, pubKey []byte) func([]byte) ([]byte, error)
- func OwnerProoferForSigner(signer Signer) func([]byte) ([]byte, error)
- func OwnerProoferSecp256K1(privKey, pubKey []byte) func([]byte) ([]byte, error)
- func RegisterDefaultRunner(runner PredicateRunner)
- func RunPredicate(pb PredicateBytes, sig []byte, sigData []byte) error
- type P2pkh256Signature
- type Predicate
- type PredicateBytes
- type PredicateRunner
- type Signer
Constants ¶
const MaxBearerBytes = 65536
Variables ¶
This section is empty.
Functions ¶
func EncodeSignature ¶
func ExtractPubKey ¶
func OwnerProofer ¶
OwnerProofer returns function which can be used as OwnerProof generator. "pubKey" must be the public key of the "signer". The generator function takes "bytes to sign" as a parameter and returns serialized owner proof (CBOR encoded Signature struct).
func OwnerProoferForSigner ¶
OwnerProoferForSigner returns OwnerProof generator for the signer. Prefer OwnerProofer(signer, pubKey) variation when pubKey of the signer is also already available.
func OwnerProoferSecp256K1 ¶
OwnerProoferSecp256K1 is like OwnerProofer but takes private / public key pair as a parameter. Keys are assumed to be ECDSA keys for the secp256k1 curve.
func RegisterDefaultRunner ¶
func RegisterDefaultRunner(runner PredicateRunner)
func RunPredicate ¶
func RunPredicate(pb PredicateBytes, sig []byte, sigData []byte) error
Types ¶
type P2pkh256Signature ¶
type P2pkh256Signature struct { Sig []byte PubKey []byte // contains filtered or unexported fields }
P2pkh256Signature is a signature and public key pair, typically used as owner proof (ie the public key can be used to verify the signature).
type Predicate ¶
type Predicate struct { Tag uint64 Code []byte Params []byte // contains filtered or unexported fields }
func ExtractPredicate ¶
type PredicateBytes ¶
type PredicateBytes []byte