Rather than a deleter function, I think the way I'd do this is with a creator function that has an inline deleter in the form of a lambda. That ensure it can't ever be screwed up, and cleans up a lot of repetition. Something like (written here, untested, possibly bad style in other ways):

    typedef std::unique_ptr<IKey, std::function<void(IKey*)>> ikey_ptr;
    static ikey_ptr alloc_ikey(size_t size) {
        return ikey_ptr(reinterpret_cast<IKey*>(new uint8_t[size]),
                        [](IKey* ptr) { delete[] reinterpret_cast<uint8_t*>(ptr); });
    }