crlstore

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CRLLocationKey = "#CRL_LOCATIONS#"
View Source
const ExtendedMetaInfoKey string = "#META#_EXT"
View Source
const MetaInfoKey string = "#META#"
View Source
const SignatureCertKey = "#CRL_SIG_CERT#"

Variables

This section is empty.

Functions

func StoreTypeToString added in v1.0.4

func StoreTypeToString(storeType StoreType) string

Types

type ASN1Serializer

type ASN1Serializer struct {
}

func (ASN1Serializer) DeserializeCRLLocations

func (C ASN1Serializer) DeserializeCRLLocations(certDistPointsBytes []byte) (*core.CRLLocations, error)

func (ASN1Serializer) DeserializeMetaInfo

func (C ASN1Serializer) DeserializeMetaInfo(crlMetaBytes []byte) (*crlreader.CRLMetaInfo, error)

func (ASN1Serializer) DeserializeMetaInfoExt

func (C ASN1Serializer) DeserializeMetaInfoExt(crlExtMetaBytes []byte) (*crlreader.ExtendedCRLMetaInfo, error)

func (ASN1Serializer) DeserializeRevokedCert

func (C ASN1Serializer) DeserializeRevokedCert(revokedCertBytes []byte) (*pkix.RevokedCertificate, error)

func (ASN1Serializer) DeserializeSignatureCert

func (C ASN1Serializer) DeserializeSignatureCert(certBytes []byte) (*x509.Certificate, error)

func (ASN1Serializer) SerializeCRLLocations

func (C ASN1Serializer) SerializeCRLLocations(crlLocations *core.CRLLocations) ([]byte, error)

func (ASN1Serializer) SerializeMetaInfo

func (C ASN1Serializer) SerializeMetaInfo(metaInfo *crlreader.CRLMetaInfo) ([]byte, error)

func (ASN1Serializer) SerializeMetaInfoExt

func (C ASN1Serializer) SerializeMetaInfoExt(metaInfo *crlreader.ExtendedCRLMetaInfo) ([]byte, error)

func (ASN1Serializer) SerializeRevokedCert

func (C ASN1Serializer) SerializeRevokedCert(revokedCert *pkix.RevokedCertificate) ([]byte, error)

func (ASN1Serializer) SerializeSignatureCert

func (C ASN1Serializer) SerializeSignatureCert(cert *x509.Certificate) ([]byte, error)

type CRLPersisterProcessor

type CRLPersisterProcessor struct {
	CRLStore CRLStore
}

func (CRLPersisterProcessor) InsertRevokedCertificate

func (C CRLPersisterProcessor) InsertRevokedCertificate(entry *crlreader.CRLEntry) error

func (CRLPersisterProcessor) StartUpdateCrl

func (C CRLPersisterProcessor) StartUpdateCrl(crlMetaInfo *crlreader.CRLMetaInfo) error

func (CRLPersisterProcessor) UpdateCRLLocations

func (C CRLPersisterProcessor) UpdateCRLLocations(crlLocations *revocation.CRLLocations) error

func (CRLPersisterProcessor) UpdateExtendedMetaInfo

func (C CRLPersisterProcessor) UpdateExtendedMetaInfo(info *crlreader.ExtendedCRLMetaInfo) error

func (CRLPersisterProcessor) UpdateSignatureCertificate

func (C CRLPersisterProcessor) UpdateSignatureCertificate(entry *revocation.CertificateChainEntry) error

type CRLStore

type CRLStore interface {
	InsertRevokedCert(entry *crlreader.CRLEntry) error
	GetCertRevocationStatus(issuer *pkix.RDNSequence, certSerial *big.Int) (*core.RevocationStatus, error)
	StartUpdateCrl(info *crlreader.CRLMetaInfo) error
	GetCRLMetaInfo() (*crlreader.CRLMetaInfo, error)
	UpdateExtendedMetaInfo(extendedInfo *crlreader.ExtendedCRLMetaInfo) error
	GetCRLExtMetaInfo() (*crlreader.ExtendedCRLMetaInfo, error)
	UpdateSignatureCertificate(*core.CertificateChainEntry) error
	GetCRLSignatureCert() (*core.CertificateChainEntry, error)
	UpdateCRLLocations(points *core.CRLLocations) error
	GetCRLLocations() (*core.CRLLocations, error)
	Update(interface{}) error
	IsEmpty() bool
	Close()
	Delete() error
}

type Factory

type Factory interface {
	CreateStore(identifier string, temporary bool) (CRLStore, error)
}

func CreateStoreFactory added in v1.0.4

func CreateStoreFactory(storeType StoreType, repoBaseDir string, logger *zap.Logger) (Factory, error)

type LevelDbStore

type LevelDbStore struct {
	Db          *leveldb.DB
	Serializer  Serializer
	Identifier  string
	BasePath    string
	LevelDBPath string
	Logger      *zap.Logger
}

func (*LevelDbStore) Close

func (S *LevelDbStore) Close()

func (*LevelDbStore) Delete

func (S *LevelDbStore) Delete() error

func (*LevelDbStore) GetCRLExtMetaInfo

func (S *LevelDbStore) GetCRLExtMetaInfo() (*crlreader.ExtendedCRLMetaInfo, error)

func (*LevelDbStore) GetCRLLocations

