Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-openssl
Commits
6f65c2c3
Unverified
Commit
6f65c2c3
authored
Oct 16, 2020
by
Adin Schmahmann
Committed by
GitHub
Oct 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from stephaneberle9/master
Enabled PEM files with CRLF line endings to be used (#10)
parents
d9b64028
6d00a817
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
pem.go
pem.go
+4
-3
No files found.
pem.go
View file @
6f65c2c3
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment