Documentation ¶
Index ¶
- Constants
- func ToColonNotation(hexNumber []byte) string
- type Certificate
- func (c Certificate) GetAKID() string
- func (c Certificate) GetIssuer() string
- func (c Certificate) GetNotAfter() string
- func (c Certificate) GetNotBefore() string
- func (c Certificate) GetRawCert() string
- func (c Certificate) GetSANs() string
- func (c Certificate) GetSKID() string
- func (c Certificate) GetSerialNumber() string
- func (c Certificate) GetSubject() string
- type Certstore
- type FormattedCertificate
- type Formatter
- func (f *Formatter) ComposeFormattedCertificates(formattedCertificates []FormattedCertificate, ...) (string, error)
- func (f *Formatter) GetFormattedCertificate(certIndex int) FormattedCertificate
- func (f *Formatter) SetComposeFunction(...)
- func (f *Formatter) SetFieldFormatFunction(field Outputfield, formatFunc func(c Certificate) string)
- type Outputfield
Constants ¶
View Source
const ( OutputFieldSerialNumber = iota OutputFieldIssuer OutputFieldSubject OutputFieldValidity OutputFieldNotBefore OutputFieldNotAfter OutputFieldSKID OutputFieldAKID OutputFieldSANs OutputFieldRawCert OutputFieldSourceFile OutputFieldCertificateIndex )
View Source
const (
CertificateBlockType = "CERTIFICATE"
)
View Source
const FewCertificatesAllCertsAllField = `` /* 10374-byte string literal not displayed */
View Source
const FewCertificatesSomeCertsAllField = `` /* 4499-byte string literal not displayed */
View Source
const FewCertificatesSomeCertsSomeField = `` /* 685-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func ToColonNotation ¶
ToColonNotation adds colon to hex number. Example: F77DC5FDC4E89A1B7764A7F51DA0CCBF87609A6D -> F7:7D:C5:FD:C4:E8:9A:1B:77:64:A7:F5:1D:A0:CC:BF:87:60:9A:6D
Types ¶
type Certificate ¶
type Certificate struct { DecodedCertificate *x509.Certificate Source string }
func (Certificate) GetAKID ¶
func (c Certificate) GetAKID() string
func (Certificate) GetIssuer ¶
func (c Certificate) GetIssuer() string
func (Certificate) GetNotAfter ¶
func (c Certificate) GetNotAfter() string
func (Certificate) GetNotBefore ¶
func (c Certificate) GetNotBefore() string
func (Certificate) GetRawCert ¶
func (c Certificate) GetRawCert() string
func (Certificate) GetSANs ¶
func (c Certificate) GetSANs() string
func (Certificate) GetSKID ¶
func (c Certificate) GetSKID() string
func (Certificate) GetSerialNumber ¶
func (c Certificate) GetSerialNumber() string
func (Certificate) GetSubject ¶
func (c Certificate) GetSubject() string
type Certstore ¶
type Certstore struct {
Certs map[int]Certificate
}
func NewCertstore ¶
func NewCertstore() *Certstore
func (*Certstore) NewFormatter ¶
type FormattedCertificate ¶
type FormattedCertificate map[Outputfield]string
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
func (*Formatter) ComposeFormattedCertificates ¶
func (f *Formatter) ComposeFormattedCertificates(formattedCertificates []FormattedCertificate, orderedFieldsToRender []Outputfield) (string, error)
func (*Formatter) GetFormattedCertificate ¶
func (f *Formatter) GetFormattedCertificate(certIndex int) FormattedCertificate
GetFormattedCertificate returns a FormattedCertificate with the fields rendered using the functions defined in FieldsFormatFunctions.
func (*Formatter) SetComposeFunction ¶
func (f *Formatter) SetComposeFunction(composeFunc func(certs []FormattedCertificate, orderedFieldsToRender []Outputfield) (string, error))
func (*Formatter) SetFieldFormatFunction ¶
func (f *Formatter) SetFieldFormatFunction(field Outputfield, formatFunc func(c Certificate) string)
SetFieldFormatFunction substitutes the default format function for a field with the provided one.
type Outputfield ¶
type Outputfield int
Click to show internal directories.
Click to hide internal directories.