Skip to content

Commit f5d762f

Browse files
committed
deleted dll files
1 parent a171bc4 commit f5d762f

File tree

12 files changed

+28
-10940
lines changed

12 files changed

+28
-10940
lines changed

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Autosave files
22
*~
33

4-
# build
5-
[Oo]bj/
6-
[Bb]in/
7-
packages/
8-
TestResults/
4+
95

106
# globs
117
Makefile.in

.vs/ApiSecuritySolution/xs/UserPrefs.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Properties StartupConfiguration="{B6FD94F7-1689-4DAC-B823-0192E3CA3521}|Unit Tests">
2-
<MonoDevelop.Ide.Workbench ActiveDocument="development Status">
2+
<MonoDevelop.Ide.Workbench ActiveDocument="ApiUtilLib/ApiAuthorization.cs">
33
<Files>
4-
<File FileName="ApiUtilLibTest/TestDataTest.cs" Line="19" Column="32" />
4+
<File FileName="ApiUtilLibTest/TestDataTest.cs" Line="287" Column="1" />
55
<File FileName="ApiUtilLibTest/L1SignatureTest.cs" Line="23" Column="72" />
6-
<File FileName="ApiUtilLib/ApiAuthorization.cs" Line="159" Column="1" />
6+
<File FileName="ApiUtilLib/ApiAuthorization.cs" Line="120" Column="13" />
77
<File FileName="ApiUtilLibTest/CommonExtensions.cs" Line="121" Column="26" />
88
<File FileName="ApiUtilLibTest/BaseService.cs" Line="122" Column="1" />
99
<File FileName="ApiUtilLibTest/L2SignatureTest.cs" Line="37" Column="74" />
@@ -13,11 +13,10 @@
1313
<Pad Id="ProjectPad">
1414
<State name="__root__">
1515
<Node name="ApiSecuritySolution" expanded="True">
16-
<Node name="Solution Items" expanded="True" />
17-
<Node name="ApiUtilLib" expanded="True" />
18-
<Node name="ApiUtilLibTest" expanded="True">
19-
<Node name="TestDataTest.cs" selected="True" />
16+
<Node name="ApiUtilLib" expanded="True">
17+
<Node name="ApiAuthorization.cs" selected="True" />
2018
</Node>
19+
<Node name="ApiUtilLibTest" expanded="True" />
2120
</Node>
2221
</State>
2322
</Pad>
@@ -26,7 +25,9 @@
2625
<Node name="ApiSecuritySolution" expanded="True">
2726
<Node name="ApiUtilLibTest" expanded="True">
2827
<Node name="ApexUtilLibTest" expanded="True">
29-
<Node name="TestDataTest" expanded="True" selected="True" />
28+
<Node name="TestDataTest" expanded="True">
29+
<Node name="GetL2Signature" selected="True" />
30+
</Node>
3031
</Node>
3132
</Node>
3233
</Node>
@@ -38,8 +39,10 @@
3839
<MonoDevelop.Ide.DebuggingService.Breakpoints>
3940
<BreakpointStore>
4041
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLib/ApiAuthorization.cs" relfile="ApiUtilLib/ApiAuthorization.cs" line="196" column="1" />
41-
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLib/ApiAuthorization.cs" relfile="ApiUtilLib/ApiAuthorization.cs" line="180" column="1" />
42-
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLib/ApiAuthorization.cs" relfile="ApiUtilLib/ApiAuthorization.cs" line="137" column="1" />
42+
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLib/ApiAuthorization.cs" relfile="ApiUtilLib/ApiAuthorization.cs" line="179" column="1" />
43+
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLibTest/TestDataTest.cs" relfile="ApiUtilLibTest/TestDataTest.cs" line="241" column="1" />
44+
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLibTest/TestDataTest.cs" relfile="ApiUtilLibTest/TestDataTest.cs" line="281" column="1" />
45+
<Breakpoint file="/Users/nsearch/OneDrive/Projects/APEXCSharp/development/ApiUtilLibTest/TestDataTest.cs" relfile="ApiUtilLibTest/TestDataTest.cs" line="285" column="1" />
4346
</BreakpointStore>
4447
</MonoDevelop.Ide.DebuggingService.Breakpoints>
4548
<MonoDevelop.Ide.DebuggingService.PinnedWatches />

