Merge pull request #11 from stephaneberle9/master

Enabled PEM files with CRLF line endings to be used (#10)
This commit is contained in:
Adin Schmahmann
2020-10-16 13:09:40 -04:00
committed by GitHub

5
pem.go
View File

@@ -16,12 +16,13 @@ package openssl
import (
"regexp"
)
var pemSplit *regexp.Regexp = regexp.MustCompile(`(?sm)` +
`(^-----[\s-]*?BEGIN.*?-----$` +
`(^-----[\s-]*?BEGIN.*?-----[\s-]*?$` +
`.*?` +
`^-----[\s-]*?END.*?-----$)`)
`^-----[\s-]*?END.*?-----[\s-]*?$)`)
func SplitPEM(data []byte) [][]byte {
var results [][]byte