exposure-notifications-server: github.com/google/exposure-notifications-server/pkg/verification Index | Files

package verification

import "github.com/google/exposure-notifications-server/pkg/verification"

Package verification provides verification utilities.

This is provided as reference to application authors wishing to calculate the exposure key HMAC as part of their exposure notifications mobile app.

This protocol is detailed at https://developers.google.com/android/exposure-notifications/verification-system

Although exported, this package is non intended for general consumption. It is a shared dependency between multiple exposure notifications projects. We cannot guarantee that there won't be breaking changes in the future.


Package Files


func CalculateAllAllowedExposureKeyHMAC Uses

func CalculateAllAllowedExposureKeyHMAC(keys []verifyapi.ExposureKey, secret []byte) ([][]byte, error)

CalculateAllAllowedExposureKeyHMAC calculates the main HMAC and the optional HMAC. The optional HMAC is only valid if the transmission risks are all zero.

func CalculateExposureKeyHMAC Uses

func CalculateExposureKeyHMAC(keys []verifyapi.ExposureKey, secret []byte) ([]byte, error)

CalculateExposureKeyHMAC will calculate the verification protocol HMAC value. Input keys are already to be base64 encoded. They will be sorted if necessary.

func CalculateExpsureKeyHMACv1Alpha1 Uses

func CalculateExpsureKeyHMACv1Alpha1(legacyKeys []v1alpha1.ExposureKey, secret []byte) ([]byte, error)

CalculateExpsureKeyHMACv1Alpha1 is a convenience method for anyone still on v1alpha1. Deprecated: use CalculateExposureKeyHMAC instead Preserved for clients on v1alpha1, will be removed in v0.3 release.

Package verification imports 7 packages (graph) and is imported by 2 packages. Updated 2020-09-27. Refresh now. Tools for package owners.