aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs48
1 files changed, 40 insertions, 8 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs b/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs
index 55db289..0f4e8ac 100644
--- a/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs
@@ -44,9 +44,37 @@ namespace OpenSim.Framework.Communications.Cache
44{ 44{
45 public class CryptoGridAssetClient : AssetServerBase 45 public class CryptoGridAssetClient : AssetServerBase
46 { 46 {
47
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49
50 private string _assetServerUrl;
51 private bool m_encryptOnUpload;
52 private RjinKeyfile m_encryptKey;
53 private readonly Dictionary<string,RjinKeyfile> m_keyfiles = new Dictionary<string, RjinKeyfile>();
54
55 #region IPlugin
56
57 public override string Name
58 {
59 get { return "Crypto"; }
60 }
61
62 public override string Version
63 {
64 get { return "1.0"; }
65 }
66
67 public override void Initialise(ConfigSettings p_set, string p_url, string p_dir, bool p_t)
68 {
69 m_log.Debug("[CRYPTOGRID] Plugin configured initialisation");
70 Initialise(p_url, p_dir, p_t);
71 }
72
73 #endregion
74
47 #region Keyfile Classes 75 #region Keyfile Classes
48 [Serializable] 76 [Serializable]
49 private class RjinKeyfile 77 public class RjinKeyfile
50 { 78 {
51 public string Secret; 79 public string Secret;
52 public string AlsoKnownAs; 80 public string AlsoKnownAs;
@@ -94,7 +122,7 @@ namespace OpenSim.Framework.Communications.Cache
94 /// this may not be the most efficient way of handling encryption, so - as 122 /// this may not be the most efficient way of handling encryption, so - as
95 /// soon as you feel comfortable with it - you may want to redesign this class. 123 /// soon as you feel comfortable with it - you may want to redesign this class.
96 /// </summary> 124 /// </summary>
97 private class UtilRijndael 125 public class UtilRijndael
98 { 126 {
99 /// <summary> 127 /// <summary>
100 /// Encrypts specified plaintext using Rijndael symmetric key algorithm 128 /// Encrypts specified plaintext using Rijndael symmetric key algorithm
@@ -332,15 +360,19 @@ namespace OpenSim.Framework.Communications.Cache
332 } 360 }
333 #endregion 361 #endregion
334 362
335 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 363 public CryptoGridAssetClient() {}
336
337 private readonly string _assetServerUrl;
338 private readonly bool m_encryptOnUpload;
339 private readonly RjinKeyfile m_encryptKey;
340 private readonly Dictionary<string,RjinKeyfile> m_keyfiles = new Dictionary<string, RjinKeyfile>();
341 364
342 public CryptoGridAssetClient(string serverUrl, string keydir, bool decOnly) 365 public CryptoGridAssetClient(string serverUrl, string keydir, bool decOnly)
343 { 366 {
367 m_log.Debug("[CRYPTOGRID] Direct constructor");
368 Initialise(serverUrl, keydir, decOnly);
369 }
370
371 public void Initialise(string serverUrl, string keydir, bool decOnly)
372 {
373
374 m_log.Debug("[CRYPTOGRID] Common constructor");
375
344 _assetServerUrl = serverUrl; 376 _assetServerUrl = serverUrl;
345 377
346 string[] keys = Directory.GetFiles(keydir, "*.deckey"); 378 string[] keys = Directory.GetFiles(keydir, "*.deckey");