| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | using System.Text.Json; |
| | | 4 | | |
| | | 5 | | namespace Azure.Security.KeyVault.Keys |
| | | 6 | | { |
| | | 7 | | internal struct KeySignParameters : IJsonSerializable |
| | | 8 | | { |
| | 2 | 9 | | private static readonly JsonEncodedText s_algorithmPropertyNameBytes = JsonEncodedText.Encode("alg"); |
| | 2 | 10 | | private static readonly JsonEncodedText s_digestPropertyNameBytes = JsonEncodedText.Encode("value"); |
| | | 11 | | |
| | 660 | 12 | | public string Algorithm { get; set; } |
| | | 13 | | |
| | 660 | 14 | | public byte[] Digest { get; set; } |
| | | 15 | | |
| | | 16 | | void IJsonSerializable.WriteProperties(Utf8JsonWriter json) |
| | | 17 | | { |
| | 220 | 18 | | if (Algorithm != null) |
| | | 19 | | { |
| | 220 | 20 | | json.WriteString(s_algorithmPropertyNameBytes, Algorithm); |
| | | 21 | | } |
| | 220 | 22 | | if (Digest != null) |
| | | 23 | | { |
| | 220 | 24 | | json.WriteString(s_digestPropertyNameBytes, Base64Url.Encode(Digest)); |
| | | 25 | | } |
| | 220 | 26 | | } |
| | | 27 | | } |
| | | 28 | | } |