Users A and B have registered to a cloud service (cloud assumed to be
semi-trusted). A and B both have secret keys (KA and KB) (for
symmetric encryption) and public keys (PKA and PKB) on the cloud
server. KA and KB are each encrypted with the passwords of A and B.

Now consider A wants to share a file F that is encrypted with key K (K
is generate randomly by A). Now K should be shared securely with B
over the cloud (we consider that B is not online at the time of
sharing). To do this one option would be encrypting K with PKB which
should be decrypted by B when he gets online. However this option
seems to be complicated for my client.

I was wondering whether you have better options in mind that could help me.
Please let me know if the explantation is not clear.