| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.KeyVault.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Collections; |
| | 16 | | using System.Collections.Generic; |
| | 17 | | using System.Linq; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Properties of the X509 component of a certificate. |
| | 21 | | /// </summary> |
| | 22 | | public partial class X509CertificateProperties |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Initializes a new instance of the X509CertificateProperties class. |
| | 26 | | /// </summary> |
| 104 | 27 | | public X509CertificateProperties() |
| | 28 | | { |
| | 29 | | CustomInit(); |
| 104 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the X509CertificateProperties class. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="subject">The subject name. Should be a valid X509 |
| | 36 | | /// distinguished Name.</param> |
| | 37 | | /// <param name="ekus">The enhanced key usage.</param> |
| | 38 | | /// <param name="subjectAlternativeNames">The subject alternative |
| | 39 | | /// names.</param> |
| | 40 | | /// <param name="keyUsage">List of key usages.</param> |
| | 41 | | /// <param name="validityInMonths">The duration that the ceritifcate is |
| | 42 | | /// valid in months.</param> |
| 0 | 43 | | public X509CertificateProperties(string subject = default(string), IList<string> ekus = default(IList<string>), |
| | 44 | | { |
| 0 | 45 | | Subject = subject; |
| 0 | 46 | | Ekus = ekus; |
| 0 | 47 | | SubjectAlternativeNames = subjectAlternativeNames; |
| 0 | 48 | | KeyUsage = keyUsage; |
| 0 | 49 | | ValidityInMonths = validityInMonths; |
| | 50 | | CustomInit(); |
| 0 | 51 | | } |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// An initialization method that performs custom operations like setting defaults |
| | 55 | | /// </summary> |
| | 56 | | partial void CustomInit(); |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// Gets or sets the subject name. Should be a valid X509 distinguished |
| | 60 | | /// Name. |
| | 61 | | /// </summary> |
| | 62 | | [JsonProperty(PropertyName = "subject")] |
| 114 | 63 | | public string Subject { get; set; } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Gets or sets the enhanced key usage. |
| | 67 | | /// </summary> |
| | 68 | | [JsonProperty(PropertyName = "ekus")] |
| 202 | 69 | | public IList<string> Ekus { get; set; } |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// Gets or sets the subject alternative names. |
| | 73 | | /// </summary> |
| | 74 | | [JsonProperty(PropertyName = "sans")] |
| 58 | 75 | | public SubjectAlternativeNames SubjectAlternativeNames { get; set; } |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Gets or sets list of key usages. |
| | 79 | | /// </summary> |
| | 80 | | [JsonProperty(PropertyName = "key_usage")] |
| 202 | 81 | | public IList<string> KeyUsage { get; set; } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Gets or sets the duration that the ceritifcate is valid in months. |
| | 85 | | /// </summary> |
| | 86 | | [JsonProperty(PropertyName = "validity_months")] |
| 120 | 87 | | public int? ValidityInMonths { get; set; } |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// Validate the object. |
| | 91 | | /// </summary> |
| | 92 | | /// <exception cref="ValidationException"> |
| | 93 | | /// Thrown if validation fails |
| | 94 | | /// </exception> |
| | 95 | | public virtual void Validate() |
| | 96 | | { |
| 8 | 97 | | if (ValidityInMonths < 0) |
| | 98 | | { |
| 0 | 99 | | throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInMonths", 0); |
| | 100 | | } |
| 8 | 101 | | } |
| | 102 | | } |
| | 103 | | } |