Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Output ¶
type Output struct {
//DecodeOutput the output from decoding
DecodeOutput *helper.Output
//Results captures all the verifications that occurred
Results *verification.CardVerificationResults
}
Output the result of a verifier
func (*Output) DCC ¶
func (o *Output) DCC() *eudvcdatamodel.DCC
DCC return the (Digital Covid Certificate) inside the record, if none returns nil
type Verifier ¶
type Verifier interface {
//FromFileQRCode verifies a EUDC QR code stored in a .png or .jpg file.
//if an error returns what it has processed so far, incase want to display
FromFileQRCode(ctx context.Context, filename string, opts *VerifyOptions) (*Output, error)
//FromQRCodePNGBytes decode starting with a QR code PNG represented as bytes
//first makes a local PNG image and the decodes to get the HC1: representation
//if an error returns what it has processed so far
FromQRCodePNGBytes(ctx context.Context, pngB []byte, opts *VerifyOptions) (*Output, error)
//IsDGCFromQRCodeContents returns true if the card is a digital green card, does no processing
//looks for HCI code
IsDGCFromQRCodeContents(qrCodeContents []byte) bool
//FromQRCodeContents decode from the QR code contents, this starts with HC1
FromQRCodeContents(ctx context.Context, qrCodeContents []byte, opts *VerifyOptions) (*Output, error)
}
Verifier verifies a EU Digital Health Credential
- decodes it
- if possible verifies the signature
type VerifyOptions ¶
type VerifyOptions struct {
//UnSafe if set does not verify the signature, somehow the client knows valid.
UnSafe bool
//FakeVerificationResultValid if passed in the card verification results will be fake values
//required for some strange demo situation, do not reuce
FakeVerificationResultValid bool
}
VerifyOptions options to verify
Click to show internal directories.
Click to hide internal directories.