(t *testing.T)
| 27 | ) |
| 28 | |
| 29 | func TestSigner(t *testing.T) { |
| 30 | if testing.Short() { |
| 31 | t.Skip("skipping in short mode") |
| 32 | } |
| 33 | ent, err := jsonsign.NewEntity() |
| 34 | if err != nil { |
| 35 | t.Fatal(err) |
| 36 | } |
| 37 | armorPub, err := jsonsign.ArmoredPublicKey(ent) |
| 38 | if err != nil { |
| 39 | t.Fatal(err) |
| 40 | } |
| 41 | pubRef := blob.RefFromString(armorPub) |
| 42 | sig, err := NewSigner(pubRef, strings.NewReader(armorPub), ent) |
| 43 | if err != nil { |
| 44 | t.Fatalf("NewSigner: %v", err) |
| 45 | } |
| 46 | pn, err := NewUnsignedPermanode().Sign(ctxbg, sig) |
| 47 | if err != nil { |
| 48 | t.Fatalf("NewPermanode: %v", err) |
| 49 | } |
| 50 | if !strings.Contains(pn, `,"camliSig":"`) { |
| 51 | t.Errorf("Permanode doesn't look signed: %v", pn) |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // TestClaimDate makes sure that when we sign a schema, we set the claimDate to |
| 56 | // the time of the signature. |
nothing calls this directly
no test coverage detected