| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package main |
| 9 |
|
| 10 |
import "c2sp.org/CCTV/age/internal/testkit" |
| 11 |
|
| 12 |
func main() { |
| 13 |
f := testkit.NewTestFile() |
| 14 |
f.VersionLine("v1") |
| 15 |
f.X25519(testkit.TestX25519Identity) |
| 16 |
f.HMAC() |
| 17 |
f.Payload("age age age age age age age age age age ") |
| 18 |
file := f.Bytes() |
| 19 |
f.Buf.Reset() |
| 20 |
f.BeginArmor("AGE ENCRYPTED FILE") |
| 21 |
if len(file)%48 != 0 { |
| 22 |
println(len(file) % 48) |
| 23 |
panic("last line is not full") |
| 24 |
} |
| 25 |
f.Body(file) |
| 26 |
|
| 27 |
f.EndArmor("AGE ENCRYPTED FILE") |
| 28 |
f.ExpectArmorFailure() |
| 29 |
f.Generate() |
| 30 |
} |