UploadPublicKey uploads the public key (if one is defined), so subsequent (likely synchronous) indexing of uploaded signed blobs will have access to the public key to verify it. In the normal case, the stat cache prevents this from doing anything anyway.
(ctx context.Context)
| 1402 | // will have access to the public key to verify it. In the normal |
| 1403 | // case, the stat cache prevents this from doing anything anyway. |
| 1404 | func (c *Client) UploadPublicKey(ctx context.Context) error { |
| 1405 | sigRef := c.SignerPublicKeyBlobref() |
| 1406 | if !sigRef.Valid() { |
| 1407 | return nil |
| 1408 | } |
| 1409 | var err error |
| 1410 | if _, keyUploaded := c.haveCache.StatBlobCache(sigRef); !keyUploaded { |
| 1411 | _, err = c.uploadString(ctx, c.publicKeyArmored, false) |
| 1412 | } |
| 1413 | return err |
| 1414 | } |
| 1415 | |
| 1416 | // checkMatchingKeys compares the client's and the server's keys and logs if they differ. |
| 1417 | func (c *Client) checkMatchingKeys() { |
no test coverage detected