首页 \ 问答 \ 如何使用可以侧载的证书创建UWP应用程序(How to created a UWP app with a certificate that can be sideloaded)

如何使用可以侧载的证书创建UWP应用程序(How to created a UWP app with a certificate that can be sideloaded)

我正在尝试创建一个可以侧载到其他PC上的UWP应用程序。 我的主要问题是:我是否需要来自可靠来源的证书来签署我的申请?

经过大量的讨论,我了解到您可以从Windows应用商店通过应用程序App Installer来加载/安装UWP应用程序。 安装App Installer后,可以通过双击.appxbundle文件来安装UWP应用程序。 (不使用.ps1文件,如此处所示)

在此之前,我需要信任证书。 我已经通过Visual Studio创建了这个证书。 它是通过双击.appxmanifest进入Packaging ,选择Choose Certificate - > Configure Cerfiticate然后Create test certificate

我试图在两台不同的Windows 10机器上安装我的应用程序。 在一台机器上,应用程序将失败,因为该程序包可能与另一个程序包冲突或依赖于未安装的东西(某些事情不是真的),而在另一台机器上它会产生证书错误(即使我信任并将证书添加到我的root受信任证书中。

我是否需要由受信任的机构发布的证书才能使其生效? 我的印象是我的证书应该可以使用,只要用户信任它,但是应用程序似乎没有安装。

此外,如果我确实需要可信证书,如何创建此pfx文件? 我从哪里得到它? Microsoft文档似乎没有提及任何内容。


I am trying to create a UWP app that can be sideloaded onto other PCs. My main question is: Do I need a certificate from a trusted source to sign my application?

After a lot of poking around, I learned that you can sideload/install UWP applications through the application App Installer from the Windows Store. After installing the App Installer, one can install UWP apps by double clicking on the .appxbundle file. (Not using the .ps1 file, as indicated here)

Before doing this, I would need to trust the certificate. I've created this certificate through Visual Studio. It was created by double clicking the .appxmanifest going to Packaging, selecting Choose Certificate -> Configure Cerfiticate and then Create test certificate.

I tried to install my application on two different Windows 10 machines. On one machine, the application would fail by saying that the package might conflict with another package or depends on things that aren't installed (something that isn't true) and on the other machine it would give a certificate error (even though I trusted and added the certificate to my root trusted certificates).

Do I need a certificate released by a trusted authority to get this to work? I was under the impression that my certificate should work, as long as the user trusted it, but the app doesn't seem to install.

Also, if I do need a trusted certificate, how do I create this pfx file? And where do I get it from? The Microsoft documentation doesn't seem to mention anything.


原文:https://stackoverflow.com/questions/43010863
更新时间:2022-04-26 16:04

最满意答案

默认的Sesame SPARQLResultsXMLWriter没有此选项。 但是,定制它应该相当容易。 您需要做的是创建类info.aduna.xml.XMLWriter的子类(这是一个正确格式化的XML的实用程序类,内部由SPARQLResultsXMLWriter使用)。 在这个子类中,添加一个getter / setter来指定样式表链接,然后覆盖startDocument方法,如下所示:

public class MyXMLWriter extends info.aduna.xml.XMLWriter {

     @Override
     public void startDocument() throws IOException {
         super.startDocument();
         _write("<?xml-stylesheet type=\"text/xsl\"");
         _write(" href=\"" + getStylesheetRef() + "\"");
         _writeLn("?>");
     }
}

然后只需将此自定义XMLWriter提供给SPARQLResultsXMLWriter,并将样式表ref设置为正确的值:

MyXMLWriter writer = new MyXMLWriter(out);
writer.setStylesheetRef("example.xsl");

SPARQLResultsXMLWriter sparqlWriter = new SPARQLResultsXMLWriter(writer);

未经测试,但相当自信这应该工作。

或者,使用Sesame项目提出功能请求和/或为其提供补丁。


The default Sesame SPARQLResultsXMLWriter does not have an option for this. However, it should be fairly easy to customize it. What you need to do is create a subclass of the class info.aduna.xml.XMLWriter (which is a utility class for correctly formatted XML that is used by the SPARQLResultsXMLWriter internally). In this subclass, add a getter/setter to specify the stylesheet link, and then override the startDocument method like so:

public class MyXMLWriter extends info.aduna.xml.XMLWriter {

     @Override
     public void startDocument() throws IOException {
         super.startDocument();
         _write("<?xml-stylesheet type=\"text/xsl\"");
         _write(" href=\"" + getStylesheetRef() + "\"");
         _writeLn("?>");
     }
}

Then just supply this customized XMLWriter to your SPARQLResultsXMLWriter and set the stylesheet ref to the correct value:

MyXMLWriter writer = new MyXMLWriter(out);
writer.setStylesheetRef("example.xsl");

SPARQLResultsXMLWriter sparqlWriter = new SPARQLResultsXMLWriter(writer);

