handle CMS pem format easier
Change-Id: Iea34f049fe84e7454380b9184082930085f792d0
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user