Skip to content

Commit

Permalink
Mark getPrimeP and getPrimeQ with RestrictedApi (AccessesPartialKey).
Browse files Browse the repository at this point in the history
These are error prone and users should read the linked page before using it.

PiperOrigin-RevId: 525111715
Change-Id: I5e00bf0b393a22a22c9a75b4088867c71989ab44
  • Loading branch information
tholenst authored and copybara-github committed Apr 18, 2023
1 parent 3151be5 commit 6d14507
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,21 @@ public RsaSsaPkcs1PublicKey getPublicKey() {
}

/** Returns the prime factor p. */
@RestrictedApi(
explanation = "Accessing parts of keys can produce unexpected incompatibilities, annotate the function with @AccessesPartialKey",
link = "https://developers.google.com/tink/design/access_control#accessing_partial_keys",
allowedOnPath = ".*Test\\.java",
allowlistAnnotations = {AccessesPartialKey.class})
public SecretBigInteger getPrimeP() {
return p;
}

/** Returns the prime factor q. */
@RestrictedApi(
explanation = "Accessing parts of keys can produce unexpected incompatibilities, annotate the function with @AccessesPartialKey",
link = "https://developers.google.com/tink/design/access_control#accessing_partial_keys",
allowedOnPath = ".*Test\\.java",
allowlistAnnotations = {AccessesPartialKey.class})
public SecretBigInteger getPrimeQ() {
return q;
}
Expand Down

0 comments on commit 6d14507

Please sign in to comment.