handle CMS pem format easier

Change-Id: Iea34f049fe84e7454380b9184082930085f792d0
This commit is contained in:
Fangzhou Xu 2016-05-05 10:16:41 -07:00
parent e7fceb0b4d
commit b37df29f9e
1 changed files with 2 additions and 3 deletions

View File

@ -194,11 +194,10 @@ func base64DecodeFromCms(token string) ([]byte, error) {
// -----BEGIN CMS-----
// -----END CMS-----
func trimCMSFormat(token string) string {
token = strings.Trim(token, "\n")
l := strings.Index(token, "\n")
r := strings.LastIndex(token, "\n")
t := token[l:r]
r2 := strings.LastIndex(t, "\n")
return t[0:r2]
return token[l:r]
}
// Get the signging certificate from local dir