Skip to content
Snippets Groups Projects
Select Git revision
  • 9bfd32eaae859f24e9d9cb6dbbab99dda5d14cbb
  • release default
  • master protected
  • XX-4441
  • Jakub/rootless-CI
  • Anne/CI-Test
  • waitingRoundsRewrite
  • quantumSecure
  • fullRateLimit
  • XX-3564/TlsCipherSuite
  • hotfix/groupNotification
  • Josh/RateLimiting
  • debug/sourceOfErrors
  • XX-3540/TestCert
  • f76/error
  • notls
  • url-repo-rename
  • feature/dynamicAuthRemoval
  • jono/yaml
  • version-2_5_3
  • hotfix/signing
  • v3.13.0
  • v3.11.0
  • v3.10.0
  • v3.9.0
  • v3.7.0
  • v3.6.0
  • v3.5.0
  • v3.1.0
  • v2.2.8
  • v2.2.7
  • v2.1.0
  • v2.0.0
  • v1.7.0
  • v1.6.0
  • v1.5.0
  • v1.4.2
  • v1.4.1
  • v1.4.0
  • v1.3.2
  • v1.3.1
41 results

benchmark.go

Blame
  • permissioning.go 1.41 KiB
    ////////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 Privategrity Corporation                                   /
    //                                                                             /
    // All rights reserved.                                                        /
    ////////////////////////////////////////////////////////////////////////////////
    
    package api
    
    import (
    	"github.com/pkg/errors"
    	"gitlab.com/elixxir/client/storage"
    )
    
    // Returns an error if registration fails.
    func (c *Client) registerWithPermissioning() error {
    	userData := c.storage.User()
    	//get the users public key
    	pubKey := userData.GetCryptographicIdentity().GetRSA().GetPublic()
    
    	//load the registration code
    	regCode, err := c.storage.GetRegCode()
    	if err != nil {
    		return errors.WithMessage(err, "failed to register with "+
    			"permissioning")
    	}
    
    	//register with permissioning
    	regValidationSignature, err := c.permissioning.Register(pubKey, regCode)
    	if err != nil {
    		return errors.WithMessage(err, "failed to register with "+
    			"permissioning")
    	}
    
    	//store the signature
    	userData.SetRegistrationValidationSignature(regValidationSignature)
    
    	//update the registration status
    	err = c.storage.ForwardRegistrationStatus(storage.PermissioningComplete)
    	if err != nil {
    		return errors.WithMessage(err, "failed to update local state "+
    			"after registration with permissioning")
    	}
    	return nil
    }