2018-09-11 11:09:28 +02:00
|
|
|
package internal
|
|
|
|
|
|
|
|
|
|
import (
|
2019-05-13 14:07:18 +02:00
|
|
|
"github.com/ProtonMail/gopenpgp/constants"
|
2018-09-11 11:09:28 +02:00
|
|
|
"regexp"
|
|
|
|
|
)
|
|
|
|
|
|
2019-03-07 14:23:38 +01:00
|
|
|
// TrimNewlines removes a whitespace in the end of string (don't stop on linebreak)
|
2018-09-11 11:09:28 +02:00
|
|
|
func TrimNewlines(input string) string {
|
|
|
|
|
var re = regexp.MustCompile(`(?m)[ \t]*$`)
|
|
|
|
|
return re.ReplaceAllString(input, "")
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-13 12:33:01 +00:00
|
|
|
// CreationTimeOffset stores the amount of seconds that a signature may be
|
|
|
|
|
// created in the future, to compensate for clock skew
|
2018-09-11 11:09:28 +02:00
|
|
|
const CreationTimeOffset = int64(60 * 60 * 24 * 2)
|
|
|
|
|
|
2019-03-07 14:23:38 +01:00
|
|
|
// ArmorHeaders from golang pm-crypto
|
2018-09-20 13:36:56 +02:00
|
|
|
var ArmorHeaders = map[string]string{
|
2019-03-07 16:56:12 +01:00
|
|
|
"Version": constants.ArmorHeaderVersion,
|
|
|
|
|
"Comment": constants.ArmorHeaderComment,
|
2018-09-11 11:09:28 +02:00
|
|
|
}
|