internal static void Categorize(SecurityTokenAttachmentMode value,
            out bool isBasic, out bool isSignedButNotBasic, out ReceiveSecurityHeaderBindingModes mode)
        {
            SecurityTokenAttachmentModeHelper.Validate(value);

            switch (value)
            {
                case SecurityTokenAttachmentMode.Endorsing:
                    isBasic = false;
                    isSignedButNotBasic = false;
                    mode = ReceiveSecurityHeaderBindingModes.Endorsing;
                    break;
                case SecurityTokenAttachmentMode.Signed:
                    isBasic = false;
                    isSignedButNotBasic = true;
                    mode = ReceiveSecurityHeaderBindingModes.Signed;
                    break;
                case SecurityTokenAttachmentMode.SignedEncrypted:
                    isBasic = true;
                    isSignedButNotBasic = false;
                    mode = ReceiveSecurityHeaderBindingModes.Basic;
                    break;
                case SecurityTokenAttachmentMode.SignedEndorsing:
                    isBasic = false;
                    isSignedButNotBasic = true;
                    mode = ReceiveSecurityHeaderBindingModes.SignedEndorsing;
                    break;
                default:
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value"));
            }
        }
 public void SetElement(ReceiveSecurityHeaderElementCategory elementCategory, object element, ReceiveSecurityHeaderBindingModes bindingMode, string id, bool encrypted, byte[] decryptedBuffer, TokenTracker supportingTokenTracker)
 {
     this.elementCategory        = elementCategory;
     this.element                = element;
     this.bindingMode            = bindingMode;
     this.encrypted              = encrypted;
     this.decryptedBuffer        = decryptedBuffer;
     this.supportingTokenTracker = supportingTokenTracker;
     this.id = id;
 }
 public void SetElement(ReceiveSecurityHeaderElementCategory elementCategory, object element, ReceiveSecurityHeaderBindingModes bindingMode, string id, bool encrypted, byte[] decryptedBuffer, TokenTracker supportingTokenTracker)
 {
     this.elementCategory = elementCategory;
     this.element = element;
     this.bindingMode = bindingMode;
     this.encrypted = encrypted;
     this.decryptedBuffer = decryptedBuffer;
     this.supportingTokenTracker = supportingTokenTracker;
     this.id = id;
 }
 public void AppendElement(
     ReceiveSecurityHeaderElementCategory elementCategory, object element,
     ReceiveSecurityHeaderBindingModes bindingMode, string id, TokenTracker supportingTokenTracker)
 {
     if (id != null)
     {
         VerifyIdUniquenessInSecurityHeader(id);
     }
     EnsureCapacityToAdd();
     _elements[Count++].SetElement(elementCategory, element, bindingMode, id, false, null, supportingTokenTracker);
 }
 public void SetElementAfterDecryption(
     int index,
     ReceiveSecurityHeaderElementCategory elementCategory, object element,
     ReceiveSecurityHeaderBindingModes bindingMode, string id, byte[] decryptedBuffer, TokenTracker supportingTokenTracker)
 {
     Fx.Assert(0 <= index && index < Count, "index out of range");
     Fx.Assert(_elements[index].elementCategory == ReceiveSecurityHeaderElementCategory.EncryptedData, "Replaced item must be EncryptedData");
     if (id != null)
     {
         VerifyIdUniquenessInSecurityHeader(id);
     }
     _elements[index].PreserveIdBeforeDecryption();
     _elements[index].SetElement(elementCategory, element, bindingMode, id, true, decryptedBuffer, supportingTokenTracker);
 }
 public void AppendToken(SecurityToken token, ReceiveSecurityHeaderBindingModes mode, TokenTracker supportingTokenTracker)
 {
     AppendElement(ReceiveSecurityHeaderElementCategory.Token, token,
                   mode, token.Id, supportingTokenTracker);
 }
 public void SetTokenAfterDecryption(int index, SecurityToken token, ReceiveSecurityHeaderBindingModes mode, byte[] decryptedBuffer, TokenTracker supportingTokenTracker)
 {
     SetElementAfterDecryption(index, ReceiveSecurityHeaderElementCategory.Token, token, mode, token.Id, decryptedBuffer, supportingTokenTracker);
 }
 public void SetBindingMode(int index, ReceiveSecurityHeaderBindingModes bindingMode)
 {
     Fx.Assert(0 <= index && index < Count, "index out of range");
     _elements[index].bindingMode = bindingMode;
 }
        internal static void Categorize(SecurityTokenAttachmentMode value, out bool isBasic, out bool isSignedButNotBasic, out ReceiveSecurityHeaderBindingModes mode)
        {
            Validate(value);
            switch (value)
            {
            case SecurityTokenAttachmentMode.Signed:
                isBasic             = false;
                isSignedButNotBasic = true;
                mode = ReceiveSecurityHeaderBindingModes.Signed;
                return;

            case SecurityTokenAttachmentMode.Endorsing:
                isBasic             = false;
                isSignedButNotBasic = false;
                mode = ReceiveSecurityHeaderBindingModes.Endorsing;
                return;

            case SecurityTokenAttachmentMode.SignedEndorsing:
                isBasic             = false;
                isSignedButNotBasic = true;
                mode = ReceiveSecurityHeaderBindingModes.SignedEndorsing;
                return;

            case SecurityTokenAttachmentMode.SignedEncrypted:
                isBasic             = true;
                isSignedButNotBasic = false;
                mode = ReceiveSecurityHeaderBindingModes.Basic;
                return;
            }
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value"));
        }
Beispiel #10
0
 public void SetElementAfterDecryption(int index, ReceiveSecurityHeaderElementCategory elementCategory, object element, ReceiveSecurityHeaderBindingModes bindingMode, string id, byte[] decryptedBuffer, TokenTracker supportingTokenTracker)
 {
     if (id != null)
     {
         this.VerifyIdUniquenessInSecurityHeader(id);
     }
     this.elements[index].PreserveIdBeforeDecryption();
     this.elements[index].SetElement(elementCategory, element, bindingMode, id, true, decryptedBuffer, supportingTokenTracker);
 }
Beispiel #11
0
 public void SetBindingMode(int index, ReceiveSecurityHeaderBindingModes bindingMode)
 {
     this.elements[index].bindingMode = bindingMode;
 }