certification

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Certificates

A certificate consists of

  • a tree.
  • a signature on the tree root hash valid under some public key.
  • an optional delegation that links that public key to root public key.

Read More

Documentation

Index

Constants

View Source
const DerPrefix = "308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100"

DerPrefix is the DER prefix of IC main net.

View Source
const RootKey = "" /* 266-byte string literal not displayed */

RootKey is the root key of IC main net.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert

type Cert struct {
	// Tree is the certificate tree.
	Tree hashtree.HashTree `cbor:"tree"`
	// Signature is the signature of the certificate tree.
	Signature []byte `cbor:"signature"`
	// Delegation is the delegation of the certificate.
	Delegation *Delegation `cbor:"delegation"`
}

Cert is a certificate gets returned by the IC.

type Certificate

type Certificate struct {
	Cert       Cert
	RootKey    []byte
	CanisterID principal.Principal
}

Certificate is a certificate that gets returned by the IC and can be used to verify the state root based on the root key and canister ID.

func New

func New(canisterID principal.Principal, rootKey []byte, certificate []byte) (*Certificate, error)

New creates a new certificate.

func (Certificate) Verify

func (c Certificate) Verify() error

Verify verifies the certificate.

type Delegation

type Delegation struct {
	// SubnetId is the subnet ID of the delegation.
	SubnetId principal.Principal `cbor:"subnet_id"`
	// The nested certificate typically does not itself again contain a
	// delegation, although there is no reason why agents should enforce that
	// property.
	Certificate Certificate `cbor:"certificate"`
}

Delegation is a delegation of a certificate.

func (*Delegation) UnmarshalCBOR

func (d *Delegation) UnmarshalCBOR(bytes []byte) error

UnmarshalCBOR unmarshals a delegation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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