Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 public AsiceReadEntry(ZipArchiveEntry zipArchiveEntry, MessageDigestAlgorithm digestAlgorithm, IDigestReceiver digestReceiver)
 {
     _zipArchiveEntry = zipArchiveEntry ?? throw new ArgumentNullException(nameof(zipArchiveEntry));
     _digestAlgorithm = digestAlgorithm ?? throw new ArgumentNullException(nameof(digestAlgorithm));
     _digestReceiver  = digestReceiver;
 }
Exemplo n.º 6
0
 public DigestContainer(byte[] digest, MessageDigestAlgorithm messageDigestAlgorithm)
 {
     _digest = digest ?? throw new ArgumentNullException(nameof(digest));
     _messageDigestAlgorithm = messageDigestAlgorithm ??
                               throw new ArgumentNullException(nameof(messageDigestAlgorithm));
 }