Documentation
¶
Index ¶
- Constants
- Variables
- func AddTrusted(block []byte) error
- func Blankify(in string) string
- func ChainMetadata(chain []DasCertPayload, FieldEx func(*Cert) string) []string
- func ExpectKeyHeader(wantKeys []int, wantType int, buf []byte) (int, int, error)
- func InIntList(itm int, intList []int) bool
- func KeypairsVerify(cert Cert, dataBytes []byte, sigBytes []byte) error
- func SplitLines(input string) []string
- func TextToBinaryBlock(textPart string) ([]byte, []string, error)
- func VNames(chain []DasCertPayload) []string
- func VTypes(chain []DasCertPayload) []string
- func Verify(chain []DasCertPayload) error
- type Cert
- type DasBytes
- type DasCertPayload
- type Signature
Constants ¶
View Source
const ( // --- Top-level tag values --- PUB_CSR = 10 DUALBLOCK = 11 PUB_PAYLOAD = 12 // cert chain with a payload as the first entry BARE_PAYLOAD = 13 // literally just payload bytes but tagged with a header tag. PUB_CERTCHAIN = 14 // cert chain with a cert as the first entry PRIV_CRCWRAPPED = 15 // "priv data with a crc32 integrity check" // --- Public-part chain-level --- HDR_DAS = 0x19 // "data_part and sig_part structure" )
Variables ¶
Functions ¶
func AddTrusted ¶
func ChainMetadata ¶
func ChainMetadata(chain []DasCertPayload, FieldEx func(*Cert) string) []string
func ExpectKeyHeader ¶
func SplitLines ¶
func VNames ¶
func VNames(chain []DasCertPayload) []string
func VTypes ¶
func VTypes(chain []DasCertPayload) []string
func Verify ¶
func Verify(chain []DasCertPayload) error
Types ¶
type Cert ¶
type Cert struct { CertID []byte `b3.type:"BYTES" b3.tag:"0" b3.req:"y"` SubjectName string `b3.type:"UTF8" b3.tag:"1" b3.req:"y"` KeyType int `b3.type:"UVARINT" b3.tag:"2" b3.req:"y"` PublicKey []byte `b3.type:"BYTES" b3.tag:"3" b3.req:"y"` ExpiryDate time.Time `b3.type:"BASICDATE" b3.tag:"4" b3.req:"y"` // (this is for b3.BASICDATE so it's ONLY date-values) IssuedDate time.Time `b3.type:"BASICDATE" b3.tag:"5" b3.req:"y"` CertType string `b3.type:"UTF8" b3.tag:"6" b3.req:"n"` // // optional (zero value ok here) }
type DasBytes ¶
type DasBytes struct { DataPart []byte `b3.type:"BYTES" b3.tag:"0" b3.req:"y"` SigPart []byte `b3.type:"BYTES" b3.tag:"1" b3.req:"y"` }
This is a DAS (data-and-sig) with the data & sig bytes (made for us by B3)
type DasCertPayload ¶
type DasCertPayload struct { DataPart []byte SigPart []byte Payload []byte Cert Cert Sig Signature }
This is a DAS with everything unpacked (certs & payloads etc) made by Load for Verify to use
func LoadPubBlock ¶
func LoadPubBlock(publicPart []byte) (ppkey int, chain []DasCertPayload, err error)
Click to show internal directories.
Click to hide internal directories.