Skip to content

Instantly share code, notes, and snippets.

View xtremertx's full-sized avatar
🔞
Github is happening. #FTW

Peter xtremertx

🔞
Github is happening. #FTW
View GitHub Profile
@xtremertx
xtremertx / SubjectAlternativeNames
Created January 28, 2022 14:23 — forked from dalion619/SubjectAlternativeNames
X509Certificate2 Subject Alternative Names Extension Method
public static List<string> GetSubjectAlternativeNames(this X509Certificate2 certificate)
{
foreach (X509Extension extension in certificate.Extensions)
{
// Create an AsnEncodedData object using the extensions information.
AsnEncodedData asndata = new AsnEncodedData(extension.Oid, extension.RawData);
if (string.Equals(extension.Oid.FriendlyName, "Subject Alternative Name"))
{
//Console.WriteLine("Extension type: {0}", extension.Oid.FriendlyName);
//Console.WriteLine("Oid value: {0}", asndata.Oid.Value);
@xtremertx
xtremertx / README.md
Created November 25, 2021 15:06 — forked from JaimeStill/README.md
ASP.NET Core Active Directory Integration

Active Directory Authentication

This will provide an example of integrating Active Directory authentication in an ASP.NET Core app.

Note, you'll need to be running on a Windows domain with Visual Studio debugging in IIS Express for this to work.

Setup

In launchSettings.json, you'll want to modify iisSettings by turning on windowsAuthentication:

@xtremertx
xtremertx / NativeMembers.cs
Last active November 18, 2021 09:10 — forked from mlaily/NativeMembers.cs
Find which process have a file opened using the Restart Manager API
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
// ReSharper disable InconsistentNaming
namespace RestartManager