issuedb

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExist = errors.New("issuedb: Entry does not exist.")

Functions

func RandInt63

func RandInt63(randr io.Reader) (n int64)

Types

type Entry

type Entry struct {
	SerialNumber   int64  `json:"sn"`
	State          State  `json:"state"`
	CertificatePEM string `json:"certPem"`
}

func (*Entry) ParseCertificate added in v0.2.3

func (e *Entry) ParseCertificate() (*x509.Certificate, error)

type IssueDB

type IssueDB struct {
	// contains filtered or unexported fields
}

func New

func New(jsonFilePath string) (*IssueDB, error)

func (*IssueDB) AllocateSerialNumber

func (db *IssueDB) AllocateSerialNumber(randr io.Reader) (int64, error)

func (*IssueDB) Entries

func (db *IssueDB) Entries() ([]Entry, error)

func (*IssueDB) Initialize

func (db *IssueDB) Initialize() error

func (*IssueDB) IssueCertificate

func (db *IssueDB) IssueCertificate(n int64, pem string) error

func (*IssueDB) Query

func (db *IssueDB) Query(n int64) (Entry, error)

type State

type State int
const (
	IssueInProgress State = iota
	ActiveCertificate
	MaxState = ActiveCertificate
)

func (State) MarshalJSON

func (s State) MarshalJSON() ([]byte, error)

func (State) String

func (s State) String() string

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(bs []byte) error

Jump to

Keyboard shortcuts

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