2019-06-03 17:00:01 +02:00
|
|
|
package helper
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"io/ioutil"
|
|
|
|
|
"strings"
|
2019-12-27 19:35:43 +01:00
|
|
|
|
|
|
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
2019-06-03 17:00:01 +02:00
|
|
|
)
|
|
|
|
|
|
2019-12-27 19:35:43 +01:00
|
|
|
const testTime = 1557754627 // 2019-05-13T13:37:07+00:00
|
2019-06-03 17:00:01 +02:00
|
|
|
|
|
|
|
|
func readTestFile(name string, trimNewlines bool) string {
|
2019-12-27 19:35:43 +01:00
|
|
|
data, err := ioutil.ReadFile("../crypto/testdata/" + name) //nolint
|
2019-06-03 17:00:01 +02:00
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
if trimNewlines {
|
|
|
|
|
return strings.TrimRight(string(data), "\n")
|
|
|
|
|
}
|
|
|
|
|
return string(data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Corresponding key in ../crypto/testdata/keyring_privateKey
|
2019-12-27 19:35:43 +01:00
|
|
|
var testMailboxPassword = []byte("apple")
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
crypto.UpdateTime(testTime) // 2019-05-13T13:37:07+00:00
|
|
|
|
|
}
|