* Refactor library, remove duplicates * Rebuild structure to use Messages and Signature models * Use PGPSplitMessage * Remove signature model * Various fixes * Add helpers with tests * Fixes, add some docs, add tests * Add attachment helpers * Add helpers Symmetric encryption * Edit docs + examples * Rename kr to keyRing * Various fixes for documentation * Edit JSON handling functions, add decrypt keyring via token * Add proposal changes doc * Fix CI * Drop *Message functions, join CleartextMessage and BinaryMessage * Change canonicalization and trimming only to text signatures * Add cleartextsignature, detach signature from message model, move helpers * Documentation, remove optional parameters * Move verification to separate model * Don't return message in VerifyDetached * Update table of contents in readme * Appease golint * Run go fmt * Rename Encrypt/DecryptMessageWithPassword to ..WithToken These functions shouldn't be used with user-provided passwords, as they don't do any key-stretching. * Change key generation usernames
22 lines
410 B
Go
22 lines
410 B
Go
package helper
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"strings"
|
|
)
|
|
|
|
var err error
|
|
|
|
func readTestFile(name string, trimNewlines bool) string {
|
|
data, err := ioutil.ReadFile("../crypto/testdata/" + name)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if trimNewlines {
|
|
return strings.TrimRight(string(data), "\n")
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
// Corresponding key in ../crypto/testdata/keyring_privateKey
|
|
const testMailboxPassword = "apple"
|