SignAt sets the blob builder's camliSigner field with SetSigner and returns the signed JSON using the provided signer. The provided sigTime is the time of the signature, used mostly for planned permanodes. If the zero value, the current time is used.
(ctx context.Context, signer *Signer, sigTime time.Time)
| 468 | // The provided sigTime is the time of the signature, used mostly |
| 469 | // for planned permanodes. If the zero value, the current time is used. |
| 470 | func (bb *Builder) SignAt(ctx context.Context, signer *Signer, sigTime time.Time) (string, error) { |
| 471 | switch bb.Type() { |
| 472 | case TypePermanode, TypeClaim: |
| 473 | default: |
| 474 | return "", fmt.Errorf("can't sign camliType %q", bb.Type()) |
| 475 | } |
| 476 | if sigTime.IsZero() { |
| 477 | sigTime = time.Now() |
| 478 | } |
| 479 | bb.SetClaimDate(sigTime) |
| 480 | return signer.SignJSON(ctx, bb.SetSigner(signer.pubref).Blob().JSON(), sigTime) |
| 481 | } |
| 482 | |
| 483 | // SetType sets the camliType field. |
| 484 | func (bb *Builder) SetType(t CamliType) *Builder { |