private static ProtoKeySerialization serializeKey(
      AesCtrHmacStreamingKey key, @Nullable SecretKeyAccess access)
      throws GeneralSecurityException {
    return ProtoKeySerialization.create(
        TYPE_URL,
        com.google.crypto.tink.proto.AesCtrHmacStreamingKey.newBuilder()
            .setKeyValue(
                ByteString.copyFrom(
                    key.getInitialKeyMaterial().toByteArray(SecretKeyAccess.requireAccess(access))))
            .setParams(toProtoParams(key.getParameters()))
            .build()
            .toByteString(),
        KeyMaterialType.SYMMETRIC,
        OutputPrefixType.RAW,
        key.getIdRequirementOrNull());
  }
Methods to serialize and parse {@link AesCtrHmacStreamingKey} objects and {@link
AesCtrHmacStreamingParameters} objects
java_src/src/main/java/com/google/crypto/tink/streamingaead/internal/AesCtrHmacStreamingProtoSerialization.java