-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Security.Cryptography.X509Certificates; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
|
||
namespace QuickStart | ||
{ | ||
public class LocalMethods | ||
{ | ||
public async Task<object> GetAppDomainDirectory(dynamic input) | ||
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
Check warning on line 12 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
|
||
{ | ||
return AppDomain.CurrentDomain.BaseDirectory; | ||
} | ||
|
||
public async Task<object> GetCurrentTime(dynamic input) | ||
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
Check warning on line 17 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
|
||
{ | ||
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | ||
} | ||
|
||
public async Task<object> UseDynamicInput(dynamic input) | ||
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
Check warning on line 22 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
|
||
{ | ||
return $".NET Standard welcomes {input}"; | ||
} | ||
public async Task<object> ThrowException(dynamic input) | ||
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
Check warning on line 26 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
|
||
{ | ||
throw new Exception("Sample Exception"); | ||
} | ||
|
||
public async Task<object> ListCertificates(dynamic input) | ||
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (macos-latest)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (macos-14)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (ubuntu-latest)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
Check warning on line 31 in src/shared/LocalMethods.cs GitHub Actions / main (windows-latest)
|
||
{ | ||
X509Store store = new X509Store((string)input.storeName, (StoreLocation)Enum.Parse(typeof(StoreLocation), (string)input.storeLocation)); | ||
store.Open(OpenFlags.ReadOnly); | ||
try | ||
{ | ||
List<string> result = new List<string>(); | ||
foreach (X509Certificate2 certificate in store.Certificates) | ||
{ | ||
result.Add(certificate.Subject); | ||
} | ||
|
||
return result; | ||
} | ||
finally | ||
{ | ||
store.Close(); | ||
} | ||
} | ||
} | ||
} |