Add missing Comments

This commit is contained in:
Samuel Lorch 2021-09-22 13:09:11 +02:00
parent 0e7cca97a2
commit 8e4637492d
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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 {