Also a minor clarification @miconda This patch (even with this current form) needs a patch to libstirshaken (to process chain when copying cert). So, maybe instead let's have a proper commit to libstirshaken, that would handle also a read/write to disk I/O, then there is no need to introduce new methods to Kamailio module in this commit.