< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Protocols.WSTrust.ProtectedKey
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/WSTrust/ProtectedKey.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 58
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
.ctor(...)100%110%
GetKeyBytes()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/WSTrust/ProtectedKey.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using CoreWCF.IdentityModel.Tokens;
 5
 6namespace CoreWCF.IdentityModel.Protocols.WSTrust
 7{
 8
 9    /// <summary>
 10    /// This class are used in defining Entropy and RequestProofToken element inside the
 11    /// RequestSecurityToken and RequestSecurityTokenResponse.
 12    /// </summary>
 13    public class ProtectedKey
 14    {
 15        byte[] _secret;
 16        EncryptingCredentials _wrappingCredentials;
 17
 18        /// <summary>
 19        /// Use this constructor if we want to send the key material in clear text.
 20        /// </summary>
 21        /// <param name="secret">The key material that needs to be protected.</param>
 022        public ProtectedKey(byte[] secret)
 23        {
 024            _secret = secret;
 025        }
 26
 27        /// <summary>
 28        /// Use this constructor if we want to send the key material encrypted.
 29        /// </summary>
 30        /// <param name="secret">The key material that needs to be protected.</param>
 31        /// <param name="wrappingCredentials">The encrypting credentials used to encrypt the key material.</param>
 032        public ProtectedKey(byte[] secret, EncryptingCredentials wrappingCredentials)
 33        {
 034            _secret = secret;
 035            _wrappingCredentials = wrappingCredentials;
 036        }
 37
 38        /// <summary>
 39        /// Gets the key material.
 40        /// </summary>
 41        public byte[] GetKeyBytes()
 42        {
 043            return _secret;
 44        }
 45
 46        /// <summary>
 47        /// Gets the encrypting credentials. Null means that the keys are not encrypted.
 48        /// </summary>
 49        public EncryptingCredentials WrappingCredentials
 50        {
 51            get
 52            {
 053                return _wrappingCredentials;
 54            }
 55        }
 56    }
 57}
 58