| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 2 | |
| 3 | namespace WixToolset.Iis |
| 4 | { |
| 5 | using WixToolset.Data; |
| 6 | using WixToolset.Iis.Symbols; |
| 7 | |
| 8 | public static partial class IisSymbolDefinitions |
| 9 | { |
| 10 | public static readonly IntermediateSymbolDefinition Certificate = new IntermediateSymbolDefinition( |
| 11 | IisSymbolDefinitionType.Certificate.ToString(), |
| 12 | new[] |
| 13 | { |
| 14 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.ComponentRef), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.Name), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.StoreLocation), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.StoreName), IntermediateFieldType.String), |
| 18 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.Attributes), IntermediateFieldType.Number), |
| 19 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.BinaryRef), IntermediateFieldType.String), |
| 20 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.CertificatePath), IntermediateFieldType.String), |
| 21 | new IntermediateFieldDefinition(nameof(CertificateSymbolFields.PFXPassword), IntermediateFieldType.String), |
| 22 | }, |
| 23 | typeof(CertificateSymbol)); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | namespace WixToolset.Iis.Symbols |
| 28 | { |
| 29 | using WixToolset.Data; |
| 30 | |
| 31 | public enum CertificateSymbolFields |
| 32 | { |
| 33 | ComponentRef, |
| 34 | Name, |
| 35 | StoreLocation, |
| 36 | StoreName, |
| 37 | Attributes, |
| 38 | BinaryRef, |
| 39 | CertificatePath, |
| 40 | PFXPassword, |
| 41 | } |
| 42 | |
| 43 | public class CertificateSymbol : IntermediateSymbol |
| 44 | { |
| 45 | public CertificateSymbol() : base(IisSymbolDefinitions.Certificate, null, null) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | public CertificateSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.Certificate, sourceLineNumber, id) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | public IntermediateField this[CertificateSymbolFields index] => this.Fields[(int)index]; |
| 54 | |
| 55 | public string ComponentRef |
| 56 | { |
| 57 | get => this.Fields[(int)CertificateSymbolFields.ComponentRef].AsString(); |
| 58 | set => this.Set((int)CertificateSymbolFields.ComponentRef, value); |
| 59 | } |
| 60 | |
| 61 | public string Name |
| 62 | { |
| 63 | get => this.Fields[(int)CertificateSymbolFields.Name].AsString(); |
| 64 | set => this.Set((int)CertificateSymbolFields.Name, value); |
| 65 | } |
| 66 | |
| 67 | public int StoreLocation |
| 68 | { |
| 69 | get => this.Fields[(int)CertificateSymbolFields.StoreLocation].AsNumber(); |
| 70 | set => this.Set((int)CertificateSymbolFields.StoreLocation, value); |
| 71 | } |
| 72 | |
| 73 | public string StoreName |
| 74 | { |
| 75 | get => this.Fields[(int)CertificateSymbolFields.StoreName].AsString(); |
| 76 | set => this.Set((int)CertificateSymbolFields.StoreName, value); |
| 77 | } |
| 78 | |
| 79 | public int Attributes |
| 80 | { |
| 81 | get => this.Fields[(int)CertificateSymbolFields.Attributes].AsNumber(); |
| 82 | set => this.Set((int)CertificateSymbolFields.Attributes, value); |
| 83 | } |
| 84 | |
| 85 | public string BinaryRef |
| 86 | { |
| 87 | get => this.Fields[(int)CertificateSymbolFields.BinaryRef].AsString(); |
| 88 | set => this.Set((int)CertificateSymbolFields.BinaryRef, value); |
| 89 | } |
| 90 | |
| 91 | public string CertificatePath |
| 92 | { |
| 93 | get => this.Fields[(int)CertificateSymbolFields.CertificatePath].AsString(); |
| 94 | set => this.Set((int)CertificateSymbolFields.CertificatePath, value); |
| 95 | } |
| 96 | |
| 97 | public string PFXPassword |
| 98 | { |
| 99 | get => this.Fields[(int)CertificateSymbolFields.PFXPassword].AsString(); |
| 100 | set => this.Set((int)CertificateSymbolFields.PFXPassword, value); |
| 101 | } |
| 102 | } |
| 103 | } |