Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// Priv is yours to do what you please with
Priv interface{}
KeyHandle string
PubKey string
Cert string
Challenge string
Counter uint32
}
Device Holds a U2F device associated with a user
type RegisterRequest ¶
type RegisterRequest struct {
Version string `json:"version"`
Challenge string `json:"challenge"`
AppID string `json:"appId"`
}
RegisterRequest dictionary from the fido u2f javascript api spec
type RegisterResponse ¶
type RegisterResponse struct {
ClientData string `json:"clientData"`
RegistrationData string `json:"registrationData"`
}
RegisterResponse dictionary from the fido u2f javascript api. Serves as input to RegisterFin()
type Server ¶
Server
func (Server) Register ¶
func (s Server) Register(u User) (r RegisterRequest, err error)
Register a user to a device. Returns a RegisterRequest Object for the device to sign. The result of which is passed to RegisterFin().
func (Server) RegisterFin ¶
RegisterFin finish up, validate and store a Registration. r should contain an RegisterResponse JSON Object.
type SignFinResult ¶
type SignFinResult struct {
Touch byte `json:"touch"`
// Counter current counter value
Counter uint32 `json:"counter"`
}
SignFinResult is the result of a successful SignFin operation.
type SignRequest ¶
type SignRequest struct {
Version string `json:"version"`
Challenge string `json:"challenge"`
KeyHandle string `json:"keyHandle"`
AppID string `json:"appId"`
}
SignRequest dictionary from the fido u2f javascript api spec. Result of a valid Sign() operation
type SignResponse ¶
type SignResponse struct {
KeyHandle string `json:"keyHandle"`
ClientData string `json:"clientData"`
SignatureData string `json:"signatureData"`
}
SignResponse dictionary from the fido u2f javascript api. Serves as input to SignFin()
type User ¶
type User struct {
// Priv is yours to do what you please with.
// For example, if you have an sql backend you could store the tuple or
// primary key here to make updating easier.
Priv interface{}
// User contains the username
User string
// Enrolled holds if they have signed up
Enrolled bool
// A list of associated U2F devices with for this User
Devices []Device
}
User Hold a User