Unverified Commit 6f65c2c3 authored by Adin Schmahmann's avatar Adin Schmahmann Committed by GitHub

Merge pull request #11 from stephaneberle9/master

Enabled PEM files with CRLF line endings to be used (#10)
parents d9b64028 6d00a817
...@@ -16,13 +16,14 @@ package openssl ...@@ -16,13 +16,14 @@ package openssl
import ( import (
"regexp" "regexp"
) )
var pemSplit *regexp.Regexp = regexp.MustCompile(`(?sm)` + var pemSplit *regexp.Regexp = regexp.MustCompile(`(?sm)` +
`(^-----[\s-]*?BEGIN.*?-----$` + `(^-----[\s-]*?BEGIN.*?-----[\s-]*?$` +
`.*?` + `.*?` +
`^-----[\s-]*?END.*?-----$)`) `^-----[\s-]*?END.*?-----[\s-]*?$)`)
func SplitPEM(data []byte) [][]byte { func SplitPEM(data []byte) [][]byte {
var results [][]byte var results [][]byte
for _, block := range pemSplit.FindAll(data, -1) { for _, block := range pemSplit.FindAll(data, -1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment