< Summary

Class:Azure.Security.KeyVault.Keys.Cryptography.KeyEncryptParameters
Assembly:Azure.Security.KeyVault.Keys
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\Cryptography\KeyEncryptParameters.cs
Covered lines:15
Uncovered lines:6
Coverable lines:21
Total lines:49
Line coverage:71.4% (15 of 21)
Covered branches:7
Total branches:10
Branch coverage:70% (7 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-100%100%
get_Algorithm()-100%100%
get_Value()-100%100%
get_Iv()-0%100%
get_AuthenticationData()-0%100%
get_AuthenticationTag()-0%100%
Azure.Security.KeyVault.IJsonSerializable.WriteProperties(...)-72.73%70%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3using System.Text.Json;
 4
 5namespace Azure.Security.KeyVault.Keys.Cryptography
 6{
 7    internal struct KeyEncryptParameters : IJsonSerializable
 8    {
 29        private static readonly JsonEncodedText s_algorithmPropertyNameBytes = JsonEncodedText.Encode("alg");
 210        private static readonly JsonEncodedText s_valuePropertyNameBytes = JsonEncodedText.Encode("value");
 211        private static readonly JsonEncodedText s_ivPropertyNameBytes = JsonEncodedText.Encode("iv");
 212        private static readonly JsonEncodedText s_authenticationDataPropertyNameBytes = JsonEncodedText.Encode("aad");
 213        private static readonly JsonEncodedText s_authenticationTagPropertyNameBytes = JsonEncodedText.Encode("tag");
 14
 15615        public string Algorithm { get; set; }
 16
 15617        public byte[] Value { get; set; }
 18
 019        public byte[] Iv { get; set; }
 20
 021        public byte[] AuthenticationData { get; set; }
 22
 023        public byte[] AuthenticationTag { get; set; }
 24
 25        void IJsonSerializable.WriteProperties(Utf8JsonWriter json)
 26        {
 5227            if (Algorithm != null)
 28            {
 5229                json.WriteString(s_algorithmPropertyNameBytes, Algorithm);
 30            }
 5231            if (Value != null)
 32            {
 5233                json.WriteString(s_valuePropertyNameBytes, Base64Url.Encode(Value));
 34            }
 5235            if (Iv != null)
 36            {
 037                json.WriteString(s_ivPropertyNameBytes, Base64Url.Encode(Iv));
 38            }
 5239            if (AuthenticationData != null)
 40            {
 041                json.WriteString(s_authenticationDataPropertyNameBytes, Base64Url.Encode(AuthenticationData));
 42            }
 5243            if (AuthenticationTag != null)
 44            {
 045                json.WriteString(s_authenticationTagPropertyNameBytes, Base64Url.Encode(AuthenticationTag));
 46            }
 5247        }
 48    }
 49}