Example #1
0
        public CT_CertificateKeyEncryptor AddNewEncryptedCertificateKey()
        {
            CT_CertificateKeyEncryptor t = new CT_CertificateKeyEncryptor();

            this.itemField = t;
            return(t);
        }
Example #2
0
        public static CT_KeyEncryptor Parse(XmlNode node, XmlNamespaceManager nameSpaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_KeyEncryptor ctObj = new CT_KeyEncryptor();

            if (node.Attributes["uri"] != null)
            {
                ctObj.uriFieldSpecified = true;
                ctObj.uriField          = XmlHelper.GetEnumValueFromString <CT_KeyEncryptorUri>(node.Attributes["uri"].Value);
            }
            foreach (XmlNode child in node.ChildNodes)
            {
                if (ctObj.uriField == CT_KeyEncryptorUri.httpschemasmicrosoftcomoffice2006keyEncryptorcertificate)
                {
                    ctObj.itemField = CT_CertificateKeyEncryptor.Parse(child, nameSpaceManager);
                }
                else
                {
                    ctObj.itemField = CT_PasswordKeyEncryptor.Parse(child, nameSpaceManager);
                }
            }
            return(ctObj);
        }
Example #3
0
        public static CT_CertificateKeyEncryptor Parse(XmlNode node, XmlNamespaceManager nameSpaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_CertificateKeyEncryptor ctObj = new CT_CertificateKeyEncryptor();

            if (node.Attributes["certVerifier"] != null)
            {
                ctObj.certVerifier = Convert.FromBase64String(node.Attributes["certVerifier"].Value);
            }
            if (node.Attributes["encryptedKeyValue"] != null)
            {
                ctObj.encryptedKeyValue = Convert.FromBase64String(node.Attributes["encryptedKeyValue"].Value);
            }
            if (node.Attributes["x509Certificate"] != null)
            {
                ctObj.X509Certificate = Convert.FromBase64String(node.Attributes["x509Certificate"].Value);
            }
            return(ctObj);
        }