stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.Text;
|
||||
|
||||
namespace StellaOps.AuditPack.Services;
|
||||
|
||||
public sealed partial class AirGapTrustStoreIntegration
|
||||
{
|
||||
private static string DetectAlgorithm(byte[] keyBytes)
|
||||
{
|
||||
var pem = Encoding.UTF8.GetString(keyBytes);
|
||||
if (pem.Contains("EC PRIVATE KEY") || pem.Contains("EC PUBLIC KEY"))
|
||||
{
|
||||
return "ES256";
|
||||
}
|
||||
|
||||
if (pem.Contains("RSA PRIVATE KEY") || pem.Contains("RSA PUBLIC KEY"))
|
||||
{
|
||||
return "RS256";
|
||||
}
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user