certificates

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 6 Imported by: 0

README

certificates

证书管理模块

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitModule

func InitModule(mb *application.ModuleBuilder)

InitModule ...

func InitModuleTest

func InitModuleTest(mb *application.ModuleBuilder)

InitModuleTest ...

Types

type Certificate

type Certificate interface {
	GetSolution() Solution
	GetInfo() *CertificateInfo
	GetEntity() CertificateEntity
	Equals(other Certificate) bool
}

Certificate ... 表示一张证书

type CertificateEntity

type CertificateEntity interface {
	Certificate() Certificate
}

CertificateEntity ...

type CertificateInfo

type CertificateInfo struct {
	Version           string
	SN                string
	StartedAt         time.Time
	StoppedAt         time.Time
	FingerprintSHA1   []byte
	FingerprintSHA256 []byte

	Subject Name
	Issuer  Name
}

CertificateInfo ...

type Chain

type Chain interface {
	GetParent() Chain
	GetCertificate() Certificate
}

Chain ... 表示证书连上的一个节点

type Name

type Name struct {
	Country, Organization, OrganizationalUnit string
	Locality, Province                        string
	StreetAddress, PostalCode                 string
	SerialNumber, CommonName                  string
}

Name ...

func (*Name) Equals

func (inst *Name) Equals(other *Name) bool

Equals ...

func (*Name) String

func (inst *Name) String() string

type Raw

type Raw struct {
	Data []byte
}

Raw ...

func (*Raw) Clone

func (inst *Raw) Clone() *Raw

Clone ...

type Root

type Root interface {
	Certificate
	Title() string
}

Root 表示根证书

type RootManager

type RootManager interface {
	ListAll() []Root
	Find(target *Name) (Root, error)
	Contains(cert Certificate) bool
}

RootManager 表示根证书管理器 [inject:"#certificate-root-manager"]

type RootRegistration

type RootRegistration struct {
	Title   string
	Raw     *Raw
	Enabled bool
}

RootRegistration 表示根证书注册信息

type RootRegistry

type RootRegistry interface {
	ListRegistrations() []*RootRegistration
}

RootRegistry 表示根证书注册对象 [inject:".certificate-root-registry"]

type Solution

type Solution interface {
	Load(raw *Raw) ([]Certificate, error)
	Verify(chain Chain, op *VerifyOptions) error
	GetInfo() *SolutionInfo
}

Solution ... 表示一套证书方案

type SolutionInfo

type SolutionInfo struct {
	Algorithm   string // like 'RSA'
	ContentType string // like 'block'
	Format      string // like 'x509'
}

SolutionInfo 方案信息

type SolutionManager

type SolutionManager interface {
	Solution

	MakeChain(certs []Certificate) (Chain, error)

	LoadChain(raw *Raw) (Chain, error)

	ListAll() []Solution
}

SolutionManager 表示证书方案管理器 [inject:"#certificate-solution-manager"]

type SolutionRegistration

type SolutionRegistration struct {
	Info     SolutionInfo
	Solution Solution
}

SolutionRegistration ...证书方案注册信息

type SolutionRegistry

type SolutionRegistry interface {
	GetRegistration() *SolutionRegistration
}

SolutionRegistry ... 证书方案注册人 [inject:".certificate-solution-registry"]

type VerifyOptions

type VerifyOptions struct {
	IgnoreTime    bool
	IgnoreRoot    bool
	IgnoreParents bool
}

VerifyOptions ...

Directories

Path Synopsis
gen
lib
src

Jump to

Keyboard shortcuts

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