Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #11 from stephaneberle9/master
Browse files Browse the repository at this point in the history
Enabled PEM files with CRLF line endings to be used (#10)
  • Loading branch information
aschmahmann authored Oct 16, 2020
2 parents d9b6402 + 6d00a81 commit 6f65c2c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pem.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ 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
for _, block := range pemSplit.FindAll(data, -1) {
Expand Down

0 comments on commit 6f65c2c

Please sign in to comment.