public static synchronized <P> void registerKeyManager(final KeyManager<P> manager)
      throws GeneralSecurityException {
    registerKeyManager(manager, /* newKeyAllowed= */ true);
  }
Tries to register {@code manager} for {@code manager.getKeyType()}. Users can generate new keys
with this manager using the {@link Registry#newKey} methods.

<p>If there is an existing key manager, throws an exception if {@code manager} and the existing
key manager aren't instances of the same class, or the existing key manager could not create
new keys. Otherwise registration succeeds.

@throws GeneralSecurityException if there's an existing key manager is not an instance of the
    class of {@code manager}, or the registration tries to re-enable the generation of new
    keys.
java_src/src/main/java/com/google/crypto/tink/Registry.java