Пример #1
0
        private bool CanClaimEntry(Number480 key, IPublicKey publicKey)
        {
            var entryProtectedByOthers = _backend.IsEntryProtectedByOthers(key, publicKey);
            var entryOverridableByMe   = ForceOverrideEntry(key.ContentKey, publicKey);

            return(!entryProtectedByOthers || entryOverridableByMe);
        }
Пример #2
0
        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);
        }
Пример #3
0
 private RangeLock <Number640> .Range Lock(Number480 number480)
 {
     return(RangeLock.Lock(
                new Number640(number480, Number160.Zero),
                new Number640(number480, Number160.MaxValue)));
 }
Пример #4
0
        private bool CanClaimEntry(Number480 key, IPublicKey publicKey)
        {
		    var entryProtectedByOthers = _backend.IsEntryProtectedByOthers(key, publicKey);
		    var entryOverridableByMe = ForceOverrideEntry(key.ContentKey, publicKey);
		    return !entryProtectedByOthers || entryOverridableByMe;
	    }
Пример #5
0
 private RangeLock<Number640>.Range Lock(Number480 number480)
 {
     return RangeLock.Lock(
         new Number640(number480, Number160.Zero), 
         new Number640(number480, Number160.MaxValue));
 }
Пример #6
0
        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;
	    }