| 709 | } |
| 710 | |
| 711 | bool ScriptingObjects::ScriptFile::writeEncryptedObject(var jsonData, String key) |
| 712 | { |
| 713 | auto data = key.getCharPointer().getAddress(); |
| 714 | auto size = jlimit(0, 72, key.length()); |
| 715 | |
| 716 | BlowFish bf(data, size); |
| 717 | |
| 718 | auto text = JSON::toString(jsonData, true); |
| 719 | |
| 720 | MemoryOutputStream mos; |
| 721 | mos.writeString(text); |
| 722 | mos.flush(); |
| 723 | |
| 724 | auto out = mos.getMemoryBlock(); |
| 725 | |
| 726 | bf.encrypt(out); |
| 727 | |
| 728 | return f.replaceWithText(out.toBase64Encoding()); |
| 729 | } |
| 730 | |
| 731 | String ScriptingObjects::ScriptFile::loadAsString() const |
| 732 | { |
nothing calls this directly
no test coverage detected