Exemple #1
0
        public string GetFileContent()
        {
            if (String.IsNullOrEmpty(_filePath) || !File.Exists(_filePath))
            {
                throw new FileNotFoundException();
            }

            var encryptionContext = EncryptionContext._getInstance();

            return(encryptionContext.Decrypt(File.ReadAllText(_filePath)));
        }
Exemple #2
0
 public void ProcessRequest(BaseApplicationMessage message, EncryptionContext ctx)
 {
     if (ctx == null)
     {
         app.ProcessRequest(message, this.ctx);
     }
     else
     {
         app.ProcessRequest(message, ctx);
     }
 }
        void IBuildTask.Run(BuildContext context)
        {
            var buildParameters      = context.GetContextObject <AssetBundleBuilder.BuildParametersContext>();
            var unityManifestContext = context.GetContextObject <TaskBuilding.UnityManifestContext>();

            var           encrypter   = CreateAssetEncrypter();
            List <string> encryptList = EncryptFiles(encrypter, unityManifestContext.Manifest, buildParameters);

            EncryptionContext encryptionContext = new EncryptionContext();

            encryptionContext.EncryptList = encryptList;
            context.SetContextObject(encryptionContext);
        }
Exemple #4
0
        public void SendTestMessage()
        {
            EncryptionContext ctx = new EncryptionContext();

            ctx.Encrypt  = true;
            ctx.Path     = ConfigurationManager.AppSettings["PrivateKeyPath"];
            ctx.Id       = ConfigurationManager.AppSettings["ApplicationId"];
            ctx.Password = ConfigurationManager.AppSettings["PrivateKeyPassword"];

            PingMessage pm = new PingMessage();

            pm.Status        = "Hello World";
            pm.ApplicationId = Guid.Parse(ConfigurationManager.AppSettings["ApplicationId"]);

            MessageHelper.SendMessageViaQueue(pm, ctx);
        }
        void IBuildTask.Run(BuildContext context)
        {
            var buildParameters = context.GetContextObject <AssetBundleBuilder.BuildParametersContext>();
            var buildMapContext = context.GetContextObject <BuildMapContext>();

            var buildMode = buildParameters.Parameters.BuildMode;

            if (buildMode == EBuildMode.ForceRebuild || buildMode == EBuildMode.IncrementalBuild)
            {
                EncryptionContext encryptionContext = new EncryptionContext();
                encryptionContext.EncryptList = EncryptFiles(buildParameters, buildMapContext);
                context.SetContextObject(encryptionContext);
            }
            else
            {
                EncryptionContext encryptionContext = new EncryptionContext();
                encryptionContext.EncryptList = new List <string>();
                context.SetContextObject(encryptionContext);
            }
        }
 /**
  * @brief Set up encryption context for encrypted server.
  *
  * The encryption context for the server must be set prior to
  * starting the server using StartServer().
  *
  * Minimal requirements for the encryption context is to set
  * certificate and private key.
  *
  * Look in @ref serversetup on how to generate the certificate and
  * private key file using OpenSSL.
  *
  * @param lpEncryptionContext The encryption context for the server,
  * i.e. server certificate, private key and optionally certificate
  * authority.
  *
  * @see SetEncryptionContextEx() */
 public bool SetEncryptionContext(EncryptionContext lpEncryptionContext)
 {
     return(TTProDLL.TTS_SetEncryptionContextEx(m_ttsInst, ref lpEncryptionContext));
 }