mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-06-21 12:48:26 +00:00
* Add a method to return full certs Signed-off-by: Itxaka <itxaka@kairos.io> * Fix lint Signed-off-by: Itxaka <itxaka@kairos.io> * Rework the cert extraction Signed-off-by: Itxaka <itxaka@kairos.io> --------- Signed-off-by: Itxaka <itxaka@kairos.io>
33 lines
638 B
Go
33 lines
638 B
Go
package types
|
|
|
|
import (
|
|
"crypto/x509"
|
|
"crypto/x509/pkix"
|
|
)
|
|
|
|
// CertList provides a list of certs on the system from the Efivars and properly parsed
|
|
type CertList struct {
|
|
PK []CertDetail
|
|
KEK []CertDetail
|
|
DB []CertDetail
|
|
}
|
|
|
|
// CertListFull provides a list of FULL certs, including raw cert data
|
|
type CertListFull struct {
|
|
PK []*x509.Certificate
|
|
KEK []*x509.Certificate
|
|
DB []*x509.Certificate
|
|
}
|
|
|
|
type CertDetail struct {
|
|
Owner pkix.Name
|
|
Issuer pkix.Name
|
|
}
|
|
|
|
// EfiCerts is a simplified version of a CertList which only provides the Common names for the certs
|
|
type EfiCerts struct {
|
|
PK []string
|
|
KEK []string
|
|
DB []string
|
|
}
|