我正在尝试使用直接XML格式的C#签署Microsoft Office Word文件.
有一些问题,这里出现了模棱两可的问题:
SignatureValue?最后一个问题是我正确地这样做了吗?也许这里有问题,我错过了一个软件包,否则它本身会与openxml文件交互并签名.
但请记住,我实际上是尝试使用外部令牌签署数据,该外部令牌具有可用的pkcs11接口(但没有CSP),所以我使用了PKCS11 Interop库将其迁移到c#,但我在这里仍然有点困惑.
只是为了抬头任何执行openXML交互的库也应该允许我使用pkcs11命令对文档进行签名(即,它给我字节流来签名和消化但是其他部分本身,pkcs11实际上不应该被认为是一个重要性在这里(你可以用我的自定义算法替换它))
BTW中的签名构建器如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="idPackageSignature">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#idPackageObject">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<DigestValue/>
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#idOfficeObject">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<DigestValue/>
</Reference>
<Reference Type="http://uri.etsi.org/01903#SignedProperties" URI="#idSignedProperties">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<DigestValue/>
</Reference>
</SignedInfo>
<SignatureValue/>
<KeyInfo>
<X509Data>
<X509Certificate/>
</X509Data>
</KeyInfo>
<Object Id="idPackageObject">
<Manifest>
<Reference URI="/_rels/.rels?ContentType=application/vnd.openxmlformats-package.relationships+xml">
<Transforms>
<Transform Algorithm="http://schemas.openxmlformats.org/package/2006/RelationshipTransform">
<mdssi:RelationshipReference xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" SourceId="rId1"/>
</Transform>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<DigestValue/>
</Reference>
<Reference …Run Code Online (Sandbox Code Playgroud) 好吧,我已经知道有一个关于此的文件,其中说明:
12.2.4.26 Relationships Transform Algorithm
13 The relationships transform takes the XML document from the Relationships part and converts it to another
14 XML document.
15 The package implementer might create relationships XML that contains content from several namespaces, along
16 with versioning instructions as defined in Part 5: “Markup Compatibility and Extensibility”. [O6.11]
17 The relationships transform algorithm is as follows:
18 Step 1: Process versioning instructions
19 1. The package implementer shall process the versioning instructions, considering that …Run Code Online (Sandbox Code Playgroud) 例如,我们有字符串"abcdabcd"
我们想要计算字符串中可用的所有对(例如:"ab"或"da").
那么我们如何在apache spark中做到这一点呢?
我问这个原因看起来RDD不支持滑动功能:
rdd.sliding(2).toList
//Count number of pairs in list
//Returns syntax error on first line (sliding)
Run Code Online (Sandbox Code Playgroud)