mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-15 09:04:25 +00:00
add encryption support
This commit is contained in:
parent
4b8f83bd70
commit
00d2c2a74a
@ -72,6 +72,9 @@ Realm::Realm(Config config)
|
||||
m_group = m_read_only_group.get();
|
||||
}
|
||||
else {
|
||||
if (m_config.encryption_key.data() && m_config.encryption_key.size() != 64) {
|
||||
throw InvalidEncryptionKeyException();
|
||||
}
|
||||
m_history = realm::make_client_history(m_config.path, m_config.encryption_key.data());
|
||||
SharedGroup::DurabilityLevel durability = m_config.in_memory ? SharedGroup::durability_MemOnly :
|
||||
SharedGroup::durability_Full;
|
||||
|
@ -199,6 +199,11 @@ namespace realm {
|
||||
public:
|
||||
UnitializedRealmException(std::string message) : std::runtime_error(message) {}
|
||||
};
|
||||
|
||||
class InvalidEncryptionKeyException : public std::runtime_error {
|
||||
public:
|
||||
InvalidEncryptionKeyException() : std::runtime_error("Encryption key must be 64 bytes.") {}
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* defined(REALM_REALM_HPP) */
|
||||
|
Loading…
x
Reference in New Issue
Block a user