KS.Fiks.ASiC-E 1.0.2

Package Description

Install-Package KS.Fiks.ASiC-E -Version 1.0.2
dotnet add package KS.Fiks.ASiC-E --version 1.0.2
<PackageReference Include="KS.Fiks.ASiC-E" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KS.Fiks.ASiC-E --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KS.Fiks.ASiC-E, 1.0.2"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

MIT license
Nuget
GitHub issues

Library for working with ASiC-E packages in .Net Core based projects.
This project is created by KS and released under a MIT license.

For more information on how to use this library, check the unit test module. The long term goal of this project is
to be functionally compliant with the DIFI ASiC library for Java.

Currently implements:

  • building ASiC-E packages containing binaries containing CAdES descriptor
  • signing packages using private/public keys in PEM files
  • reading ASiC-E packages including exposing CAdES signatures (only CAdES manifest descriptor supported for now)

TODO:

  • support for specifying OASIS manifest
  • support XAdES signatures

Examples

Create ASiC-E package containing single file

using (var outStream = // create outstream)
using (var fileStream = // open FileStream )
{
    using (var asiceBuilder =
        AsiceBuilder.Create(outStream, MessageDigestAlgorithm.SHA256, signingCertificates))
    {
        asiceBuilder.AddFile(fileStream)

        var asiceArchive = asiceBuilder.Build();
        // archive is created, at this point the data will have been flushed to the outStream
    }
}

Read data from ASiC-E

IAsicReader reader = new AsiceReader();
using (var inputStream = // ASiC-E package to read)
using (var asice = reader.Read(inputStream))
{
    foreach (var asiceReadEntry in asice.Entries)
    {
        using (var entryStream = asiceReadEntry.OpenStream())
        using (var outStream = // stream to output the data to)
        {
            entryStream.CopyTo(bufferStream);
        }
    }

    // Check that all digests declared in the manifest are valid
    if(asice.DigestVerifier.Verification().AllValid) 
    {
        // Do something
    } 
    else
    {
        // Handle error
    }
}

MIT license
Nuget
GitHub issues

Library for working with ASiC-E packages in .Net Core based projects.
This project is created by KS and released under a MIT license.

For more information on how to use this library, check the unit test module. The long term goal of this project is
to be functionally compliant with the DIFI ASiC library for Java.

Currently implements:

  • building ASiC-E packages containing binaries containing CAdES descriptor
  • signing packages using private/public keys in PEM files
  • reading ASiC-E packages including exposing CAdES signatures (only CAdES manifest descriptor supported for now)

TODO:

  • support for specifying OASIS manifest
  • support XAdES signatures

Examples

Create ASiC-E package containing single file

using (var outStream = // create outstream)
using (var fileStream = // open FileStream )
{
    using (var asiceBuilder =
        AsiceBuilder.Create(outStream, MessageDigestAlgorithm.SHA256, signingCertificates))
    {
        asiceBuilder.AddFile(fileStream)

        var asiceArchive = asiceBuilder.Build();
        // archive is created, at this point the data will have been flushed to the outStream
    }
}

Read data from ASiC-E

IAsicReader reader = new AsiceReader();
using (var inputStream = // ASiC-E package to read)
using (var asice = reader.Read(inputStream))
{
    foreach (var asiceReadEntry in asice.Entries)
    {
        using (var entryStream = asiceReadEntry.OpenStream())
        using (var outStream = // stream to output the data to)
        {
            entryStream.CopyTo(bufferStream);
        }
    }

    // Check that all digests declared in the manifest are valid
    if(asice.DigestVerifier.Verification().AllValid) 
    {
        // Do something
    } 
    else
    {
        // Handle error
    }
}

NuGet packages (1)

Showing the top 1 NuGet packages that depend on KS.Fiks.ASiC-E:

Package Downloads
KS.Fiks.IO.Client
Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.2 539 5/5/2020
1.0.1 619 5/6/2019
1.0.0 217 4/30/2019
0.9.9 217 4/30/2019