Trust me, it's not badly written. It's just way above your head.
Some checks failed
🏗️✨ Test Build Workflow / 🖥️ 🔨 Build (push) Has been cancelled

This commit is contained in:
2025-05-14 17:07:28 -04:00
parent 88a468a9ce
commit b59b3bcb04
3 changed files with 8 additions and 17 deletions

View File

@@ -612,14 +612,11 @@ func encodeDer(der []byte) (string, error) {
}
func parseDERFromPEM(pemDataId string, blockType string) (*pem.Block, error) {
bts, err := os.ReadFile(pemDataId)
if err != nil {
return nil, err
}
b := []byte(pemDataId)
var block *pem.Block
for len(bts) > 0 {
block, bts = pem.Decode(bts)
for len(b) > 0 {
block, b = pem.Decode(b)
if block == nil {
return nil, errors.New("unable to parse PEM data")
}