/
KeyVaultCertificateWithPolicy.cs
39 lines (33 loc) · 1.15 KB
/
KeyVaultCertificateWithPolicy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Text.Json;
namespace Azure.Security.KeyVault.Certificates
{
/// <summary>
/// A <see cref="KeyVaultCertificate"/> along with its <see cref="CertificatePolicy"/>.
/// </summary>
public class KeyVaultCertificateWithPolicy : KeyVaultCertificate
{
private const string PolicyPropertyName = "policy";
internal KeyVaultCertificateWithPolicy(CertificateProperties properties = null) : base(properties)
{
}
/// <summary>
/// Gets the current policy for the certificate.
/// </summary>
public CertificatePolicy Policy { get; internal set; }
internal override void ReadProperty(JsonProperty prop)
{
switch (prop.Name)
{
case PolicyPropertyName:
Policy = new CertificatePolicy();
((IJsonDeserializable)Policy).ReadProperties(prop.Value);
break;
default:
base.ReadProperty(prop);
break;
}
}
}
}