# How to KeySwitch - Serialize (CKKS) - OpenFHE

**URL:** <https://openfhe.discourse.group/t/how-to-keyswitch-serialize-ckks-openfhe/906>\
**Category:** Library Questions\
**Created:** [November 12, 2023, 3:58pm UTC](https://openfhe.discourse.group/t/how-to-keyswitch-serialize-ckks-openfhe/906 "2023-11-12T15:58:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stylianos\_x](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@stylianos\_x](https://openfhe.discourse.group/u/stylianos_x)\
**Post date:** [November 12, 2023, 3:58pm UTC](https://openfhe.discourse.group/t/how-to-keyswitch-serialize-ckks-openfhe/906/1 "2023-11-12T15:58:00Z")

</div>

Hello,

Regarding the keys generated from the methods, KeySwitchGen() and MultiKeySwitchGen(),  
How can I serialize those?

I want to :

1.serialize key from KeySwitchGen  
2. Move it to the second party & deserialize  
3. call MultiKeySwitchGen on second party, serialize the result  
4. Move the result back to the main party.

I did check the Palisade example but since there are some differences I’m not sure which function to use.  
I also did not see any SerializeEvalKeySwitch kind of function.

---

<div class="post-metadata">

**Author:** ![stylianos\_x](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@stylianos\_x](https://openfhe.discourse.group/u/stylianos_x)\
**Post date:** [November 12, 2023, 6:23pm UTC](https://openfhe.discourse.group/t/how-to-keyswitch-serialize-ckks-openfhe/906/2 "2023-11-12T18:23:51Z")

</div>

It seems that SerializeToFile works.
