public synchronized <SerializationT extends Serialization> void registerKeyParser(
      KeyParser<SerializationT> parser) throws GeneralSecurityException {
    SerializationRegistry newRegistry =
        new SerializationRegistry.Builder(registry.get()).registerKeyParser(parser).build();
    registry.set(newRegistry);
  }
Registers a key parser for later use in {@link #parseKey}.

<p>This registers a key serializer which can later be used to serialize a key by calling {@link
#parseKey}. If a parser for the pair {@code (SerializationT, parser.getObjectIdentifier())} has
already been registered, this checks if they are the same. If they are, the call is ignored,
otherwise an exception is thrown, and the object is unchanged.
java_src/src/main/java/com/google/crypto/tink/internal/MutableSerializationRegistry.java