Documentation ¶
Index ¶
- type SonrController
- func (c *SonrController) Account() *identitytypes.ControllerAccount
- func (c *SonrController) CreateWallet(ct crypto.CoinType) (*crypto.AccountData, error)
- func (c *SonrController) GetPrimaryWallet() *sonr.Account
- func (c *SonrController) GetWallet(did string) (*crypto.AccountData, error)
- func (c *SonrController) ListWallets() []string
- func (c *SonrController) SignWithWallet(did string, msg []byte) ([]byte, error)
- func (c *SonrController) VerifyWithWallet(did string, msg []byte, sig []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SonrController ¶
type SonrController struct { ID types.DIDIdentifier Method types.DIDMethod Authenticator *authr.Authenticator // contains filtered or unexported fields }
SonrController is a controller for the Sonr DID method
func AuthorizeIdentity ¶
func AuthorizeIdentity(email string, controllerAcc *identitytypes.ControllerAccount) (*SonrController, error)
AuthorizeIdentity resolves a DID to an IDX controller
func New ¶
func New(email string, cred *types.Credential, origin string) (*SonrController, error)
New creates a new identifier for the IDX controller
func (*SonrController) Account ¶
func (c *SonrController) Account() *identitytypes.ControllerAccount
Account returns the controller account
func (*SonrController) CreateWallet ¶
func (c *SonrController) CreateWallet(ct crypto.CoinType) (*crypto.AccountData, error)
CreateWallet creates a new wallet for the given coin type
func (*SonrController) GetPrimaryWallet ¶
func (c *SonrController) GetPrimaryWallet() *sonr.Account
GetPrimaryWallet returns the primary wallet sonr account
func (*SonrController) GetWallet ¶
func (c *SonrController) GetWallet(did string) (*crypto.AccountData, error)
GetWallet returns the wallet info for the given DID
func (*SonrController) ListWallets ¶
func (c *SonrController) ListWallets() []string
ListWallets returns the list of wallets for the controller
func (*SonrController) SignWithWallet ¶
func (c *SonrController) SignWithWallet(did string, msg []byte) ([]byte, error)
SignWithWallet signs the given message with the wallet
func (*SonrController) VerifyWithWallet ¶
VerifyWithWallet verifies the given signature with the wallet
Click to show internal directories.
Click to hide internal directories.