public AsiceArchive(ZipArchive archive, IManifestCreator creator, MessageDigestAlgorithm messageDigestAlgorithm, ICertificateHolder signatureCertificate)
 {
     Archive                = archive ?? throw new ArgumentNullException(nameof(archive));
     manifestCreator        = creator ?? throw new ArgumentNullException(nameof(creator));
     MessageDigestAlgorithm = messageDigestAlgorithm ?? throw new ArgumentNullException(nameof(messageDigestAlgorithm));
     SignatureCertificate   = signatureCertificate;
 }
 public AsicePackageEntry(string fileName, MimeType type, MessageDigestAlgorithm messageDigestAlgorithm)
 {
     FileName = fileName ?? throw new ArgumentNullException(nameof(fileName));
     Type     = type ?? throw new ArgumentNullException(nameof(type));
     MessageDigestAlgorithm = messageDigestAlgorithm ??
                              throw new ArgumentNullException(nameof(messageDigestAlgorithm));
 }
Beispiel #3
0
 public DeclaredDigestFile(
     byte[] digest,
     MessageDigestAlgorithm messageDigestAlgorithm,
     string fileName,
     MimeType mimeType)
 {
     _digest = digest ?? throw new ArgumentNullException(nameof(digest));
     MessageDigestAlgorithm = messageDigestAlgorithm ??
                              throw new ArgumentNullException(nameof(messageDigestAlgorithm));
     Name     = fileName ?? throw new ArgumentNullException(nameof(fileName));
     MimeType = mimeType ?? throw new ArgumentNullException(nameof(mimeType));
 }
 public CadesManifest(ASiCManifestType asiCManifestType) : base(ManifestSpec.Cades)
 {
     _asiCManifestType = asiCManifestType ?? throw new ArgumentNullException(nameof(asiCManifestType));
     Digests           = _asiCManifestType?.DataObjectReference?
                         .ToImmutableDictionary(
         d => d.URI,
         d => new DeclaredDigestFile(
             d.DigestValue,
             MessageDigestAlgorithm.FromUri(new Uri(d.DigestMethod.Algorithm)),
             d.URI,
             MimeType.ForString(d.MimeType)));
     RootFile = asiCManifestType.DataObjectReference?.Where(d => d.Rootfile).Select(d => d.URI).FirstOrDefault();
 }
 public AsiceReadEntry(ZipArchiveEntry zipArchiveEntry, MessageDigestAlgorithm digestAlgorithm, IDigestReceiver digestReceiver)
 {
     _zipArchiveEntry = zipArchiveEntry ?? throw new ArgumentNullException(nameof(zipArchiveEntry));
     _digestAlgorithm = digestAlgorithm ?? throw new ArgumentNullException(nameof(digestAlgorithm));
     _digestReceiver  = digestReceiver;
 }
Beispiel #6
0
 public DigestContainer(byte[] digest, MessageDigestAlgorithm messageDigestAlgorithm)
 {
     _digest = digest ?? throw new ArgumentNullException(nameof(digest));
     _messageDigestAlgorithm = messageDigestAlgorithm ??
                               throw new ArgumentNullException(nameof(messageDigestAlgorithm));
 }