Andrey Smirnov 84113ca06a
feat: implement SecureBoot asset generation
Fixes #19

Using Talos implementation of custom SecureBoot signers, provide full
implementation of SecureBoot assets signed either by static local PKI or
Azure Key Vault reference.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2023-11-30 14:32:00 +04:00

26 lines
707 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package http
import (
"context"
"net/http"
"github.com/julienschmidt/httprouter"
)
// handleSecureBootSigningCert handles SecureBoot signing cert PEM.
func (f *Frontend) handleSecureBootSigningCert(_ context.Context, w http.ResponseWriter, _ *http.Request, _ httprouter.Params) error {
pem, err := f.secureBootService.GetSecureBootSigningCert() //nolint:contextcheck
if err != nil {
return err
}
w.Header().Set("Content-Type", "application/x-pem-file")
_, err = w.Write(pem)
return err
}