Skip to content

Commit

Permalink
Remove unused Certificate properties
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBK committed Sep 14, 2023
1 parent 2abe9c0 commit 2e0a949
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/CommonLib/OutputTypes/Certificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ public class Certificate
public string[] Chain { get; set; } = Array.Empty<string>();
public bool HasBasicConstraints { get; set; } = false;
public int BasicConstraintPathLength { get; set; }
public Oid[] EnhancedKeyUsageOids { get; set; }

public CertificateExtension[] CertificateExtensions { get; set; }

public Certificate(byte[] rawCertificate)
{
Expand All @@ -40,30 +37,15 @@ public Certificate(byte[] rawCertificate)
foreach (X509Extension extension in extensions)
{
CertificateExtension certificateExtension = new CertificateExtension(extension);
certificateExtensions.Add(certificateExtension);

switch (certificateExtension.Oid.Value)
{
case CAExtensionTypes.BasicConstraints:
X509BasicConstraintsExtension ext = (X509BasicConstraintsExtension) extension;
HasBasicConstraints = ext.HasPathLengthConstraint;
BasicConstraintPathLength = ext.PathLengthConstraint;
break;

case CAExtensionTypes.EnhancedKeyUsage:
X509EnhancedKeyUsageExtension extEKU = (X509EnhancedKeyUsageExtension) extension;
List<Oid> enhancedKeyUsageOids = new List<Oid>();
foreach (var oid in extEKU.EnhancedKeyUsages){
enhancedKeyUsageOids.Add(new Oid(oid));
}
EnhancedKeyUsageOids = enhancedKeyUsageOids.ToArray();
break;

}
}

CertificateExtensions = certificateExtensions.ToArray();
}

}
}

0 comments on commit 2e0a949

Please sign in to comment.