logid

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package logid provides a type and accompanying helpers for manipulating log IDs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogID

type LogID [sha256.Size]byte

LogID is a unique identifier for a CT Log derived from its public key as described by RFC6962 sect. 3.2. Since it is derived from a SHA-256 hash, its length is fixed at 32 bytes.

func FromB64

func FromB64(logIDB64 string) (LogID, error)

FromB64 returns a LogID from parsing the supplied base64-encoded Log ID.

func FromB64OrDie

func FromB64OrDie(logIDB64 string) LogID

FromB64OrDie returns a LogID from parsing supplied base64-encoded data that we assert is already well-formed, so it 'cannot fail'.

func FromBytes

func FromBytes(bytes []byte) (LogID, error)

FromBytes returns a LogID copied from the supplied byte slice.

func FromPubKeyB64

func FromPubKeyB64(pubKeyB64 string) (LogID, error)

FromPubKeyB64 takes a base64 encoded DER public key, and converts it into a LogID, as defined in RFC6962 - i.e. the SHA-256 hash of the base64 decoded bytes of the log's public key.

func FromPubKeyB64OrDie

func FromPubKeyB64OrDie(pubKeyB64 string) LogID

FromPubKeyB64OrDie takes a base64 encoded DER public key, and converts it into a LogID, as defined in RFC6962 - i.e. the sha256 hash of the base64 decoded bytes of the log's public key. This is for data that we assert is already well-formed, so it 'cannot fail'.

func (LogID) Bytes

func (l LogID) Bytes() []byte

Bytes returns the raw bytes of the LogID, as a slice.

func (LogID) String

func (l LogID) String() string

String base64-encodes a LogID for ease of debugging.

Jump to

Keyboard shortcuts

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