Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs')
-rwxr-xr-xmcs/class/Mono.Security/Mono.Security.X509/X509Store.cs31
1 files changed, 9 insertions, 22 deletions
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs b/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
index aa27a4a7dfd..81db71b5c75 100755
--- a/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
+++ b/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
@@ -4,7 +4,9 @@
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com)
+//
+
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -104,7 +106,9 @@ namespace Mono.Security.X509 {
public void Import (X509Certificate certificate)
{
- CheckStore (_storePath, true);
+ if (!Directory.Exists (_storePath)) {
+ Directory.CreateDirectory (_storePath);
+ }
string filename = Path.Combine (_storePath, GetUniqueName (certificate));
if (!File.Exists (filename)) {
@@ -179,28 +183,14 @@ namespace Mono.Security.X509 {
return crl;
}
- private bool CheckStore (string path, bool throwException)
+ private X509CertificateCollection BuildCertificatesCollection (string storeName)
{
- try {
- if (Directory.Exists (path))
- return true;
+ string path = Path.Combine (_storePath, storeName);
+ if (!Directory.Exists (path)) {
Directory.CreateDirectory (path);
- return Directory.Exists (path);
- }
- catch {
- if (throwException)
- throw;
- return false;
}
- }
- private X509CertificateCollection BuildCertificatesCollection (string storeName)
- {
X509CertificateCollection coll = new X509CertificateCollection ();
- string path = Path.Combine (_storePath, storeName);
- if (!CheckStore (path, false))
- return coll; // empty collection
-
string[] files = Directory.GetFiles (path, "*.cer");
if ((files != null) && (files.Length > 0)) {
foreach (string file in files) {
@@ -223,9 +213,6 @@ namespace Mono.Security.X509 {
{
ArrayList list = new ArrayList ();
string path = Path.Combine (_storePath, storeName);
- if (!CheckStore (path, false))
- return list; // empty list
-
string[] files = Directory.GetFiles (path, "*.crl");
if ((files != null) && (files.Length > 0)) {
foreach (string file in files) {