vipaccess

package
v0.1.2-0...-e80da57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package vipaccess provides a client for Symantec's VIP Access credential service.

Index

Constants

View Source
const ProvisioningURL = "https://services.vip.symantec.com/prov"
View Source
const ValidationURL = "https://vip.symantec.com/otpCheck"

Variables

This section is empty.

Functions

func GenerateTOTPCode

func GenerateTOTPCode(secret []byte, t time.Time) string

GenerateTOTPCode returns a 6 digit numeric code based on the given 20 byte secret and time using the RFC 6238 algorithm.

Types

type Credential

type Credential struct {
	ID      string
	Key     []byte
	Expires time.Time
}

Credential represents a VIP Access credential issued by Symantec.

func GenerateCredential

func GenerateCredential(p *Parameters) (*Credential, error)

GenerateCredential contacts Symantec to request a new VIP Access credential with the provided parameters.

func (*Credential) QRCodePNG

func (c *Credential) QRCodePNG() []byte

QRCodePNG returns the content of a PNG image encoding the credential as a qr code. The image is suitable for being scanned by an OTP generation app like Google Authenticator or 1Password.

func (*Credential) URI

func (c *Credential) URI() string

URI returns the otpauth URI for the credential.

func (*Credential) Validate

func (c *Credential) Validate() error

Validate sends the credential ID with a current TOTP code to Symantec to verify it is working.

type Parameters

type Parameters struct {
	Timestamp                  int
	TokenModel                 string
	OTPAlgorithm               string
	SharedSecretDeliveryMethod string
	Manufacturer               string
	Serial                     string
	Model                      string
	AppHandle                  string
	ClientIDType               string
	ClientID                   string
	DistChannel                string
	Platform                   string
	Data                       string
}

Parameters specify the values expected by Symantec when requesting a new credential.

func GenerateRandomParameters

func GenerateRandomParameters() *Parameters

GenerateRandomParameters returns a valid set of Parameters with somewhat randomized values for the serial number, model, and client ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL