Merge "handle CMS pem format easier"
This commit is contained in:
commit
63a095c4c0
@ -194,11 +194,10 @@ func base64DecodeFromCms(token string) ([]byte, error) {
|
|||||||
// -----BEGIN CMS-----
|
// -----BEGIN CMS-----
|
||||||
// -----END CMS-----
|
// -----END CMS-----
|
||||||
func trimCMSFormat(token string) string {
|
func trimCMSFormat(token string) string {
|
||||||
|
token = strings.Trim(token, "\n")
|
||||||
l := strings.Index(token, "\n")
|
l := strings.Index(token, "\n")
|
||||||
r := strings.LastIndex(token, "\n")
|
r := strings.LastIndex(token, "\n")
|
||||||
t := token[l:r]
|
return token[l:r]
|
||||||
r2 := strings.LastIndex(t, "\n")
|
|
||||||
return t[0:r2]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the signging certificate from local dir
|
// Get the signging certificate from local dir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user