Minor bug fixes.

This commit is contained in:
2025-11-19 02:43:25 -08:00
parent 7e36a828d4
commit d76db4a947
3 changed files with 16 additions and 10 deletions

View File

@@ -121,3 +121,13 @@ func ExportPrivateKeyPEM(priv crypto.PrivateKey) ([]byte, error) {
return pem.EncodeToMemory(&pem.Block{Type: pemTypePrivateKey, Bytes: keyDER}), nil
}
func LoadCSR(path string) (*x509.CertificateRequest, error) {
in, err := os.ReadFile(path)
if err != nil {
return nil, certerr.LoadingError(certerr.ErrorSourceCSR, err)
}
req, _, err := ParseCSR(in)
return req, err
}