Documentation
¶
Index ¶
- Constants
- type AddVCResponse
- type Cmd
- func (c *Cmd) AddVC(w io.Writer, r io.Reader) error
- func (c *Cmd) GetEntries(w io.Writer, r io.Reader) error
- func (c *Cmd) GetEntryAndProof(w io.Writer, r io.Reader) error
- func (c *Cmd) GetHandlers() []Handler
- func (c *Cmd) GetIssuers(w io.Writer, _ io.Reader) error
- func (c *Cmd) GetProofByHash(w io.Writer, r io.Reader) error
- func (c *Cmd) GetPublicKey(w io.Writer, _ io.Reader) error
- func (c *Cmd) GetSTH(w io.Writer, _ io.Reader) error
- func (c *Cmd) GetSTHConsistency(w io.Writer, r io.Reader) error
- type CmdHandler
- type Config
- type Crypto
- type DigitallySigned
- type Exec
- type GetEntriesRequest
- type GetEntriesResponse
- type GetEntryAndProofRequest
- type GetEntryAndProofResponse
- type GetProofByHashRequest
- type GetProofByHashResponse
- type GetSTHConsistencyRequest
- type GetSTHConsistencyResponse
- type GetSTHResponse
- type Handler
- type HashAlgorithm
- type Key
- type KeyManager
- type LeafEntry
- type LogEntryType
- type MerkleLeafType
- type MerkleTreeLeaf
- type SignatureAlgorithm
- type SignatureAndHashAlgorithm
- type SignatureType
- type TimestampedEntry
- type TreeHeadSignature
- type TrillianLogClient
- type VCTimestampSignature
- type Version
Constants ¶
const ( GetSTH = "getSTH" GetSTHConsistency = "getSTHConsistency" GetEntries = "getEntries" GetProofByHash = "getProofByHash" GetEntryAndProof = "getEntryAndProof" GetIssuers = "getIssuers" GetPublicKey = "getPublicKey" AddVC = "addVC" )
Command methods.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddVCResponse ¶
type AddVCResponse struct {
SVCTVersion Version `json:"svct_version"`
ID []byte `json:"id"`
Timestamp uint64 `json:"timestamp"`
Extensions string `json:"extensions"`
Signature []byte `json:"signature"`
}
AddVCResponse represents the response to add-vc.
type Cmd ¶
Cmd is a controller for commands.
func (*Cmd) GetEntries ¶
GetEntries retrieves entries from log.
func (*Cmd) GetEntryAndProof ¶
GetEntryAndProof retrieves entry and merkle audit proof from log.
func (*Cmd) GetHandlers ¶
GetHandlers returns list of all commands supported by this controller.
func (*Cmd) GetIssuers ¶
GetIssuers returns issuers.
func (*Cmd) GetProofByHash ¶
GetProofByHash retrieves Merkle Audit proof from Log by leaf hash.
func (*Cmd) GetPublicKey ¶
GetPublicKey returns public key.
type CmdHandler ¶
type CmdHandler struct {
// contains filtered or unexported fields
}
CmdHandler contains command handling details which can be used to build controller commands.
func NewCmdHandler ¶
func NewCmdHandler(method string, exec Exec) *CmdHandler
NewCmdHandler returns instance of CmdHandler which can be used handle controller commands.
func (*CmdHandler) Handle ¶
func (c *CmdHandler) Handle() Exec
Handle returns execute function of the this command handler.
type Config ¶
type Config struct {
Trillian TrillianLogClient
KMS KeyManager
Crypto crypto.Crypto
VDR vdr.Registry
LogID int64
Key Key
Issuers []string
DocumentLoader *jsonld.DocumentLoader
}
Config for the Cmd.
type DigitallySigned ¶
type DigitallySigned struct {
Algorithm SignatureAndHashAlgorithm `json:"algorithm"`
Signature []byte `json:"signature"`
}
DigitallySigned provides information about a signature.
type GetEntriesRequest ¶
GetEntriesRequest represents the request to the get-entries.
func (*GetEntriesRequest) Validate ¶
func (r *GetEntriesRequest) Validate() error
Validate validates data.
type GetEntriesResponse ¶
type GetEntriesResponse struct {
Entries []LeafEntry `json:"entries"`
}
GetEntriesResponse represents the response to the get-entries.
type GetEntryAndProofRequest ¶
type GetEntryAndProofRequest struct {
LeafIndex int64 `json:"leaf_index"`
TreeSize int64 `json:"tree_size"`
}
GetEntryAndProofRequest represents the request to get-entry-and-proof.
func (*GetEntryAndProofRequest) Validate ¶
func (r *GetEntryAndProofRequest) Validate() error
Validate validates data.
type GetEntryAndProofResponse ¶
type GetEntryAndProofResponse struct {
LeafInput []byte `json:"leaf_input"`
ExtraData []byte `json:"extra_data"`
AuditPath [][]byte `json:"audit_path"`
}
GetEntryAndProofResponse represents the response to get-entry-and-proof.
type GetProofByHashRequest ¶
GetProofByHashRequest represents the request to the get-proof-by-hash.
func (*GetProofByHashRequest) Validate ¶
func (r *GetProofByHashRequest) Validate() error
Validate validates data.
type GetProofByHashResponse ¶
type GetProofByHashResponse struct {
LeafIndex int64 `json:"leaf_index"`
AuditPath [][]byte `json:"audit_path"`
}
GetProofByHashResponse represents the response to the get-proof-by-hash.
type GetSTHConsistencyRequest ¶
type GetSTHConsistencyRequest struct {
FirstTreeSize int64 `json:"first_tree_size"`
SecondTreeSize int64 `json:"second_tree_size"`
}
GetSTHConsistencyRequest represents the request to the get-sth-consistency.
func (*GetSTHConsistencyRequest) Validate ¶
func (r *GetSTHConsistencyRequest) Validate() error
Validate validates data.
type GetSTHConsistencyResponse ¶
type GetSTHConsistencyResponse struct {
Consistency [][]byte `json:"consistency"`
}
GetSTHConsistencyResponse represents the response to the get-sth-consistency.
type GetSTHResponse ¶
type GetSTHResponse struct {
TreeSize uint64 `json:"tree_size"`
Timestamp uint64 `json:"timestamp"`
SHA256RootHash []byte `json:"sha256_root_hash"`
TreeHeadSignature []byte `json:"tree_head_signature"`
}
GetSTHResponse represents the response to the get-sth.
type Handler ¶
type Handler interface {
// method name of the command
Method() string
// execute function of the command
Handle() Exec
}
Handler for each controller command.
type HashAlgorithm ¶
type HashAlgorithm string
HashAlgorithm type definition.
const (
SHA256Hash HashAlgorithm = "SHA256"
)
HashAlgorithm constants.
type LogEntryType ¶
type LogEntryType uint64
LogEntryType type definition.
const (
VCLogEntryType LogEntryType = 100
)
LogEntryType constants.
type MerkleLeafType ¶
type MerkleLeafType uint64
MerkleLeafType type definition.
const (
TimestampedEntryLeafType MerkleLeafType = 100
)
MerkleLeafType constants.
type MerkleTreeLeaf ¶
type MerkleTreeLeaf struct {
Version Version `json:"version"`
LeafType MerkleLeafType `json:"leaf_type"`
TimestampedEntry *TimestampedEntry `json:"timestamped_entry"`
}
MerkleTreeLeaf represents the deserialized structure of the hash input for the leaves of a log's Merkle tree.
func CreateLeaf ¶
func CreateLeaf(timestamp uint64, vc *verifiable.Credential) (*MerkleTreeLeaf, error)
CreateLeaf creates MerkleTreeLeaf.
type SignatureAlgorithm ¶
type SignatureAlgorithm string
SignatureAlgorithm type definition.
const (
ECDSASignature SignatureAlgorithm = "ECDSA"
)
SignatureAlgorithm constants.
type SignatureAndHashAlgorithm ¶
type SignatureAndHashAlgorithm struct {
Hash HashAlgorithm `json:"hash"`
Signature SignatureAlgorithm `json:"signature"`
Type kms.KeyType `json:"type"`
}
SignatureAndHashAlgorithm provides information about the algorithm used for the signature.
type SignatureType ¶
type SignatureType uint64
SignatureType differentiates signatures.
const ( VCTimestampSignatureType SignatureType = 100 TreeHeadSignatureType SignatureType = 101 )
SignatureType constants.
type TimestampedEntry ¶
type TimestampedEntry struct {
Timestamp uint64 `json:"timestamp"`
EntryType LogEntryType `json:"entry_type"`
VCEntry []byte `json:"vc_entry"`
Extensions []byte `json:"extensions"`
}
TimestampedEntry is part of the MerkleTreeLeaf structure.
type TreeHeadSignature ¶
type TreeHeadSignature struct {
Version Version `json:"version"`
SignatureType SignatureType `json:"signature_type"`
Timestamp uint64 `json:"timestamp"`
TreeSize uint64 `json:"tree_size"`
SHA256RootHash []byte `json:"sha_256_root_hash"`
}
TreeHeadSignature keeps the data over which the signature in an STH is created.
type TrillianLogClient ¶
type TrillianLogClient trillian.TrillianLogClient
TrillianLogClient is the API client for TrillianLog service.
type VCTimestampSignature ¶
type VCTimestampSignature struct {
SVCTVersion Version `json:"svct_version"`
SignatureType SignatureType `json:"signature_type"`
Timestamp uint64 `json:"timestamp"`
EntryType LogEntryType `json:"entry_type"`
VCEntry []byte `json:"vc_entry"`
Extensions []byte `json:"extensions"`
}
VCTimestampSignature keeps the data over which the signature is created.
func CreateVCTimestampSignature ¶
func CreateVCTimestampSignature(leaf *MerkleTreeLeaf) *VCTimestampSignature
CreateVCTimestampSignature creates VCTimestampSignature structure.