Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithHTTPClient ¶
WithHTTPClient is a functional option to set the http client
Types ¶
type Client ¶
Client is a client used for DVS verification.
func (*Client) CreateAuthToken ¶
CreateAuthToken creates auth token for authentication in front of the DVS service.
func (*Client) CreateDocumentHash ¶
CreateDocumentHash creates a document hash using the SHA256 hashing algorithm.
func (*Client) VerifySignature ¶
func (c *Client) VerifySignature(ctx context.Context, dvsReq *VerifyRequest) (VerificationResult, error)
VerifySignature sends signature for verification to the DVS (designated verifier scheme) service and verifies the received response.
type VerificationResult ¶
type VerificationResult int
VerificationResult is used to notify the user what is the DVS verification status.
const ( ValidSignature VerificationResult = iota BadPin UserBlocked MissingSignature InvalidSignature )
VerificationResult values.
func (VerificationResult) String ¶
func (r VerificationResult) String() string
type VerifyRequest ¶
type VerifyRequest struct { Signature VerifyRequestSignature `json:"signature"` Timestamp int `json:"timestamp"` Type string `json:"type"` }
VerifyRequest is the request payload for the dvs verify request.
type VerifyRequestSignature ¶
type VerifyRequestSignature struct { Hash string `json:"hash"` MPinID string `json:"mpinId"` PublicKey string `json:"publicKey"` U string `json:"u"` V string `json:"v"` }
VerifyRequestSignature is the signature part of the dvs verify request.
type VerifyResponse ¶
type VerifyResponse struct {
Certificate string `json:"certificate"`
}
VerifyResponse is the response from the the dvs verify request.