< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Create(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.Security.KeyVault.Keys.Cryptography
 5{
 6    internal static class LocalCryptographyProviderFactory
 7    {
 8        public static ICryptographyProvider Create(KeyVaultKey key)
 9        {
 20410            JsonWebKey keyMaterial = key?.Key;
 20411            if (keyMaterial != null)
 12            {
 20013                if (keyMaterial.KeyType == KeyType.Rsa || keyMaterial.KeyType == KeyType.RsaHsm)
 14                {
 9615                    return new RsaCryptographyProvider(key);
 16                }
 17
 10418                if (keyMaterial.KeyType == KeyType.Ec || keyMaterial.KeyType == KeyType.EcHsm)
 19                {
 4020                    return new EcCryptographyProvider(key);
 21                }
 22
 6423                if (keyMaterial.KeyType == KeyType.Oct)
 24                {
 1425                    return new AesCryptographyProvider(key);
 26                }
 27            }
 28
 5429            return null;
 30        }
 31    }
 32}

Methods/Properties

Create(...)