mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-22 21:05:48 +08:00
21 lines
267 B
Go
21 lines
267 B
Go
package cert
|
|
|
|
import (
|
|
"encoding/pem"
|
|
)
|
|
|
|
func decodePEMBlocks(data []byte) []*pem.Block {
|
|
blocks := make([]*pem.Block, 0)
|
|
for {
|
|
block, rest := pem.Decode(data)
|
|
if block == nil {
|
|
break
|
|
}
|
|
|
|
blocks = append(blocks, block)
|
|
data = rest
|
|
}
|
|
|
|
return blocks
|
|
}
|