private bool CanClaimEntry(Number480 key, IPublicKey publicKey) { var entryProtectedByOthers = _backend.IsEntryProtectedByOthers(key, publicKey); var entryOverridableByMe = ForceOverrideEntry(key.ContentKey, publicKey); return(!entryProtectedByOthers || entryOverridableByMe); }
private bool SecurityEntryCheck(Number480 key, IPublicKey publicKeyMessage, IPublicKey publicKeyData, bool entryProtection) { var entryProtectedByOthers = _backend.IsEntryProtectedByOthers(key, publicKeyMessage); // I dont want to claim the domain if (!entryProtection) { // Returns true if the domain is not protceted by others, otherwise // false if the domain is protected return(!entryProtectedByOthers); } //replication cannot sign messages with the originators key, so we must also check the public key of the data if (CanClaimEntry(key, publicKeyMessage) || CanClaimEntry(key, publicKeyData)) { if (CanProtectEntry(key.DomainKey, publicKeyMessage)) { return(_backend.ProtectEntry(key, publicKeyData)); } return(true); } return(false); }
private RangeLock <Number640> .Range Lock(Number480 number480) { return(RangeLock.Lock( new Number640(number480, Number160.Zero), new Number640(number480, Number160.MaxValue))); }
private bool CanClaimEntry(Number480 key, IPublicKey publicKey) { var entryProtectedByOthers = _backend.IsEntryProtectedByOthers(key, publicKey); var entryOverridableByMe = ForceOverrideEntry(key.ContentKey, publicKey); return !entryProtectedByOthers || entryOverridableByMe; }
private RangeLock<Number640>.Range Lock(Number480 number480) { return RangeLock.Lock( new Number640(number480, Number160.Zero), new Number640(number480, Number160.MaxValue)); }
private bool SecurityEntryCheck(Number480 key, IPublicKey publicKeyMessage, IPublicKey publicKeyData, bool entryProtection) { var entryProtectedByOthers = _backend.IsEntryProtectedByOthers(key, publicKeyMessage); // I dont want to claim the domain if (!entryProtection) { // Returns true if the domain is not protceted by others, otherwise // false if the domain is protected return !entryProtectedByOthers; } //replication cannot sign messages with the originators key, so we must also check the public key of the data if (CanClaimEntry(key, publicKeyMessage) || CanClaimEntry(key, publicKeyData)) { if (CanProtectEntry(key.DomainKey, publicKeyMessage)) { return _backend.ProtectEntry(key, publicKeyData); } return true; } return false; }