vipaccess

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

This section is empty.

Types

type Credential

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

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
	AccountName                string
	Issuer                     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