verify

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CanisterSigPublicKeyDERObjectID = []byte{
		0x30, 0x0C, 0x06, 0x0A, 0x2B, 0x06, 0x01,
		0x04, 0x01, 0x83, 0xB8, 0x43, 0x01, 0x02,
	}
	CanisterSigPublicKeyPrefixLength = 19
)

Functions

This section is empty.

Types

type BEHexUint64

type BEHexUint64 uint64

func (*BEHexUint64) UnmarshalJSON

func (b *BEHexUint64) UnmarshalJSON(bytes []byte) error

type CanisterSigPublicKey

type CanisterSigPublicKey struct {
	CanisterID principal.Principal
	Seed       []byte
}

func CanisterSigPublicKeyFromDER

func CanisterSigPublicKeyFromDER(der []byte) (*CanisterSigPublicKey, error)

func (*CanisterSigPublicKey) DER

func (s *CanisterSigPublicKey) DER() []byte

func (*CanisterSigPublicKey) Raw

func (s *CanisterSigPublicKey) Raw() []byte

type Delegation

type Delegation struct {
	PublicKey  HexString   `json:"pubkey"`
	Expiration BEHexUint64 `json:"expiration"`
	Targets    []HexString `json:"targets"`
}

func (Delegation) SignatureMessage

func (d Delegation) SignatureMessage() ([]byte, error)

type DelegationChain

type DelegationChain struct {
	Delegations []SignedDelegation `json:"delegations"`
	PublicKey   HexString          `json:"publicKey"`
}

func (DelegationChain) VerifyChallenge

func (d DelegationChain) VerifyChallenge(
	challenge []byte,
	currentTimeNS uint64,
	canisterID principal.Principal,
	rootPublicKey []byte,
) error

type HexString

type HexString string

func (*HexString) UnmarshalJSON

func (h *HexString) UnmarshalJSON(bytes []byte) error

type SignedDelegation

type SignedDelegation struct {
	Delegation Delegation `json:"delegation"`
	Signature  HexString  `json:"signature"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL