本文整理汇总了C#中EndpointConfiguration.RijndaelEncryptionService方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointConfiguration.RijndaelEncryptionService方法的具体用法?C# EndpointConfiguration.RijndaelEncryptionService怎么用?C# EndpointConfiguration.RijndaelEncryptionService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndpointConfiguration
的用法示例。
在下文中一共展示了EndpointConfiguration.RijndaelEncryptionService方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.Unobtrusive.Client";
var endpointConfiguration = new EndpointConfiguration("Samples.Unobtrusive.Client");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
endpointConfiguration.UseDataBus<FileShareDataBus>()
.BasePath(@"..\..\..\DataBusShare\");
byte[] encryptionKey = Encoding.ASCII.GetBytes("gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6");
endpointConfiguration.RijndaelEncryptionService("2015-10", encryptionKey);
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.ApplyCustomConventions();
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
try
{
await CommandSender.Start(endpointInstance)
.ConfigureAwait(false);
}
finally
{
await endpointInstance.Stop()
.ConfigureAwait(false);
}
}
示例2: Usage
Usage(EndpointConfiguration endpointConfiguration)
{
#region EncryptionServiceSimple
endpointConfiguration.RijndaelEncryptionService();
#endregion
}
示例3: Usage
public Usage()
{
#region EncryptionServiceSimple
EndpointConfiguration configuration = new EndpointConfiguration();
configuration.RijndaelEncryptionService();
#endregion
}
示例4: FromCode
FromCode(EndpointConfiguration endpointConfiguration)
{
#pragma warning disable 618
#region EncryptionFromCode
var encryptionKeyIdentifier = "2015-10";
var encryptionKey = Convert.FromBase64String("gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6");
var expiredKeys = new List<byte[]>
{
Encoding.ASCII.GetBytes("abDbqRpQdRbTs3mhdZh9qCaDaxJXl+e6"),
Encoding.ASCII.GetBytes("cdDbqRpQdRbTs3mhdZh9qCaDaxJXl+e6")
};
endpointConfiguration.RijndaelEncryptionService(encryptionKeyIdentifier, encryptionKey, expiredKeys);
#endregion
#pragma warning restore 618
}
示例5: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.Encryption.Endpoint1";
var endpointConfiguration = new EndpointConfiguration("Samples.Encryption.Endpoint1");
#region enableEncryption
endpointConfiguration.RijndaelEncryptionService();
#endregion
endpointConfiguration.UsePersistence<InMemoryPersistence>();
endpointConfiguration.UseSerialization<JsonSerializer>();
endpointConfiguration.SendFailedMessagesTo("error");
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
try
{
var message = new MessageWithSecretData
{
Secret = "betcha can't guess my secret",
SubProperty = new MySecretSubProperty
{
Secret = "My sub secret"
},
CreditCards = new List<CreditCardDetails>
{
new CreditCardDetails
{
ValidTo = DateTime.UtcNow.AddYears(1),
Number = "312312312312312"
},
new CreditCardDetails
{
ValidTo = DateTime.UtcNow.AddYears(2),
Number = "543645546546456"
}
}
};
await endpointInstance.Send("Samples.Encryption.Endpoint2", message)
.ConfigureAwait(false);
Console.WriteLine("MessageWithSecretData sent. Press any key to exit");
Console.ReadKey();
}
finally
{
await endpointInstance.Stop()
.ConfigureAwait(false);
}
}
示例6: FromCode
public FromCode()
{
#pragma warning disable 618
#region EncryptionFromCode
EndpointConfiguration configuration = new EndpointConfiguration();
string encryptionKey = "gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6";
List<string> expiredKeys = new List<string>
{
"abDbqRpQdRbTs3mhdZh9qCaDaxJXl+e6",
"cdDbqRpQdRbTs3mhdZh9qCaDaxJXl+e6"
};
configuration.RijndaelEncryptionService(encryptionKey, expiredKeys);
#endregion
#pragma warning restore 618
}
示例7: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.Encryption.Endpoint2";
EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.Encryption.Endpoint2");
endpointConfiguration.RijndaelEncryptionService();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
endpointConfiguration.UseSerialization<JsonSerializer>();
endpointConfiguration.SendFailedMessagesTo("error");
IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
try
{
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
finally
{
await endpoint.Stop();
}
}
示例8: AsyncMain
static async Task AsyncMain()
{
EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
endpointConfiguration.EndpointName("Samples.Unobtrusive.Client");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
endpointConfiguration.UseDataBus<FileShareDataBus>()
.BasePath(@"..\..\..\DataBusShare\");
endpointConfiguration.RijndaelEncryptionService("gdDbqRpqdRbTs3mhdZh8qCaDaxJXl+e7");
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.ApplyCustomConventions();
IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
try
{
await CommandSender.Start(endpoint);
}
finally
{
await endpoint.Stop();
}
}