fsStorage

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LockPeriod        = time.Millisecond * 100
	LockTimeout       = time.Second * 10
	CertFileExtension = ".crt" // certificate file extension
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirKeyStorage

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

DirKeyStorage is a Storage interface implementation with storing pairs on fs

func NewDirKeyStorage

func NewDirKeyStorage(keydir string) *DirKeyStorage

func (*DirKeyStorage) DeleteByCn

func (s *DirKeyStorage) DeleteByCn(cn string) error

DeleteByCn delete all pair with cn

func (*DirKeyStorage) DeleteBySerial

func (s *DirKeyStorage) DeleteBySerial(serial *big.Int) error

Delete only one pair with serial

func (*DirKeyStorage) GetAll

func (s *DirKeyStorage) GetAll() ([]*pair.X509Pair, error)

GetAll return all pairs

func (*DirKeyStorage) GetByCN

func (s *DirKeyStorage) GetByCN(cn string) ([]*pair.X509Pair, error)

GetByCN return all pairs with cn

func (*DirKeyStorage) GetBySerial

func (s *DirKeyStorage) GetBySerial(serial *big.Int) (*pair.X509Pair, error)

GetBySerial return only one pair with serial

func (*DirKeyStorage) GetLastByCn

func (s *DirKeyStorage) GetLastByCn(cn string) (*pair.X509Pair, error)

GetLastByCn return only last pair with cn

func (*DirKeyStorage) Put

func (s *DirKeyStorage) Put(pair *pair.X509Pair) error

Put keypair in dir as /keydir/cn/serial.[crt,key]

type FileCRLHolder

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

Common CRLHolder implementation. It's saving file on fs

func NewFileCRLHolder

func NewFileCRLHolder(path string) *FileCRLHolder

func (*FileCRLHolder) Get

func (h *FileCRLHolder) Get() (*pkix.CertificateList, error)

Get crl content from storage

func (*FileCRLHolder) Put

func (h *FileCRLHolder) Put(content []byte) error

Save new crl content to storage

type FileSerialProvider

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

FileSerialProvider implement SerialProvider interface with storing serial in file on fs

func NewFileSerialProvider

func NewFileSerialProvider(path string) *FileSerialProvider

func (*FileSerialProvider) Next

func (p *FileSerialProvider) Next() (*big.Int, error)

Get next serial and increment counter in storage

Jump to

Keyboard shortcuts

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