ApiUtilLib/ApiAuthorization.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ public static RSACryptoServiceProvider PrivateKeyFromP12(string certificateFileN
118118

119119
var OriginalPrivateKey = (RSACryptoServiceProvider)privateCert.PrivateKey;
120120

121-
// Transfer the private key to overcome the following error...
122-
// System.Security.Cryptography.CryptographicException "Invalid algorithm specified"
123121
if (Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix)
124122
{
125123
return OriginalPrivateKey;
@@ -144,7 +142,8 @@ public static string GetL2SignatureFromPEM(string filename, string message, stri
144142
AsymmetricCipherKeyPair keyPair;
145143
var obj = GetRSAProviderFromPem(File.ReadAllText(filename).Trim(), passPhrase);
146144
byte[] bytes = Encoding.UTF8.GetBytes(message);
147-
using (var reader = File.OpenText(filename)) // file containing RSA PKCS1 private key
145+
146+
using (var reader = File.OpenText(filename))
148147
keyPair = (AsymmetricCipherKeyPair)new PemReader(reader, new PasswordFinder(passPhrase)).ReadObject();
149148
var decryptEngine = new Pkcs1Encoding(new RsaEngine());
150149

@@ -167,7 +166,7 @@ public static RSACryptoServiceProvider ImportPrivateKey(string pem)
167166
AsymmetricCipherKeyPair KeyPair = (AsymmetricCipherKeyPair)pr.ReadObject();
168167
RSAParameters rsaParams = DotNetUtilities.ToRSAParameters((RsaPrivateCrtKeyParameters)KeyPair.Private);
169168

170-
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();// cspParams);
169+
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
171170
csp.ImportParameters(rsaParams);
172171
return csp;
173172
}
@@ -183,7 +182,8 @@ public static X509Certificate2 LoadCertificateFile(string filename, string passP
183182
AsymmetricCipherKeyPair keyPair;
184183
var obj = GetRSAProviderFromPem(File.ReadAllText(filename).Trim(), passPhrase);
185184
byte[] bytes = Encoding.UTF8.GetBytes("message");
186-
using (var reader = File.OpenText(filename)) // file containing RSA PKCS1 private key
185+
186+
using (var reader = File.OpenText(filename))
187187
keyPair = (AsymmetricCipherKeyPair)new PemReader(reader, new PasswordFinder(passPhrase)).ReadObject();
188188
var decryptEngine = new Pkcs1Encoding(new RsaEngine());
189189

@@ -197,7 +197,7 @@ public static X509Certificate2 LoadCertificateFile(string filename, string passP
197197
}
198198
catch (Exception ex)
199199
{
200-
//throw ex;
200+
throw ex;
201201
}
202202
return x509;
203203
}
@@ -236,8 +236,7 @@ public static RSACryptoServiceProvider GetRSAProviderFromPem(String pemstr, stri
236236
return MakePublicRCSP(rsaKey, (RsaKeyParameters)kp);
237237
}
238238

239-
// If object has Private/Public property, we have a Private PEM
240-
//return (kp.GetType().GetProperty("Private") != null) ? MakePrivateRCSP(rsaKey, (RsaPrivateCrtKeyParameters)(((AsymmetricCipherKeyPair)kp).Private)) : MakePublicRCSP(rsaKey, (RsaKeyParameters)kp);
239+
241240
}
242241

243242

ApiUtilLib/ApiUtilLib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
3434
</Reference>
3535
<Reference Include="BouncyCastle.Crypto">
36-
<HintPath>..\..\..\..\..\Downloads\BouncyCastle.Crypto.dll</HintPath>
36+
<HintPath>..\packages\BouncyCastle.1.8.3\lib\BouncyCastle.Crypto.dll</HintPath>
3737
</Reference>
3838
</ItemGroup>
3939
<ItemGroup>
-22.5 KB
Binary file not shown.
-8.75 KB
Binary file not shown.
-2.34 MB
Binary file not shown.
-647 KB
Binary file not shown.

0 commit comments

Comments
 (0)