func (S *LevelDbStore) GetCRLLocations() (*core.CRLLocations, error)

func (*LevelDbStore) GetCRLMetaInfo

func (S *LevelDbStore) GetCRLMetaInfo() (*crlreader.CRLMetaInfo, error)

func (*LevelDbStore) GetCRLSignatureCert

func (S *LevelDbStore) GetCRLSignatureCert() (*core.CertificateChainEntry, error)

func (*LevelDbStore) GetCertRevocationStatus

func (S *LevelDbStore) GetCertRevocationStatus(issuer *pkix.RDNSequence, certSerial *big.Int) (*core.RevocationStatus, error)

func (*LevelDbStore) InsertRevokedCert

func (S *LevelDbStore) InsertRevokedCert(entry *crlreader.CRLEntry) error

func (*LevelDbStore) IsEmpty

func (S *LevelDbStore) IsEmpty() bool

func (*LevelDbStore) StartUpdateCrl

func (S *LevelDbStore) StartUpdateCrl(info *crlreader.CRLMetaInfo) error

func (*LevelDbStore) Update

func (S *LevelDbStore) Update(store interface{}) error

func (*LevelDbStore) UpdateCRLLocations

func (S *LevelDbStore) UpdateCRLLocations(crlLocations *core.CRLLocations) error

func (*LevelDbStore) UpdateExtendedMetaInfo

func (S *LevelDbStore) UpdateExtendedMetaInfo(extMetaInfo *crlreader.ExtendedCRLMetaInfo) error

func (*LevelDbStore) UpdateSignatureCertificate

func (S *LevelDbStore) UpdateSignatureCertificate(entry *core.CertificateChainEntry) error

type LevelDbStoreFactory

type LevelDbStoreFactory struct {
	Serializer Serializer
	BasePath   string
	Logger     *zap.Logger
}

func (LevelDbStoreFactory) CreateStore

func (F LevelDbStoreFactory) CreateStore(identifier string, temporary bool) (CRLStore, error)

type MapStore

type MapStore struct {
	Map        map[string][]byte
	Serializer Serializer
	Logger     *zap.Logger
}

func (*MapStore) Close

func (S *MapStore) Close()

func (*MapStore) Delete

func (S *MapStore) Delete() error

func (*MapStore) GetCRLExtMetaInfo

func (S *MapStore) GetCRLExtMetaInfo() (*crlreader.ExtendedCRLMetaInfo, error)

func (*MapStore) GetCRLLocations

func (S *MapStore) GetCRLLocations() (*core.CRLLocations, error)

func (*MapStore) GetCRLMetaInfo

func (S *MapStore) GetCRLMetaInfo() (*crlreader.CRLMetaInfo, error)

func (*MapStore) GetCRLSignatureCert

func (S *MapStore) GetCRLSignatureCert() (*core.CertificateChainEntry, error)

func (*MapStore) GetCertRevocationStatus

func (S *MapStore) GetCertRevocationStatus(issuer *pkix.RDNSequence, certSerial *big.Int) (*core.RevocationStatus, error)

func (*MapStore) InsertRevokedCert

func (S *MapStore) InsertRevokedCert(entry *crlreader.CRLEntry) error

func (*MapStore) IsEmpty

func (S *MapStore) IsEmpty() bool

func (*MapStore) StartUpdateCrl

func (S *MapStore) StartUpdateCrl(info *crlreader.CRLMetaInfo) error

func (*MapStore) Update

func (S *MapStore) Update(store interface{}) error

func (*MapStore) UpdateCRLLocations

func (S *MapStore) UpdateCRLLocations(crlLocations *core.CRLLocations) error

func (*MapStore) UpdateExtendedMetaInfo

func (S *MapStore) UpdateExtendedMetaInfo(extMetaInfo *crlreader.ExtendedCRLMetaInfo) error

func (*MapStore) UpdateSignatureCertificate

func (S *MapStore) UpdateSignatureCertificate(entry *core.CertificateChainEntry) error

type MapStoreFactory

type MapStoreFactory struct {
	Serializer Serializer
	Logger     *zap.Logger
}

func (MapStoreFactory) CreateStore

func (F MapStoreFactory) CreateStore(_ string, _ bool) (CRLStore, error)

type Serializer

type Serializer interface {
	DeserializeMetaInfo([]byte) (*crlreader.CRLMetaInfo, error)
	SerializeMetaInfo(*crlreader.CRLMetaInfo) ([]byte, error)
	SerializeRevokedCert(*pkix.RevokedCertificate) ([]byte, error)
	DeserializeRevokedCert([]byte) (*pkix.RevokedCertificate, error)
	SerializeMetaInfoExt(*crlreader.ExtendedCRLMetaInfo) ([]byte, error)
	DeserializeMetaInfoExt([]byte) (*crlreader.ExtendedCRLMetaInfo, error)
	DeserializeSignatureCert([]byte) (*x509.Certificate, error)
	SerializeCRLLocations(*core.CRLLocations) ([]byte, error)
	DeserializeCRLLocations([]byte) (*core.CRLLocations, error)
}

type StoreType added in v1.0.4

type StoreType int32
const (
	Map     StoreType = 0
	LevelDB StoreType = 1
)

Jump to

Keyboard shortcuts

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