Skip to content

Commit

Permalink
# - documentation of embedded pseudo cert property
Browse files Browse the repository at this point in the history
  • Loading branch information
dlatikay committed Nov 22, 2023
1 parent 9dd66ac commit e937927
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Lc.Linca.Sdk.Sample/Resources/ResourceProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace Lc.Linca.Sdk.Sample.Resources;

internal class ResourceProxy
{
/// <summary>
/// Returns #1 of the actor: care pseudocertificates for development and test purposes,
/// as a byte array - to show by example, how a client certificate that is loaded from
/// a database could be passed to the SDK's Connect() function
/// (This certificate will not work in a staging or production environment)
/// </summary>
#pragma warning disable IDE1006 // Naming Styles
internal static byte[] linca_pflegeeinrichtung_001_dev
#pragma warning restore IDE1006 // Naming Styles
Expand All @@ -14,12 +20,10 @@ internal static byte[] linca_pflegeeinrichtung_001_dev
{
using var certBytes = new MemoryStream();

Assembly.GetExecutingAssembly()!.GetManifestResourceStream(typeof(ResourceProxy), $"{nameof(linca_pflegeeinrichtung_001_dev)}.pfx")!.CopyTo(certBytes);

if(certBytes.CanSeek)
{
certBytes.Seek(0, SeekOrigin.Begin);
}
Assembly
.GetExecutingAssembly()!
.GetManifestResourceStream(typeof(ResourceProxy), $"{nameof(linca_pflegeeinrichtung_001_dev)}.pfx")!
.CopyTo(certBytes);

return certBytes.ToArray();
}
Expand Down

0 comments on commit e937927

Please sign in to comment.