< Summary

Class:Azure.Security.KeyVault.Keys.Cryptography.VerifyResult
Assembly:Azure.Security.KeyVault.Keys
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\Cryptography\VerifyResult.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_IsValid()-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\VerifyResult.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 verify operation.
 10    /// </summary>
 11    public class VerifyResult : IJsonDeserializable
 12    {
 13        private const string KeyIdPropertyName = "kid";
 14        private const string ValidPropertyName = "value";
 15
 25016        internal VerifyResult()
 17        {
 25018        }
 19
 20        /// <summary>
 21        /// Gets the <see cref="KeyProperties.Id"/> of the <see cref="KeyVaultKey"/> used to verify.
 22        /// </summary>
 50023        public string KeyId { get; internal set; }
 24
 25        /// <summary>
 26        /// Gets a value indicating whether the specified signature is valid.
 27        /// </summary>
 48428        public bool IsValid { get; internal set; }
 29
 30        /// <summary>
 31        /// Gets the <see cref="SignatureAlgorithm"/>.
 32        /// </summary>
 48433        public SignatureAlgorithm Algorithm { get; internal set; }
 34
 35        void IJsonDeserializable.ReadProperties(JsonElement json)
 36        {
 88037            foreach (JsonProperty prop in json.EnumerateObject())
 38            {
 22839                switch (prop.Name)
 40                {
 41                    case KeyIdPropertyName:
 1642                        KeyId = prop.Value.GetString();
 1643                        break;
 44                    case ValidPropertyName:
 21245                        IsValid = prop.Value.GetBoolean();
 46                        break;
 47                }
 48            }
 21249        }
 50    }
 51}