private static Set<Class<?>> createAllowedPrimitives() {
    HashSet<Class<?>> result = new HashSet<>();
    result.add(Aead.class);
    result.add(DeterministicAead.class);
    result.add(StreamingAead.class);
    result.add(HybridEncrypt.class);
    result.add(HybridDecrypt.class);
    result.add(Mac.class);
    result.add(Prf.class);
    result.add(PublicKeySign.class);
    result.add(PublicKeyVerify.class);
    return result;
  }
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