certification

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 8 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 RootKey = "" /* 266-byte string literal not displayed */

RootKey is the root key of IC main net.

Variables

This section is empty.

Functions

func PublicKeyFromDER added in v0.4.5

func PublicKeyFromDER(der []byte) (*bls.PublicKey, error)

func PublicKeyToDER added in v0.4.5

func PublicKeyToDER(publicKey []byte) ([]byte, error)

func VerifyCertificate added in v0.4.5

func VerifyCertificate(
	certificate Certificate,
	canisterID principal.Principal,
	rootPublicKey []byte,
) error

func VerifyCertifiedData added in v0.4.5

func VerifyCertifiedData(
	certificate Certificate,
	canisterID principal.Principal,
	rootPublicKey []byte,
	certifiedData []byte,
) error

Types

type Certificate

type Certificate 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"`
}

Certificate is a certificate gets returned by the IC.

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