code: func Register(resp RegisterResponse, c Challenge, config *Config) (*Registration, error) {
  	if config == nil {
  		config = &Config{}
  	}
  
  	if time.Now().Sub(c.Timestamp) > timeout {
  		return nil, errors.New("u2f: challenge has expired")
  	}
  
  	regData, err := decodeBase64(resp.RegistrationData)
  	if err != nil {
  		return nil, err
  	}
  
  	clientData, err := decodeBase64(resp.ClientData)
  	if err != nil {
  		return nil, err
  	}
  
  	reg, sig, err := parseRegistration(regData)
  	if err != nil {
  		return nil, err
  	}
  
  	if err := verifyClientData(clientData, c); err != nil {
  		return nil, err
  	}
  
  	if err := verifyAttestationCert(*reg, config); err != nil {
  		return nil, err
  	}
  
  	if err := verifyRegistrationSignature(*reg, sig, c.AppID, clientData); err != nil {
  		return nil, err
  	}
  
  	return reg, nil
  }
docs: // Register validates a RegisterResponse message to enrol a new token.
  // An error is returned if any part of the response fails to validate.
  // The returned Registration should be stored by the caller.