Documentation ¶
Index ¶
- func CalculateLeafHash(timestamp uint64, vcBytes []byte, loader jsonld.DocumentLoader) (string, error)
- func VerifyVCTimestampSignature(signature, pubKey []byte, timestamp uint64, vcBytes []byte, ...) error
- type Client
- func (c *Client) AddVC(ctx context.Context, credential []byte) (*command.AddVCResponse, error)
- func (c *Client) GetEntries(ctx context.Context, start, end uint64) (*command.GetEntriesResponse, error)
- func (c *Client) GetEntryAndProof(ctx context.Context, leafIndex, treeSize uint64) (*command.GetEntryAndProofResponse, error)
- func (c *Client) GetIssuers(ctx context.Context) ([]string, error)
- func (c *Client) GetProofByHash(ctx context.Context, hash string, treeSize uint64) (*command.GetProofByHashResponse, error)
- func (c *Client) GetSTH(ctx context.Context) (*command.GetSTHResponse, error)
- func (c *Client) GetSTHConsistency(ctx context.Context, first, second uint64) (*command.GetSTHConsistencyResponse, error)
- func (c *Client) HealthCheck(ctx context.Context) error
- func (c *Client) Webfinger(ctx context.Context) (*command.WebFingerResponse, error)
- type ClientOpt
- type HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateLeafHash ¶
func CalculateLeafHash(timestamp uint64, vcBytes []byte, loader jsonld.DocumentLoader) (string, error)
CalculateLeafHash calculates hash for given credentials.
func VerifyVCTimestampSignature ¶
func VerifyVCTimestampSignature(signature, pubKey []byte, timestamp uint64, vcBytes []byte, loader jsonld.DocumentLoader) error
VerifyVCTimestampSignature verifies VC timestamp signature.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents VCT REST client.
func (*Client) GetEntries ¶
func (c *Client) GetEntries(ctx context.Context, start, end uint64) (*command.GetEntriesResponse, error)
GetEntries retrieves entries from log.
func (*Client) GetEntryAndProof ¶
func (c *Client) GetEntryAndProof(ctx context.Context, leafIndex, treeSize uint64) (*command.GetEntryAndProofResponse, error)
GetEntryAndProof retrieves entry and merkle audit proof from log.
func (*Client) GetIssuers ¶
GetIssuers returns issuers.
func (*Client) GetProofByHash ¶
func (c *Client) GetProofByHash(ctx context.Context, hash string, treeSize uint64) (*command.GetProofByHashResponse, error)
GetProofByHash retrieves Merkle Audit proof from Log by leaf hash.
func (*Client) GetSTHConsistency ¶
func (c *Client) GetSTHConsistency(ctx context.Context, first, second uint64) (*command.GetSTHConsistencyResponse, error)
GetSTHConsistency retrieves merkle consistency proofs between signed tree heads.
func (*Client) HealthCheck ¶ added in v1.0.0
HealthCheck check health.
type ClientOpt ¶
type ClientOpt func(client *Client)
ClientOpt represents client option func.
func WithAuthReadToken ¶ added in v1.0.0
WithAuthReadToken add auth token.
func WithAuthWriteToken ¶ added in v1.0.0
WithAuthWriteToken add auth token.
func WithHTTPClient ¶
func WithHTTPClient(client HTTPClient) ClientOpt
WithHTTPClient allows providing HTTP client.
func WithLedgerURI ¶ added in v1.0.0
WithLedgerURI sets the ledger URI. By default, the ledger URI is set to the endpoint URL.