mirror of
https://github.com/libp2p/go-openssl.git
synced 2025-01-14 02:30:08 +08:00
Merge pull request #11 from stephaneberle9/master
Enabled PEM files with CRLF line endings to be used (#10)
This commit is contained in:
commit
6f65c2c3af
5
pem.go
5
pem.go
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user