setNewKey method
void
setNewKey({})
override
Implementation
void setNewKey({required String newModule, required String newKey, bool override = true}){
if(utf8.encode(newKey).length != _KEY_LENGTH) throw NUICryptoException(cause: NUICryptoError.KEY_LENGTH_NOT_MATCH);
if(override){
module[newModule] = newKey;
return;
}
if(module.containsKey(newModule)) {
throw NUICryptoException(cause: NUICryptoError.KEY_CANNOT_BE_OVERRIDE);
}else{
module[newModule] = newKey;
}
}