< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Tokens.EncryptedKeyIdentifierClause
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/EncryptedKeyIdentifierClause.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 22
Coverable lines: 22
Total lines: 67
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
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%
.ctor(...)100%110%
.ctor(...)100%110%
.ctor(...)0%220%
Matches(...)0%440%
Matches(...)0%440%
GetEncryptedKey()100%110%
ToString()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/EncryptedKeyIdentifierClause.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 System;
 5using System.Globalization;
 6
 7namespace CoreWCF.IdentityModel.Tokens
 8{
 9    public sealed class EncryptedKeyIdentifierClause : BinaryKeyIdentifierClause
 10    {
 11        public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod)
 012            : this(encryptedKey, encryptionMethod, null)
 13        {
 014        }
 15
 16        public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encrypti
 017            : this(encryptedKey, encryptionMethod, encryptingKeyIdentifier, null)
 18        {
 019        }
 20
 21        public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encrypti
 022            : this(encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName, true, null, 0)
 23        {
 024        }
 25
 26        public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encrypti
 027            : this(encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName, true, derivationNonce, deriv
 28        {
 029        }
 30
 31        internal EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encryp
 032            : base("http://www.w3.org/2001/04/xmlenc#EncryptedKey", encryptedKey, cloneBuffer, derivationNonce, derivati
 33        {
 034            CarriedKeyName = carriedKeyName;
 035            EncryptionMethod = encryptionMethod ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(name
 036            EncryptingKeyIdentifier = encryptingKeyIdentifier;
 037        }
 38
 039        public string CarriedKeyName { get; }
 40
 041        public SecurityKeyIdentifier EncryptingKeyIdentifier { get; }
 42
 043        public string EncryptionMethod { get; }
 44
 45        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
 46        {
 047            EncryptedKeyIdentifierClause that = keyIdentifierClause as EncryptedKeyIdentifierClause;
 048            return ReferenceEquals(this, that) || (that != null && that.Matches(GetRawBuffer(), EncryptionMethod, Carrie
 49        }
 50
 51        public bool Matches(byte[] encryptedKey, string encryptionMethod, string carriedKeyName)
 52        {
 053            return Matches(encryptedKey) && EncryptionMethod == encryptionMethod && CarriedKeyName == carriedKeyName;
 54        }
 55
 56        public byte[] GetEncryptedKey()
 57        {
 058            return GetBuffer();
 59        }
 60
 61        public override string ToString()
 62        {
 063            return string.Format(CultureInfo.InvariantCulture, "EncryptedKeyIdentifierClause(EncryptedKey = {0}, Method 
 064                Convert.ToBase64String(GetRawBuffer()), EncryptionMethod);
 65        }
 66    }
 67}