public void ItLoadsACertificateFromString()
        {
            MnoHelper.Environment = "production";
            string strCert = MnoHelper.Sso.X509Certificate;

            // Build certificate
            ASCIIEncoding ascii = new ASCIIEncoding();
            var bytCert = ascii.GetBytes(strCert);
            X509Certificate2 cert = new X509Certificate2(bytCert);

            // Create SAML x509 certificate from string
            Certificate samlCert = new Certificate();
            samlCert.LoadCertificate(strCert);

            Assert.IsTrue(cert.Equals(samlCert.cert));
        }
        /// <summary>
        /// Return the Certificate used by the Response object
        /// </summary>
        /// <returns></returns>
        public Certificate SamlCertificate()
        {
            if (certificate == null)
            {
                certificate = new Certificate();
                certificate.LoadCertificate(MnoHelper.With(presetName).Sso.SamlSettings().IdpCertificate);
            }

            return certificate;
        }
 /// <summary>
 /// Initialize a new Response
 /// </summary>
 /// <returns></returns>
 public Response New()
 {
     certificate = null;
     return this;
 }
Example #4
0
 /// <summary>
 /// Initialize a new Response
 /// </summary>
 /// <returns></returns>
 public Response New()
 {
     certificate = null;
     return(this);
 }