* Implement GetArmoredWithCustomHeaders ArmorWithTypeAndCustomHeaders can be reused by other PGP armoured objects. * Update linting, and lint accordingly `godot` has been improved and `goerr113` has been added (and ignored here). * Add custom headers for keys * Minor comment changes Co-authored-by: Aron Wussler <aron@wussler.it>
28 lines
589 B
Go
28 lines
589 B
Go
package helper
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"strings"
|
|
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
|
)
|
|
|
|
const testTime = 1557754627 // 2019-05-13T13:37:07+00:00
|
|
|
|
func readTestFile(name string, trimNewlines bool) string {
|
|
data, err := ioutil.ReadFile("../crypto/testdata/" + name) //nolint
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if trimNewlines {
|
|
return strings.TrimRight(string(data), "\n")
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
// Corresponding key in ../crypto/testdata/keyring_privateKey.
|
|
var testMailboxPassword = []byte("apple")
|
|
|
|
func init() {
|
|
crypto.UpdateTime(testTime) // 2019-05-13T13:37:07+00:00
|
|
}
|