Skip to content

Commit ea23dc4

Browse files
committed
Added path to OpenSSl binaries in app.config
1 parent c157868 commit ea23dc4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

JwtManagerTests/RsJwtTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class RsJwtTests
1414
private static string PrivateKey = string.Empty;
1515
private static string PublicKey = string.Empty;
1616
private static string KeySize = string.Empty;
17+
private static string OpenSslBinPath = string.Empty;
1718
private static string CurrentPath = string.Empty;
1819
#endregion
1920

@@ -22,10 +23,11 @@ public class RsJwtTests
2223
public static void ClassInit(TestContext context)
2324
{
2425
KeySize = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location).AppSettings.Settings["KeySize"].Value;
26+
OpenSslBinPath = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location).AppSettings.Settings["OpenSslBinPath"].Value;
2527

2628
CurrentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
27-
string commands = string.Format(@"C:\OpenSSL-Win32\bin\openssl genrsa -out private{0}.key {0}
28-
C:\OpenSSL-Win32\bin\openssl rsa -in private{0}.key -outform PEM -pubout -out public{0}.pem", KeySize);
29+
string commands = string.Format(@"{0}openssl genrsa -out private{1}.key {1}
30+
{0}openssl rsa -in private{1}.key -outform PEM -pubout -out public{1}.pem", OpenSslBinPath, KeySize);
2931

3032
File.WriteAllText(string.Format("{0}\\create.bat", CurrentPath), commands);
3133

JwtManagerTests/app.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<configuration>
33
<appSettings>
44
<add key="KeySize" value="4096"/>
5+
<add key="OpenSslBinPath" value="C:\OpenSSL-Win32\bin\"/>
56
</appSettings>
67
</configuration>

0 commit comments

Comments
 (0)