< Summary

Class:Azure.Security.KeyVault.Keys.Cryptography.SignResult
Assembly:Azure.Security.KeyVault.Keys
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\Cryptography\SignResult.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:51
Line coverage:100% (11 of 11)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
get_KeyId()-100%100%
get_Signature()-100%100%
get_Algorithm()-100%100%
Azure.Security.KeyVault.IJsonDeserializable.ReadProperties(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\Cryptography\SignResult.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Text.Json;
 5
 6namespace Azure.Security.KeyVault.Keys.Cryptography
 7{
 8    /// <summary>
 9    /// Represents information about a sign operation.
 10    /// </summary>
 11    public class SignResult : IJsonDeserializable
 12    {
 13        private const string KeyIdPropertyName = "kid";
 14        private const string SignaturePropertyName = "value";
 15
 26016        internal SignResult()
 17        {
 26018        }
 19
 20        /// <summary>
 21        /// Gets the <see cref="KeyProperties.Id"/> of the <see cref="KeyVaultKey"/> used to sign. This must be stored a
 22        /// </summary>
 49423        public string KeyId { get; internal set; }
 24
 25        /// <summary>
 26        /// Gets the signature.
 27        /// </summary>
 72828        public byte[] Signature { get; internal set; }
 29
 30        /// <summary>
 31        /// Gets the algorithm used to sign. This must be stored alongside the <see cref="Signature"/> as the same algor
 32        /// </summary>
 49433        public SignatureAlgorithm Algorithm { get; internal set; }
 34
 35        void IJsonDeserializable.ReadProperties(JsonElement json)
 36        {
 132037            foreach (JsonProperty prop in json.EnumerateObject())
 38            {
 44039                switch (prop.Name)
 40                {
 41                    case KeyIdPropertyName:
 22042                        KeyId = prop.Value.GetString();
 22043                        break;
 44                    case SignaturePropertyName:
 22045                        Signature = Base64Url.Decode(prop.Value.GetString());
 46                        break;
 47                }
 48            }
 22049        }
 50    }
 51}