Untested, but fairly confident this should work.

Alternatively, raise a feature request with the Sesame project and/or supply them with a patch.

相关问答

更多
  • OpenRDF Sesame不再被维护,它已经被Eclipse RDF4J项目所取代 。 有一个迁移指南可用于帮助您了解更新项目时要执行的操作。 尽管Sesame项目不再维护,但有一个文档存档可用,当然,很多RDF4J文档也适用于芝麻,尽管它们的软件包名称略有不同。 至于您的具体问题:Sesame Server使用的目录由系统属性info.aduna.platform.appdata.basedir确定。 将此属性(在JVM启动时,使用-D标志)设置到所需的位置。 有关更多详细信息,请参阅关于应用程序目录配 ...
  • 我不知道你从哪里得到这个代码示例,但Sesame 2中不存在类SesameService , Sparqlquery或UnknownRepositoryException 。 您使用的是非常旧版本的Sesame(1.x,不再受支持,至少从2007年开始),或者您正在使用某些第三方包装器库。 确保您使用的是最新版本的Sesame(最新的稳定版本可以在网站上找到 )。 连接到Sesame Server的正确/最新方式如下: // connect to the server String serverUrl ...
  • 这是Sesame 2.8.10 /更高版本中的一个已知问题,请参阅https://github.com/eclipse/rdf4j/issues/91 。 正在修复一个修复程序。 目前只有两个解决方法是: 删除然后重新创建存储库; 将sesame.server.txn.registry.timeout系统参数设置为更高的超时值(默认值为60秒)。 This is a known issue in Sesame 2.8.10 / later, see https://github.com/eclipse/rd ...
  • 较旧版本的Sesame(2.7.x及更早版本)不支持HTTP上的事务隔离。 在HTTP连接中,事务只是在客户端一起批量操作,但是没有从服务器获得锁定,因此在这种情况下无法控制隔离。 因此,在较旧的芝麻版本中处理此问题的唯一方法是在查询中保持健壮,而不是依赖于完整的数据一致性(无论如何,这在无模式/半结构化数据范例中是一个奇怪的概念)。 例如,在这种特殊情况下,请确保在查询链接到配置文件的书籍时,书籍数据实际上存在 - 不仅仅依赖于引用。 但是,在Sesame 2.8及更高版本中,可以通过HTTP获得完整的事 ...
  • 您需要做的就是使用Workbench创建一个新的存储库,并确保选择包含SPIN推理的存储库类型(有一个下拉菜单,带有SPIN支持的选项应该相当明显)。 换句话说,它与您使用其他类型的推理支持创建存储库的方式类似。 All you need to do is use the Workbench to create a new repository, and making sure that you pick a repository type that includes SPIN reasoning (the ...
  • Sesame Workbench实际上不是这类任务的理想工具 - 尽管我希望它能够处理100MB文件。 可能是您运行Sesame的Tomcat设置了POST限制? 你可以在Sesame的邮件列表上询问,那里也很少有知识渊博的人。 但这里有两个可能的想法来完成工作: 解决此问题的一种方法是使用Sesame的Repository API以编程方式上传。 有关代码示例,请查看Sesame网站上的用户文档。 或者,如果您使用的是Sesame本机存储,则可以使用Sesame的命令行控制台执行“脏”的解决方法:创建本地 ...
  • 当我们创建存储库时,我们将其创建为“内存存储库”存储库。 我创建了一个新的“Native Java Store”类型的存储库,现在我的第一个调用很快(因为所有都是后续调用)。 When we created the repository we created it as a "In Memory Store" repository. I created a new repository of the "Native Java Store" type, and now my first call is fas ...
  • 默认的Sesame SPARQLResultsXMLWriter没有此选项。 但是,定制它应该相当容易。 您需要做的是创建类info.aduna.xml.XMLWriter的子类(这是一个正确格式化的XML的实用程序类,内部由SPARQLResultsXMLWriter使用)。 在这个子类中,添加一个getter / setter来指定样式表链接,然后覆盖startDocument方法,如下所示: public class MyXMLWriter extends info.aduna.xml.XMLWrit ...
  • 我相信你需要在servlet容器级别进行密码保护。 你在用Tomcat吗? 以下是我用Tomcat 6设置基本身份验证的方法: web.xml中 Sesame Workbench /*
  • 可以从Eclipse部署标准的Sesame war文件,实际上非常简单: 转到“文件 - >导入... - > Web - > WAR文件”,然后选择openrdf-sesame.war文件。 选择适当的Tomcat服务器作为目标运行时,然后单击“下一步”。 在下一个屏幕(导入Web库)中,取消选中所有内容,单击“完成”。 完成此操作后,openrdf-sesame将作为Web项目在Eclipse中提供,您可以像在任何其他Web项目一样在Tomcat上部署和运行它。 It is possible to de ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)