Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDecoder = &Decoder{}
DefaultDecoder is a ready-to-use Decoder.
Functions ¶
This section is empty.
Types ¶
type Decoded ¶
Decoded is a NZ COVID Pass
func DecodeAndVerify ¶ added in v0.1.1
func DecodeAndVerify(qrdata string, certprov PublicKeyProvider) (*Decoded, error)
type PublicKeyProvider ¶
type PublicKeyProvider interface { // GetPublicKey returns the public key of the certificate for the specified // key identifier (or country), or an error if the public key was not found. // // Country is a ISO 3166 alpha-2 code, e.g. CH. // // kid are the first 8 bytes of the SHA256 digest of the certificate in DER // encoding. GetPublicKey(kid []byte) (crypto.PublicKey, error) }
PublicKeyProvider is typically implemented using a JSON Web Key Set, or by pinning a specific government certificate.
func NewNZCertificateProvider ¶
func NewNZCertificateProvider() (PublicKeyProvider, error)
func NewNZTestCertificateProvider ¶ added in v0.1.3
func NewNZTestCertificateProvider() (PublicKeyProvider, error)
type Unverified ¶
type Unverified struct {
// contains filtered or unexported fields
}
Unverified is a NZ COVID Pass that has been decoded but not verified
func Decode ¶
func Decode(qrdata string) (*Unverified, error)
Decode decodes the specified EU Digital COVID Certificate (EUDCC) QR code data.
func (*Unverified) Verify ¶
func (u *Unverified) Verify(certprov PublicKeyProvider) (*Decoded, error)
Verify checks the cryptographic signature and returns the verified data
Click to show internal directories.
Click to hide internal directories.