Skip to content

Commit

Permalink
Remove "deprecation under consideration markers" in the Registry.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 511147588
Change-Id: Ib41f89a4bd5b727387ea560b2c3abf18325f5ac8
  • Loading branch information
tholenst authored and copybara-github committed Feb 21, 2023
1 parent 1f284a6 commit edddf80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/main/java/com/google/crypto/tink/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public static synchronized <KeyProtoT extends MessageLite> void registerKeyManag
* of the same class as {@code manager}
* @deprecated use {@link #registerKeyManager(KeyManager) registerKeyManager(KeyManager&lt;P&gt;)}
*/
@Deprecated /* Deprecation under consideration */
@Deprecated
public static synchronized <P> void registerKeyManager(
String typeUrl, final KeyManager<P> manager) throws GeneralSecurityException {
registerKeyManager(typeUrl, manager, /* newKeyAllowed= */ true);
Expand All @@ -337,7 +337,7 @@ public static synchronized <P> void registerKeyManager(
* @deprecated use {@link #registerKeyManager(KeyManager, boolean)
* registerKeyManager(KeyManager&lt;P&gt;, boolean)}
*/
@Deprecated /* Deprecation under consideration */
@Deprecated
public static synchronized <P> void registerKeyManager(
String typeUrl, final KeyManager<P> manager, boolean newKeyAllowed)
throws GeneralSecurityException {
Expand Down Expand Up @@ -491,8 +491,9 @@ public static synchronized <B, P> void registerPrimitiveWrapper(
* @deprecated Use {@code getKeyManager(typeUrl, Primitive.class)} or {@code getUntypedKeyManager
* typeUrl} instead.
*/
@Deprecated /* Deprecation under consideration */
public static <P> KeyManager<P> getKeyManager(String typeUrl) throws GeneralSecurityException {
@Deprecated
public static <P> KeyManager<P> getKeyManager(String typeUrl)
throws GeneralSecurityException {
return keyManagerRegistry.get().getKeyManager(typeUrl);
}

Expand Down Expand Up @@ -631,8 +632,8 @@ public static KeyData getPublicKeyData(String typeUrl, ByteString serializedPriv
* @return a new primitive
* @deprecated Use {@code getPrimitive(typeUrl, key, P.class)} instead.
*/
@Deprecated /* Deprecation under consideration */
@SuppressWarnings("TypeParameterUnusedInFormals")
@Deprecated
public static <P> P getPrimitive(String typeUrl, MessageLite key)
throws GeneralSecurityException {
KeyManager<P> manager = keyManagerRegistry.get().getKeyManager(typeUrl);
Expand Down Expand Up @@ -662,8 +663,8 @@ public static <P> P getPrimitive(String typeUrl, MessageLite key, Class<P> primi
* @return a new primitive
* @deprecated Use {@code getPrimitive(typeUrl, serializedKey, Primitive.class} instead.
*/
@Deprecated /* Deprecation under consideration */
@SuppressWarnings("TypeParameterUnusedInFormals")
@Deprecated
public static <P> P getPrimitive(String typeUrl, ByteString serializedKey)
throws GeneralSecurityException {
KeyManager<P> manager = keyManagerRegistry.get().getKeyManager(typeUrl);
Expand Down Expand Up @@ -694,8 +695,8 @@ public static <P> P getPrimitive(
* @deprecated Use {@code getPrimitive(typeUrl, serializedKey, Primitive.class)} instead.
* @return a new primitive
*/
@Deprecated /* Deprecation under consideration */
@SuppressWarnings("TypeParameterUnusedInFormals")
@Deprecated
public static <P> P getPrimitive(String typeUrl, byte[] serializedKey)
throws GeneralSecurityException {
return getPrimitive(typeUrl, ByteString.copyFrom(serializedKey));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void aaaTestInitialization() throws Exception {
MacConfig.register();

// After registration the key manager should be present.
assertNotNull(Registry.getKeyManager(typeUrl));
assertNotNull(Registry.getUntypedKeyManager(typeUrl));

// Running init() manually again should succeed.
MacConfig.register();
Expand Down

0 comments on commit edddf80

Please sign in to comment.