cdb

package
v0.0.2-0...-0d7cfed Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCaProfileTable

func CreateCaProfileTable(db *sql.DB)

create CA Profile table if not created

func CreateCaTable

func CreateCaTable(db *sql.DB)

CA Table create if not created | checks if an entry with same CA name is already present | if present validates for csr (TODO: this workflow)

func CreateCertTable

func CreateCertTable(db *sql.DB)

create Certificate table

func CreateCrlTable

func CreateCrlTable(db *sql.DB)

create CRL table if not created

func CreateEnrollTable

func CreateEnrollTable(db *sql.DB)

create Enrollment table if not created

func InitDB

func InitDB(filepath string) *sql.DB

func StoreCaItem

func StoreCaItem(db *sql.DB, item *CaTable)

store a row entry in CA table

func StoreCaProfileItem

func StoreCaProfileItem(db *sql.DB, item CaProfileTable)

store a row in CA Profile table

func StoreCertItem

func StoreCertItem(db *sql.DB, item CertTable)

store a row in Certificate table

func StoreCrlItem

func StoreCrlItem(db *sql.DB, item CrlTable)

store Crl table row

func StoreEnrollItem

func StoreEnrollItem(db *sql.DB, item EnrollTable)

store a row in Enrollment table

Types

type CaProfileTable

type CaProfileTable struct {
	Name       string
	O          string
	OU         string
	CN         string
	IP         string
	Host       int
	IsCa       int
	Pathlength int
	Validity   int
}

func ReadCaProfileTable

func ReadCaProfileTable(db *sql.DB) []CaProfileTable

read CA Profile table

type CaTable

type CaTable struct {
	Name        string
	Csr         string
	Cert        string
	Key         string
	Fingerprint string
	FpAlgo      int
	Validity    int
	EnrollCount int //Enrollment count
	Serial      int
}

func ReadCaItem

func ReadCaItem(db *sql.DB, caName string) CaTable

read a CA table row based on CA name

func ReadCaTable

func ReadCaTable(db *sql.DB) []CaTable

read CA table

func SearchCaItem

func SearchCaItem(db *sql.DB, caName string) (CaTable, int)

search a row in CA table by CA name

type CertTable

type CertTable struct {
	EnrollId    string
	Certificate string
	Csr         string
	Validity    int
	Signature   string
	CaName      string
}

func ReadCertTable

func ReadCertTable(db *sql.DB) []CertTable

read Certificate table

type CrlTable

type CrlTable struct {
	Name     string
	Validity int
	Updt     string //Update since last commit
	Time     int    //Last commit time
}

func ReadCrlTable

func ReadCrlTable(db *sql.DB) []CrlTable

read Crl table

type EnrollTable

type EnrollTable struct {
	EnrollId   string
	Secret     string
	Attributes string
	Status     int
	Role       string
	Ca         string
	CaProfile  string
}

func ReadEnrollTable

func ReadEnrollTable(db *sql.DB) []EnrollTable

read Enrollment table

func ReadEnrollTableItem

func ReadEnrollTableItem(db *sql.DB, enrollid string) EnrollTable

func SearchEnrollItem

func SearchEnrollItem(db *sql.DB, enrollid string) (EnrollTable, int)

Jump to

Keyboard shortcuts

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