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