| | | 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 | | /// The certificate import parameters. |
| | | 21 | | /// </summary> |
| | | 22 | | public partial class CertificateImportParameters |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Initializes a new instance of the CertificateImportParameters |
| | | 26 | | /// class. |
| | | 27 | | /// </summary> |
| | 26 | 28 | | public CertificateImportParameters() |
| | | 29 | | { |
| | | 30 | | CustomInit(); |
| | 26 | 31 | | } |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Initializes a new instance of the CertificateImportParameters |
| | | 35 | | /// class. |
| | | 36 | | /// </summary> |
| | | 37 | | /// <param name="base64EncodedCertificate">Base64 encoded |
| | | 38 | | /// representation of the certificate object to import. This |
| | | 39 | | /// certificate needs to contain the private key.</param> |
| | | 40 | | /// <param name="password">If the private key in |
| | | 41 | | /// base64EncodedCertificate is encrypted, the password used for |
| | | 42 | | /// encryption.</param> |
| | | 43 | | /// <param name="certificatePolicy">The management policy for the |
| | | 44 | | /// certificate.</param> |
| | | 45 | | /// <param name="certificateAttributes">The attributes of the |
| | | 46 | | /// certificate (optional).</param> |
| | | 47 | | /// <param name="tags">Application specific metadata in the form of |
| | | 48 | | /// key-value pairs.</param> |
| | 0 | 49 | | public CertificateImportParameters(string base64EncodedCertificate, string password = default(string), Certifica |
| | | 50 | | { |
| | 0 | 51 | | Base64EncodedCertificate = base64EncodedCertificate; |
| | 0 | 52 | | Password = password; |
| | 0 | 53 | | CertificatePolicy = certificatePolicy; |
| | 0 | 54 | | CertificateAttributes = certificateAttributes; |
| | 0 | 55 | | Tags = tags; |
| | | 56 | | CustomInit(); |
| | 0 | 57 | | } |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// An initialization method that performs custom operations like setting defaults |
| | | 61 | | /// </summary> |
| | | 62 | | partial void CustomInit(); |
| | | 63 | | |
| | | 64 | | /// <summary> |
| | | 65 | | /// Gets or sets base64 encoded representation of the certificate |
| | | 66 | | /// object to import. This certificate needs to contain the private |
| | | 67 | | /// key. |
| | | 68 | | /// </summary> |
| | | 69 | | [JsonProperty(PropertyName = "value")] |
| | 52 | 70 | | public string Base64EncodedCertificate { get; set; } |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Gets or sets if the private key in base64EncodedCertificate is |
| | | 74 | | /// encrypted, the password used for encryption. |
| | | 75 | | /// </summary> |
| | | 76 | | [JsonProperty(PropertyName = "pwd")] |
| | 52 | 77 | | public string Password { get; set; } |
| | | 78 | | |
| | | 79 | | /// <summary> |
| | | 80 | | /// Gets or sets the management policy for the certificate. |
| | | 81 | | /// </summary> |
| | | 82 | | [JsonProperty(PropertyName = "policy")] |
| | 52 | 83 | | public CertificatePolicy CertificatePolicy { get; set; } |
| | | 84 | | |
| | | 85 | | /// <summary> |
| | | 86 | | /// Gets or sets the attributes of the certificate (optional). |
| | | 87 | | /// </summary> |
| | | 88 | | [JsonProperty(PropertyName = "attributes")] |
| | 52 | 89 | | public CertificateAttributes CertificateAttributes { get; set; } |
| | | 90 | | |
| | | 91 | | /// <summary> |
| | | 92 | | /// Gets or sets application specific metadata in the form of key-value |
| | | 93 | | /// pairs. |
| | | 94 | | /// </summary> |
| | | 95 | | [JsonProperty(PropertyName = "tags")] |
| | 52 | 96 | | public IDictionary<string, string> Tags { get; set; } |
| | | 97 | | |
| | | 98 | | /// <summary> |
| | | 99 | | /// Validate the object. |
| | | 100 | | /// </summary> |
| | | 101 | | /// <exception cref="ValidationException"> |
| | | 102 | | /// Thrown if validation fails |
| | | 103 | | /// </exception> |
| | | 104 | | public virtual void Validate() |
| | | 105 | | { |
| | 0 | 106 | | if (Base64EncodedCertificate == null) |
| | | 107 | | { |
| | 0 | 108 | | throw new ValidationException(ValidationRules.CannotBeNull, "Base64EncodedCertificate"); |
| | | 109 | | } |
| | 0 | 110 | | if (CertificatePolicy != null) |
| | | 111 | | { |
| | 0 | 112 | | CertificatePolicy.Validate(); |
| | | 113 | | } |
| | 0 | 114 | | } |
| | | 115 | | } |
| | | 116 | | } |