| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Xml; |
| | | 5 | | using DictionaryManager = CoreWCF.IdentityModel.DictionaryManager; |
| | | 6 | | using ISignatureValueSecurityElement = CoreWCF.IdentityModel.ISignatureValueSecurityElement; |
| | | 7 | | |
| | | 8 | | namespace CoreWCF.Security |
| | | 9 | | { |
| | | 10 | | internal class SignatureConfirmationElement : ISignatureValueSecurityElement |
| | | 11 | | { |
| | | 12 | | private readonly SecurityVersion _version; |
| | | 13 | | private readonly byte[] _signatureValue; |
| | | 14 | | |
| | 0 | 15 | | public SignatureConfirmationElement(string id, byte[] signatureValue, SecurityVersion version) |
| | | 16 | | { |
| | 0 | 17 | | Id = id ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(id)); |
| | 0 | 18 | | _signatureValue = signatureValue ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof( |
| | 0 | 19 | | _version = version; |
| | 0 | 20 | | } |
| | | 21 | | |
| | 0 | 22 | | public bool HasId => true; |
| | | 23 | | |
| | 0 | 24 | | public string Id { get; } |
| | | 25 | | |
| | | 26 | | public byte[] GetSignatureValue() |
| | | 27 | | { |
| | 0 | 28 | | return _signatureValue; |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | public void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager) |
| | | 32 | | { |
| | 0 | 33 | | _version.WriteSignatureConfirmation(writer, Id, _signatureValue); |
| | 0 | 34 | | } |
| | | 35 | | } |
| | | 36 | | } |