public WrappedKeySecurityToken(string id, byte[] keyToWrap, string wrappingAlgorithm, ISspiNegotiation wrappingSspiContext, byte[] wrappedKey) : this(id, keyToWrap, wrappingAlgorithm, (XmlDictionaryString)null) { if (wrappingSspiContext == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("wrappingSspiContext"); } this.wrappingSspiContext = wrappingSspiContext; this.wrappedKey = wrappedKey != null ? wrappedKey : wrappingSspiContext.Encrypt(keyToWrap); this.serializeCarriedKeyName = false; }
// direct receiver use, chained sender use internal WrappedKeySecurityToken(string id, byte[] keyToWrap, string wrappingAlgorithm, ISspiNegotiation wrappingSspiContext, byte[] wrappedKey) : this(id, keyToWrap, wrappingAlgorithm, null) { if (wrappingSspiContext == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("wrappingSspiContext"); } _wrappingSspiContext = wrappingSspiContext; if (wrappedKey == null) { _wrappedKey = wrappingSspiContext.Encrypt(keyToWrap); } else { _wrappedKey = wrappedKey; } _serializeCarriedKeyName = false; }