Exemple #1
0
        /// <summary>
        ///     Initializes a new instance of <strong>SignedCmsBuilder</strong> from existing Signed CMS. Data from existing CMS
        ///     is copied to builder and can be modified.
        /// </summary>
        /// <param name="cms">Existing Signed CMS message.</param>
        /// <exception cref="ArgumentNullException">
        ///     <srong>cms</srong> parameter is null.
        /// </exception>
        public SignedCmsBuilder(DefaultSignedPkcs7 cms)
        {
            if (cms == null)
            {
                throw new ArgumentNullException(nameof(cms));
            }

            _contentType = cms.ContentType;
            _content     = cms.Content;
            DigestAlgorithms.AddRange(cms.DigestAlgorithms);
            Certificates.AddRange(cms.Certificates);
            RevocationLists.AddRange(cms.RevocationLists);
            SignerInfos.AddRange(cms.SignerInfos);
        }