コード例 #1
0
        public XmldsigForWidgetDigSig(WidgetDigSig role, SHA256WithRSA signer, string root)
        {
            Role        = role;
            SigningRoot = root;

            Signer           = signer;
            CertificateChain = new List <string>(signer.Base64KeyChain);
        }
コード例 #2
0
        public XmldsigForWidgetDigSig(WidgetDigSig role, SHA512WithRSA signer, string root)
        {
            Role        = role;
            SigningRoot = root.TrimEnd(new[] { '/', '\\' });

            Signer           = signer;
            CertificateChain = new List <string>(signer.Base64KeyChain);
        }
コード例 #3
0
ファイル: Sign.cs プロジェクト: Samsung/Tizen.NET
        private void CreateSignedXML(string filename, string root, WidgetDigSig role, string pkcs12, string password)
        {
            pkcs12 = Path.GetFullPath(pkcs12);

            if (string.IsNullOrEmpty(password))
            {
                password = Utility.AskPassword($"Insert Password of {pkcs12} : ");
            }

            SHA512WithRSA          sha  = new SHA512WithRSA(pkcs12, password);
            XmldsigForWidgetDigSig xmld = new XmldsigForWidgetDigSig(role, sha, root);

            var sig = xmld;

            string signedXml = Path.Combine(root, filename);

            File.WriteAllText(signedXml, sig.ToString().Replace("\r\n", "\n"));
        }