public static void register(boolean newKeyAllowed) throws GeneralSecurityException {
    if (!TinkFipsUtil.AlgorithmFipsCompatibility.ALGORITHM_NOT_FIPS.isCompatible()) {
      throw new GeneralSecurityException("Registering AES GCM SIV is not supported in FIPS mode");
    }
    // We want to register key proto serialization even when AES-GCM-SIV is unavailable via the
    // Java Cryptographic Extension framework (and thus via Tink) to enable operations that don't
    // depend on the actual cryptographic primitive - for example, exporting keys to key management
    // systems.
    AesGcmSivProtoSerialization.register();
    if (canUseAesGcmSive()) {
      MutablePrimitiveRegistry.globalInstance()
          .registerPrimitiveConstructor(AES_GCM_SIV_PRIMITIVE_CONSTRUCTOR);
      MutableParametersRegistry.globalInstance().putAll(namedParameters());
      MutableKeyDerivationRegistry.globalInstance().add(KEY_DERIVER, AesGcmSivParameters.class);
      MutableKeyCreationRegistry.globalInstance().add(KEY_CREATOR, AesGcmSivParameters.class);
      KeyManagerRegistry.globalInstance().registerKeyManager(legacyKeyManager, newKeyAllowed);
    }
  }
This key manager generates new {@code AesGcmSivKey} keys and produces new instances of {@code
AesGcmSiv}.
java_src/src/main/java/com/google/crypto/tink/aead/AesGcmSivKeyManager.java