@Override
      public SerializationT serializeKey(KeyT key, @Nullable SecretKeyAccess access)
          throws GeneralSecurityException {
        return function.serializeKey(key, access);
      }
Creates a KeySerializer object.

<p>In order to create a KeySerializer object, one typically writes a function

<pre>{@code
class MyClass {
  private static MySerialization serialize(MyKey key, @Nullable SecretKeyAccess access)
            throws GeneralSecurityException {
    ...
  }
}
}</pre>

This function can then be used to create a {@code KeySerializer}:

<pre>{@code
KeySerializer<MyKey, MySerialization> serializer =
      KeySerializer.create(MyClass::serialize, MyKey.class, MySerialization.class);
}</pre>

<p>Note that calling this function twice will result in objects which are not equal according
to {@code Object.equals}, and hence cannot be used to re-register a previously registered
object.
java_src/src/main/java/com/google/crypto/tink/internal/KeySerializer.java