|
1 | | -using FlexServerSDK.Exception; |
2 | | -using FlexServerSDK.Model; |
| 1 | +using CyberSource.Utilities.Flex.Exception; |
| 2 | +using CyberSource.Utilities.Flex.Model; |
3 | 3 | using System; |
4 | 4 | using System.Collections.Generic; |
5 | 5 | using System.IO; |
6 | | -using System.Linq; |
7 | 6 | using System.Security.Cryptography; |
8 | 7 | using System.Text; |
9 | | -using System.Threading.Tasks; |
10 | 8 |
|
11 | 9 | namespace CyberSource.Utilities.Flex.TokenVerification |
12 | 10 | { |
13 | | - public static class TokenVerificationUtility |
| 11 | + public class TokenVerificationUtility |
14 | 12 | { |
15 | | - public static bool Verify(FlexPublicKey flexKey, IDictionary<string, string> postParameters) |
| 13 | + public bool Verify(FlexPublicKey flexKey, IDictionary<string, string> postParameters) |
16 | 14 | { |
17 | 15 | var publicKeyStr = flexKey.der.publicKey; |
18 | 16 | RSAParameters publicKey = DecodePublicKey(Convert.FromBase64String(publicKeyStr)).ExportParameters(false); |
@@ -52,11 +50,11 @@ private static bool ValidateTokenSignature(RSAParameters publicKey, string signe |
52 | 50 | } |
53 | 51 | catch (CryptographicException e) |
54 | 52 | { |
55 | | - throw new FlexSDKInternalException("Error validating signature", e); |
| 53 | + throw new FlexInternalException("Error validating signature", e); |
56 | 54 | } |
57 | 55 | catch (System.Exception e) |
58 | 56 | { |
59 | | - throw new FlexSDKInternalException("Error validating signature", e); |
| 57 | + throw new FlexInternalException("Error validating signature", e); |
60 | 58 | } |
61 | 59 | finally |
62 | 60 | { |
@@ -196,7 +194,7 @@ private static RSACryptoServiceProvider DecodePublicKey(byte[] x509key) |
196 | 194 | rsa.ImportParameters(rsaKeyInfo); |
197 | 195 | return rsa; |
198 | 196 | } |
199 | | - catch (Exception) |
| 197 | + catch (System.Exception) |
200 | 198 | { |
201 | 199 | return null; |
202 | 200 | } |
|
0 commit comments