Example #1
0
        private CmsSignedData pk7()
        {
            ArrayList certList = new ArrayList();

            if (cbPath.Checked)
            {
                certList.Add(caInfo.Certificate);
                certList.Add(cert);
            }
            else
            {
                certList.Add(cert);
            }

            // If CRL is required
            if (cbCRL.Checked)
            {
                ArrayList crlList = new ArrayList();
                crlList.Add(caInfo.GetCRL());
                return(Pkcs7.Create(certList, crlList));
            }
            else
            {
                return(Pkcs7.Create(certList, null));
            }
        }
Example #2
0
        public void Challenge9_Solution()
        {
            var padded = Pkcs7.Pad(Encoding.UTF8.GetBytes(_input), 20);

            Assert.AreEqual(_expectedOutput, Encoding.UTF8.GetString(padded));
        }