public ViewModelProtectionHelper(DotvvmSecurityConfiguration config, JsonSerializer serializer = null)
 {
     if (config.EncryptionKey == null)
     {
         config.EncryptionKey = GenerateRandomKey(32);
     }
     if (config.SigningKey == null)
     {
         config.SigningKey = GenerateRandomKey(128);
     }
     this.EncryptionKey = config.EncryptionKey;
     this.MacKey        = config.SigningKey;
     this.Serializer    = serializer ?? new JsonSerializer();
 }
 public ApplicationKeyHelper(DotvvmSecurityConfiguration config)
 {
     this.config = config;
 }