[Nearby] Add methods to certificate storage
We add the following methods to certificate storage: 1) UpdatePrivateCertificate(): Replaces the private certificate that has same ID; no-op if a certificate with that ID doesn't exist. This is necessary to update the private certificate's list of consumed salts that changes every time its metadata key is encrypted. This will be used in a follow-up CL. 2) RemoveExpiredPrivateCertificates(): Deletes all certificates with a not-after time later than the current time. This action is currently being performed by the certificate manager, but we want to move the logic to the storage class in a follow-up CL. 3) ClearPrivateCertificatesOfVisibility(): Deletes all private certificates of a given visibility. This is necessary for removing only the relevant certificates when contacts change; currently, all certificates are being cleared when the allowlist changes or the contact list changes. This will be used in a follow-up CL. We also implement most private-certificate methods in the base class so that they can also be used by the fake implementation. Bug: b/166473931, b/168022980, b/166112705, 1123134, 1121443 Change-Id: If3e873383e2289047200123939302e85587f441f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412479Reviewed-by:James Vecore <vecore@google.com> Commit-Queue: Josh Nohle <nohle@chromium.org> Cr-Commit-Position: refs/heads/master@{#807286}
Showing
Please register or sign in to comment