Skip to content

Commit

Permalink
v1.0.4-beta
Browse files Browse the repository at this point in the history
Made EncryptedKey utility backward compatible.
  • Loading branch information
vmelamed committed Nov 30, 2015
1 parent 43ce4d3 commit 1a269ca
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions Aspects/Security/Cryptography/Ciphers/EncryptedKey/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ static int Main(string[] args)
if (ParseArguments(args) && GetCertificate())
switch (_command)
{
case CreateCommand:
_exitCode = Create();
break;

case ExportCommand:
_exitCode = Export();
break;

case ImportCommand:
_exitCode = Import();
break;

case null:
case HelpCommand:
_exitCode = Usage();
break;
case CreateCommand:
_exitCode = Create();
break;

case ExportCommand:
_exitCode = Export();
break;

case ImportCommand:
_exitCode = Import();
break;

case null:
case HelpCommand:
_exitCode = Usage();
break;
}
else
Usage(1);
Expand Down Expand Up @@ -237,7 +237,8 @@ static string GetHexValue(string argument)

static bool GetCertificate()
{
using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
try
{
store.Open(OpenFlags.ReadOnly);

Expand All @@ -252,6 +253,10 @@ static bool GetCertificate()

return _cert != null;
}
finally
{
store.Close();
}
}

static IKeyStorage GetKeyStorage()
Expand Down

0 comments on commit 1a269ca

Please sign in to comment.