Add a method to return full certs (#103)

* 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>
This commit is contained in:
Itxaka
2024-04-18 13:11:52 +00:00
committed by GitHub
parent b7420201f1
commit 6364d90a12
2 changed files with 52 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
package types
import "crypto/x509/pkix"
import (
"crypto/x509"
"crypto/x509/pkix"
)
// CertList provides a list of certs on the system from the Efivars and properly parsed
type CertList struct {
@@ -9,6 +12,13 @@ type CertList struct {
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