Documentation ¶
Overview ¶
Package notary is a proof-of-concept public notary service.
Example ¶
package main import ( "fmt" "github.com/vsekhar/fabula/cmd/notary" ) func main() { svc, _ := notary.NewService() data := []byte("hello world") n, _ := svc.Notarize(data) fmt.Printf("Notarize('%s') --> (%s, %.8x..., %.8x...)", data, n.Timestamp, n.Salt, n.Signature) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateLog ¶
ValidateLog validates a notary log and its digest.
func ValidateNotarization ¶
func ValidateNotarization(b []byte, n Notarization) bool
ValidateNotarization returns true if sig is a valid signature generated by key using b, t, and salt.
func ValidateProof ¶
ValidateProof returns true if p is a valid proof that sig has been incorporated into a notary log.
Types ¶
type Log ¶
type Log [][]byte
Log is a full log of all notarizations, including tree elements used in generating compact proofs.
type Notarization ¶
type Notarization struct { Salt []byte Timestamp time.Time Signature []byte PublicKey ed25519.PublicKey }
Notarization contains the data returned by a notary service.
type Proof ¶
type Proof []ProofEntry
Proof is a slice of entries that represent each of the hashes used to generate the head
type ProofEntry ¶
type ProofEntry struct {
// contains filtered or unexported fields
}
ProofEntry contains slices of bytes that should be pre- and post-pended to a given data element before generating its signature.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a verifiable notary service.
func (*Service) Notarize ¶
func (s *Service) Notarize(b []byte) (n Notarization, err error)
Notarize returns a notarization of b, or an error.
Notarize will work correctly if b is empty or nil. In this case, the notarization will be of only the random hash and timestamp generated by the Service. The notarization signature can be used further signed by the client to prove the client's possession of some key.
func (*Service) Prove ¶
Prove returns a Proof that can be used to verify that sig has been incorporated into the service log, or nil if no such proof can be generated.
func (*Service) ProveDigest ¶
ProveDigest returns a Proof that can be used to verify that digest a is a predecessor and covered by digest b, or nil if no such proof can be generated.