google

package
v0.0.0-...-e47c4f4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0, ISC, MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(url string) ([]byte, string, error)

Fetch returns reader to be passed to Parse

func VersionRequestURL

func VersionRequestURL() string

VersionRequestURL returns a URL from which the current CRLSet version information can be fetched.

Types

type CRLSet

type CRLSet struct {
	Version      string
	IssuerLists  map[string]*IssuerList
	Sequence     int
	NumParents   int
	BlockedSPKIs []string
}

CRLSet - data structure for storing CRLSet data, used by methods below

func FetchAndParse

func FetchAndParse() (*CRLSet, error)

FetchAndParse - fetch from distribution point, parse to CRLSet struct as defined above

func Parse

func Parse(in []byte, version string) (*CRLSet, error)

Parse - given a reader for a raw byte stream for a CRLSet, parse the file into a usable CRLSet struct instance. DUE TO THE DIFFICULTY OF RETRIEVING A CRLSET, IT IS HIGHLY RECOMMENDED TO JUST USE THE FetchAndParseCRLSet FUNCTION PROVIDED ABOVE

func (*CRLSet) Check

func (crlSet *CRLSet) Check(cert *x509.Certificate, issuerSPKIHash string) *Entry

Check - Given a parsed CRLSet, check if a given cert is present

type CRLSetHeader

type CRLSetHeader struct {
	Sequence     int
	NumParents   int
	BlockedSPKIs []string
}

CRLSetHeader is used to parse the JSON header found in CRLSet files.

type CRXHeader

type CRXHeader struct {
	Magic     [4]byte
	Version   uint32
	HeaderLen uint32
}

CRXHeader reflects the binary header of a CRX file.

type Entry

type Entry struct {
	SerialNumber *big.Int
}

Entry - entry for a single certificate

type IssuerList

type IssuerList struct {
	SPKIHash string // SHA256 of Issuer SPKI
	Entries  []*Entry
}

IssuerList - list of revoked certificate entries for a given issuer

type Provider

type Provider interface {
	FetchAndParse() (*CRLSet, error)
}

Provider specifies CRLSet provider interface

func NewProvider

func NewProvider(requestURL string) Provider

NewProvider returns default Provider

type RawCRLSetSerial

type RawCRLSetSerial struct {
	Len         uint8
	SerialBytes []byte
}

RawCRLSetSerial - structure of certificate serial number in a raw CRLSet entry

type RawEntry

type RawEntry struct {
	SPKIHash   [32]byte // SHA256 of Issuer SPKI
	NumSerials uint32
	Serials    []RawCRLSetSerial
}

RawEntry - structure for a raw CRLSet entry

type ZipReader

type ZipReader []byte

ZipReader is a small wrapper around a []byte which implements ReadAt.

func (ZipReader) ReadAt

func (z ZipReader) ReadAt(p []byte, pos int64) (int, error)

ReadAt - Implementation of ReadAt for ZipReader App

Jump to

Keyboard shortcuts

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