diff --git a/README.md b/README.md index 68516de..50ecbf6 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ privkey, err := SetupAccount(ctx, rClient, userID, token, "password123") ## Verification -You can Verify that the Server hasen't changed, for that you need to initially setup the Verification and save the returned values. Then you can Verify that the serverkey hasen't changed since you setup the Verification. +You can Verify that the Server hasen't changed, for that you need to initially setup the Verification and save the returned values. Then you can Verify that the serverkey hasen't changed since you setup the Verification. Note this Only Works if the client is not logged in. ```go // Setup the Verification diff --git a/api/verify.go b/api/verify.go index 638ee42..b8d42d4 100644 --- a/api/verify.go +++ b/api/verify.go @@ -20,6 +20,7 @@ type GPGVerify struct { Token string `json:"server_verify_token,omitempty"` } +// SetupServerVerification sets up Server Verification, Only works before login func (c *Client) SetupServerVerification(ctx context.Context) (string, string, error) { serverKey, _, err := c.GetPublicKey(ctx) if err != nil { @@ -41,6 +42,7 @@ func (c *Client) SetupServerVerification(ctx context.Context) (string, string, e return token, encToken, err } +// VerifyServer verifys that the Server is still the same one as during the Setup, Only works before login func (c *Client) VerifyServer(ctx context.Context, token, encToken string) error { privateKeyObj, err := crypto.NewKeyFromArmored(c.userPrivateKey) if err != nil {