Documentation
¶
Overview ¶
Package x509util provides utility functions to process X509 certificates.
Index ¶
- func GetGroupList(cert *x509.Certificate) (map[string]struct{}, error)
- func GetPermittedMethods(cert *x509.Certificate) (map[string]struct{}, error)
- func GetUsername(cert *x509.Certificate) (string, error)
- func LoadCertificatePEM(filename string, logger log.DebugLogger) (*x509.Certificate, map[string]string, error)
- func LoadCertificatePEMs(filename string) ([]*x509.Certificate, []map[string]string, error)
- func ParseCertificatePEM(pemData []byte, logger log.DebugLogger) (*x509.Certificate, map[string]string, error)
- func ParseCertificatePEMs(pemData []byte) ([]*x509.Certificate, []map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGroupList ¶
func GetGroupList(cert *x509.Certificate) (map[string]struct{}, error)
GetGroupList decodes the list of groups in the certificate. The group names are returned as keys in a map. An empty map indicates no group listed. If there is a problem parsing the information an error is returned.
func GetPermittedMethods ¶
func GetPermittedMethods(cert *x509.Certificate) (map[string]struct{}, error)
GetPermittedMethods decodes the list of permitted methods in the certificate. The permitted methods are returned as keys in a map. An empty map indicates no methods are permitted. If there is a problem parsing the information an error is returned.
func GetUsername ¶
func GetUsername(cert *x509.Certificate) (string, error)
GetUsername decodes the username for whom the certificate was granted. It attests the identity of the user.
func LoadCertificatePEM ¶ added in v0.9.0
func LoadCertificatePEM(filename string, logger log.DebugLogger) (*x509.Certificate, map[string]string, error)
LoadCertificatePEM will decode the certificate found in the specified file containing PEM data. It returns the certificate and PEM headers if found, else an error. If there are extra data a message is logged.
func LoadCertificatePEMs ¶ added in v0.9.0
LoadCertificatePEMs will decode all the certificates found in the specified file containing PEM data. It returns a slice of certificates and a slice of PEM headers on success, else an error. If no certificates are found, an empty slice is returned. If no PEM headers are found in any PEM block, an empty slice is returned.
func ParseCertificatePEM ¶ added in v0.9.0
func ParseCertificatePEM(pemData []byte, logger log.DebugLogger) (*x509.Certificate, map[string]string, error)
ParseCertificatePEM will decode the certificate found in the specified PEM data. It returns the certificate and PEM headers if found, else an error. If there are extra data a message is logged.
func ParseCertificatePEMs ¶ added in v0.9.0
ParseCertificatePEMs will decode all the certificates found in the specified PEM data. It returns a slice of certificates and a slice of PEM headers on success, else an error. If no certificates are found, an empty slice is returned. If no PEM headers are found in any PEM block, an empty slice is returned.
Types ¶
This section is empty.