- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为使用 XAdES 的消息签名而苦恼。我已经搜索了将我带到下面代码的解决方案。但是我尝试连接的服务告诉我签名错误。我做错了什么?
public static class Signature
{
#region Private fields
public const string XmlDsigSignatureProperties = "http://uri.etsi.org/01903#SignedProperties";
public const string XadesProofOfApproval = "http://uri.etsi.org/01903/v1.2.2#ProofOfApproval";
public const string XadesPrefix = "xades";
public const string SignaturePrefix = "ds";
public const string SignatureNamespace = "http://www.w3.org/2000/09/xmldsig#";
public const string XadesNamespaceUrl = "http://uri.etsi.org/01903/v1.3.2#";
private const string SignatureId = "Signature";
private const string SignaturePropertiesId = "SignedProperties";
#endregion Private fields
#region Public methods
public static XmlElement SignWithXades(X509Certificate2 signingCertificate, string xml)
{
var xmlDocument = new XmlDocument();
xmlDocument.LoadXml(xml);
AddSignatureProperties(xmlDocument, signingCertificate);
var signedXml = new SignedXml(xmlDocument);
signedXml.Signature.Id = SignatureId;
signedXml.SigningKey = signingCertificate.PrivateKey;
var signatureReference = new Reference { Uri = "", };
signatureReference.AddTransform(new XmlDsigEnvelopedSignatureTransform());
signedXml.AddReference(signatureReference);
var parametersSignature = new Reference
{
Uri = $"#{SignaturePropertiesId}",
Type = XmlDsigSignatureProperties,
};
signedXml.AddReference(parametersSignature);
var keyInfo = new KeyInfo();
keyInfo.AddClause(new KeyInfoX509Data(signingCertificate));
signedXml.KeyInfo = keyInfo;
signedXml.ComputeSignature();
var signatureNode = signedXml.GetXml();
AssignNameSpacePrefixToElementTree(signatureNode, SignaturePrefix);
var signedInfoNode = signatureNode.SelectSingleNode("//*[local-name()='SignedInfo']");
var signatureValue = signatureNode.SelectSingleNode("//*[local-name()='SignatureValue']");
var keyInfoNode = xmlDocument.SelectSingleNode("//*[local-name()='KeyInfo']");
var finalSignatureNode = xmlDocument.SelectSingleNode("//*[local-name()='Signature']");
finalSignatureNode.InsertBefore(signatureValue, keyInfoNode);
finalSignatureNode.InsertBefore(signedInfoNode, signatureValue);
return (XmlElement)finalSignatureNode;
}
#endregion Public methods
#region Private methods
private static void AddSignatureProperties(XmlDocument document, X509Certificate2 signingCertificate)
{
// <Signature>
var signatureNode = document.CreateElement(SignaturePrefix, "Signature", SignatureNamespace);
var signatureIdAttribute = document.CreateAttribute("Id");
signatureIdAttribute.InnerText = SignatureId;
signatureNode.Attributes.Append(signatureIdAttribute);
document.DocumentElement.AppendChild(signatureNode);
AddKeyInfo(document, signatureNode, signingCertificate);
AddCertificateObject(document, signatureNode, signingCertificate);
}
private static void AddKeyInfo(XmlDocument document, XmlElement signatureNode, X509Certificate2 signingCertificate)
{
// <KeyInfo>
var keyInfoNode = document.CreateElement(SignaturePrefix, "KeyInfo", SignatureNamespace);
signatureNode.AppendChild(keyInfoNode);
// <KeyInfo><X509Data>
var x509DataNode = document.CreateElement(SignaturePrefix, "X509Data", SignatureNamespace);
keyInfoNode.AppendChild(x509DataNode);
var x509CertificateNode = document.CreateElement(SignaturePrefix, "X509Certificate", SignatureNamespace);
x509CertificateNode.InnerText = Convert.ToBase64String(signingCertificate.GetRawCertData());
x509DataNode.AppendChild(x509CertificateNode);
}
private static void AddCertificateObject(XmlDocument document, XmlElement signatureNode, X509Certificate2 signingCertificate)
{
// <Object>
var objectNode = document.CreateElement(SignaturePrefix, "Object", SignatureNamespace);
signatureNode.AppendChild(objectNode);
// <Object><QualifyingProperties>
var qualifyingPropertiesNode = document.CreateElement(XadesPrefix, "QualifyingProperties", XadesNamespaceUrl);
qualifyingPropertiesNode.SetAttribute("Target", $"#{SignatureId}");
objectNode.AppendChild(qualifyingPropertiesNode);
// <Object><QualifyingProperties><SignedProperties>
var signedPropertiesNode = document.CreateElement(XadesPrefix, "SignedProperties", XadesNamespaceUrl);
signedPropertiesNode.SetAttribute("Id", SignaturePropertiesId);
qualifyingPropertiesNode.AppendChild(signedPropertiesNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties>
var signedSignaturePropertiesNode = document.CreateElement(XadesPrefix, "SignedSignatureProperties", XadesNamespaceUrl);
signedPropertiesNode.AppendChild(signedSignaturePropertiesNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties> </SigningTime>
var signingTime = document.CreateElement(XadesPrefix, "SigningTime", XadesNamespaceUrl);
signingTime.InnerText = $"{DateTime.UtcNow.ToString("s")}Z";
signedSignaturePropertiesNode.AppendChild(signingTime);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate>
var signingCertificateNode = document.CreateElement(XadesPrefix, "SigningCertificate", XadesNamespaceUrl);
signedSignaturePropertiesNode.AppendChild(signingCertificateNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert>
var certNode = document.CreateElement(XadesPrefix, "Cert", XadesNamespaceUrl);
signingCertificateNode.AppendChild(certNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><CertDigest>
var certDigestNode = document.CreateElement(XadesPrefix, "CertDigest", XadesNamespaceUrl);
certNode.AppendChild(certDigestNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><CertDigest> </DigestMethod>
var digestMethod = document.CreateElement("ds", "DigestMethod", SignedXml.XmlDsigNamespaceUrl);
var digestMethodAlgorithmAtribute = document.CreateAttribute("Algorithm");
digestMethodAlgorithmAtribute.InnerText = SignedXml.XmlDsigSHA1Url;
digestMethod.Attributes.Append(digestMethodAlgorithmAtribute);
certDigestNode.AppendChild(digestMethod);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><CertDigest> </DigestMethod>
var digestValue = document.CreateElement("ds", "DigestValue", SignedXml.XmlDsigNamespaceUrl);
digestValue.InnerText = Convert.ToBase64String(signingCertificate.GetCertHash());
certDigestNode.AppendChild(digestValue);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><IssuerSerial>
var issuerSerialNode = document.CreateElement(XadesPrefix, "IssuerSerial", XadesNamespaceUrl);
certNode.AppendChild(issuerSerialNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><IssuerSerial> </X509IssuerName>
var x509IssuerName = document.CreateElement("ds", "X509IssuerName", SignedXml.XmlDsigNamespaceUrl);
x509IssuerName.InnerText = signingCertificate.Issuer;
issuerSerialNode.AppendChild(x509IssuerName);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><IssuerSerial> </X509SerialNumber>
var x509SerialNumber = document.CreateElement("ds", "X509SerialNumber", SignedXml.XmlDsigNamespaceUrl);
x509SerialNumber.InnerText = ToDecimalString(signingCertificate.SerialNumber);
issuerSerialNode.AppendChild(x509SerialNumber);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties>
var signedDataObjectPropertiesNode = document.CreateElement(XadesPrefix, "SignedDataObjectProperties", XadesNamespaceUrl);
signedPropertiesNode.AppendChild(signedDataObjectPropertiesNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication>
var commitmentTypeIndicationNode = document.CreateElement(XadesPrefix, "CommitmentTypeIndication", XadesNamespaceUrl);
signedDataObjectPropertiesNode.AppendChild(commitmentTypeIndicationNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication><CommitmentTypeId>
var commitmentTypeIdNode = document.CreateElement(XadesPrefix, "CommitmentTypeId", XadesNamespaceUrl);
commitmentTypeIndicationNode.AppendChild(commitmentTypeIdNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication><CommitmentTypeId><Identifier>
var identifierNode = document.CreateElement(XadesPrefix, "Identifier", XadesNamespaceUrl);
identifierNode.InnerText = XadesProofOfApproval;
commitmentTypeIdNode.AppendChild(identifierNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication><AllSignedDataObjects>
var allSignedDataObjectsNode = document.CreateElement(XadesPrefix, "AllSignedDataObjects", XadesNamespaceUrl);
commitmentTypeIndicationNode.AppendChild(allSignedDataObjectsNode);
}
private static string ToDecimalString(string serialNumber)
{
BigInteger bi;
if (BigInteger.TryParse(serialNumber, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out bi))
{
return bi.ToString(CultureInfo.InvariantCulture);
}
else
{
return serialNumber;
}
}
private static void AssignNameSpacePrefixToElementTree(XmlElement element, string prefix)
{
element.Prefix = prefix;
foreach (var child in element.ChildNodes)
{
if (child is XmlElement)
AssignNameSpacePrefixToElementTree(child as XmlElement, prefix);
}
}
#endregion Private methods
}
需要服务的消息应该是这样的
<Tag1>
<Tag2>...</Tag2>
<ds:Signature ...> ... </ds:Signature>
</Tag1>
消息的签名部分必须是:
<Tag1>
<Tag2>...</Tag2>
</Tag1>
最佳答案
我终于解决了我的问题。问题是在破坏引用摘要值的签名过程后添加前缀“ds”。结果表明不需要此前缀。我在下面发布工作代码。
这是我需要访问 XAdES QualifyingProperties 的 SignedXml 的重写类,它存储在 DataObject 而不是实际消息中。
public class XadesSignedXml : SignedXml
{
#region Public fields
public const string XmlDsigSignatureProperties = "http://uri.etsi.org/01903#SignedProperties";
public const string XadesProofOfApproval = "http://uri.etsi.org/01903/v1.2.2#ProofOfApproval";
public const string XadesPrefix = "xades";
public const string XadesNamespaceUrl = "http://uri.etsi.org/01903/v1.3.2#";
public XmlElement PropertiesNode { get; set; }
#endregion Public fields
#region Private fields
private readonly List<DataObject> _dataObjects = new List<DataObject>();
#endregion Private fields
#region Constructor
public XadesSignedXml(XmlDocument document) : base(document) { }
#endregion Constructor
#region SignedXml
public override XmlElement GetIdElement(XmlDocument document, string idValue)
{
if (string.IsNullOrEmpty(idValue))
return null;
var xmlElement = base.GetIdElement(document, idValue);
if (xmlElement != null)
return xmlElement;
if (_dataObjects.Count == 0)
return null;
foreach (var dataObject in _dataObjects)
{
var nodeWithSameId = XmlHelper.FindNodeWithAttributeValueIn(dataObject.Data, "Id", idValue);
if (nodeWithSameId != null)
return nodeWithSameId;
}
return null;
}
public new void AddObject(DataObject dataObject)
{
base.AddObject(dataObject);
_dataObjects.Add(dataObject);
}
#endregion SignedXml
}
这是签名方法。
public static class Signature
{
#region Private fields
private const string SignatureId = "Signature";
private const string SignaturePropertiesId = "SignedProperties";
#endregion Private fields
#region Public methods
public static XmlElement SignWithXAdES(X509Certificate2 signingCertificate, XmlDocument xmlDocument)
{
var signedXml = new XadesSignedXml(xmlDocument);
signedXml.Signature.Id = SignatureId;
signedXml.SigningKey = signingCertificate.PrivateKey;
var signatureReference = new Reference { Uri = "", };
signatureReference.AddTransform(new XmlDsigEnvelopedSignatureTransform());
signedXml.AddReference(signatureReference);
var keyInfo = new KeyInfo();
keyInfo.AddClause(new KeyInfoX509Data(signingCertificate));
signedXml.KeyInfo = keyInfo;
AddXAdESProperties(xmlDocument, signedXml, signingCertificate);
signedXml.ComputeSignature();
return signedXml.GetXml();
}
#endregion Public methods
#region Private methods
private static void AddXAdESProperties(XmlDocument document, XadesSignedXml xadesSignedXml, X509Certificate2 signingCertificate)
{
var parametersSignature = new Reference
{
Uri = $"#{SignaturePropertiesId}",
Type = XadesSignedXml.XmlDsigSignatureProperties,
};
xadesSignedXml.AddReference(parametersSignature);
// <Object>
var objectNode = document.CreateElement("Object", SignedXml.XmlDsigNamespaceUrl);
// <Object><QualifyingProperties>
var qualifyingPropertiesNode = document.CreateElement(XadesSignedXml.XadesPrefix, "QualifyingProperties", XadesSignedXml.XadesNamespaceUrl);
qualifyingPropertiesNode.SetAttribute("Target", $"#{SignatureId}");
objectNode.AppendChild(qualifyingPropertiesNode);
// <Object><QualifyingProperties><SignedProperties>
var signedPropertiesNode = document.CreateElement(XadesSignedXml.XadesPrefix, "SignedProperties", XadesSignedXml.XadesNamespaceUrl);
signedPropertiesNode.SetAttribute("Id", SignaturePropertiesId);
qualifyingPropertiesNode.AppendChild(signedPropertiesNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties>
var signedSignaturePropertiesNode = document.CreateElement(XadesSignedXml.XadesPrefix, "SignedSignatureProperties", XadesSignedXml.XadesNamespaceUrl);
signedPropertiesNode.AppendChild(signedSignaturePropertiesNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties> </SigningTime>
var signingTime = document.CreateElement(XadesSignedXml.XadesPrefix, "SigningTime", XadesSignedXml.XadesNamespaceUrl);
signingTime.InnerText = $"{DateTime.UtcNow.ToString("s")}Z";
signedSignaturePropertiesNode.AppendChild(signingTime);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate>
var signingCertificateNode = document.CreateElement(XadesSignedXml.XadesPrefix, "SigningCertificate", XadesSignedXml.XadesNamespaceUrl);
signedSignaturePropertiesNode.AppendChild(signingCertificateNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert>
var certNode = document.CreateElement(XadesSignedXml.XadesPrefix, "Cert", XadesSignedXml.XadesNamespaceUrl);
signingCertificateNode.AppendChild(certNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><CertDigest>
var certDigestNode = document.CreateElement(XadesSignedXml.XadesPrefix, "CertDigest", XadesSignedXml.XadesNamespaceUrl);
certNode.AppendChild(certDigestNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><CertDigest> </DigestMethod>
var digestMethod = document.CreateElement("DigestMethod", SignedXml.XmlDsigNamespaceUrl);
var digestMethodAlgorithmAtribute = document.CreateAttribute("Algorithm");
digestMethodAlgorithmAtribute.InnerText = SignedXml.XmlDsigSHA1Url;
digestMethod.Attributes.Append(digestMethodAlgorithmAtribute);
certDigestNode.AppendChild(digestMethod);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><CertDigest> </DigestMethod>
var digestValue = document.CreateElement("DigestValue", SignedXml.XmlDsigNamespaceUrl);
digestValue.InnerText = Convert.ToBase64String(signingCertificate.GetCertHash());
certDigestNode.AppendChild(digestValue);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><IssuerSerial>
var issuerSerialNode = document.CreateElement(XadesSignedXml.XadesPrefix, "IssuerSerial", XadesSignedXml.XadesNamespaceUrl);
certNode.AppendChild(issuerSerialNode);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><IssuerSerial> </X509IssuerName>
var x509IssuerName = document.CreateElement("X509IssuerName", SignedXml.XmlDsigNamespaceUrl);
x509IssuerName.InnerText = signingCertificate.Issuer;
issuerSerialNode.AppendChild(x509IssuerName);
// <Object><QualifyingProperties><SignedProperties><SignedSignatureProperties><SigningCertificate><Cert><IssuerSerial> </X509SerialNumber>
var x509SerialNumber = document.CreateElement("X509SerialNumber", SignedXml.XmlDsigNamespaceUrl);
x509SerialNumber.InnerText = ToDecimalString(signingCertificate.SerialNumber);
issuerSerialNode.AppendChild(x509SerialNumber);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties>
var signedDataObjectPropertiesNode = document.CreateElement(XadesSignedXml.XadesPrefix, "SignedDataObjectProperties", XadesSignedXml.XadesNamespaceUrl);
signedPropertiesNode.AppendChild(signedDataObjectPropertiesNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication>
var commitmentTypeIndicationNode = document.CreateElement(XadesSignedXml.XadesPrefix, "CommitmentTypeIndication", XadesSignedXml.XadesNamespaceUrl);
signedDataObjectPropertiesNode.AppendChild(commitmentTypeIndicationNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication><CommitmentTypeId>
var commitmentTypeIdNode = document.CreateElement(XadesSignedXml.XadesPrefix, "CommitmentTypeId", XadesSignedXml.XadesNamespaceUrl);
commitmentTypeIndicationNode.AppendChild(commitmentTypeIdNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication><CommitmentTypeId><Identifier>
var identifierNode = document.CreateElement(XadesSignedXml.XadesPrefix, "Identifier", XadesSignedXml.XadesNamespaceUrl);
identifierNode.InnerText = XadesSignedXml.XadesProofOfApproval;
commitmentTypeIdNode.AppendChild(identifierNode);
// <Object><QualifyingProperties><SignedProperties><SignedDataObjectProperties><CommitmentTypeIndication><AllSignedDataObjects>
var allSignedDataObjectsNode = document.CreateElement(XadesSignedXml.XadesPrefix, "AllSignedDataObjects", XadesSignedXml.XadesNamespaceUrl);
commitmentTypeIndicationNode.AppendChild(allSignedDataObjectsNode);
var dataObject = new DataObject();
dataObject.Data = qualifyingPropertiesNode.SelectNodes(".");
xadesSignedXml.AddObject(dataObject);
}
private static string ToDecimalString(string serialNumber)
{
BigInteger bi;
if (BigInteger.TryParse(serialNumber, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out bi))
{
return bi.ToString(CultureInfo.InvariantCulture);
}
else
{
return serialNumber;
}
}
#endregion Private methods
}
关于C# 如何使用 SignedXml 使用 XAdES 正确签署消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50096199/
我正在尝试验证由 xades4j 签名的文档,但我对证书验证不感兴趣。我唯一需要知道的是该文档已正确签署,并且自签署以来没有任何更改。 我尝试了几种不同的方法,但每种方法都使用 PKIXCertifi
Java 程序将 PDF 文档发送到外部系统并接收该文档的 XADES 标志。 我想检查 PDF 文档的哈希值是否与 Xades 符号中包含的哈希值匹配。所以我计算了PDF文档的SHA1,但它与ds:
我必须为一个项目创建我自己的 XAdES 签名,除了分离的签名之外,一切都工作正常。据我了解,我必须添加对 XML 对象的引用,该对象将指向存储原始文档的容器。我已经尝试使用 ResolverAnon
有了 XAdES-BES 签名,其中嵌入了签名内容,是否可以分离签名内容,以便拥有带有 ObjectReference 的 XAdES。 所以简单来说 - 我需要一种方法,它采用带有嵌入式文件的 XA
我正在尝试使用 xades4j 库使用分离的 XAdES 签名“test.zip.xades”来验证文件“test.zip”的完整性。我知道更简单的方法是使用 md5,但我需要使用 XAdES。我不想
我正在寻找与 microsoft.net 框架兼容的库,它允许创建和验证 XAdES 签名(XAdES、XAdES-C、XAdES-XL 等...)。 让程序员能够选择的库很重要: 1.- 签名过程中
我正在尝试通过2019-09-20T14:57:46到一个函数并使用根 中包含的数字签名对其进行签名标签 这是预期的结果: 2019-09-20T14:57:46
我是数字签名领域的新手。我想知道 CMS、CAdES_T、XAdES/XAdES_T、PAdES 文档是否都具有 .p7m 扩展名。如果是,我如何确定 .p7m 的签名类型?BouncyCaSTLe
我正在为使用 XAdES 的消息签名而苦恼。我已经搜索了将我带到下面代码的解决方案。但是我尝试连接的服务告诉我签名错误。我做错了什么? public static class Signature
我需要你的帮助:拜托,拜托。我有一个 Xades 签名的 XML 文档,我将其作为 byteArray 接收:所以我将我的 byteArray 转换为字符串。之后,我尝试解码以便获得映射的 Java
我们想创建一个验证“XADES”签名的 java web 应用程序,这个应用程序应该有两个文件:原始文件和他的分离签名。 我正在使用 XADES4j 库,这是一个很棒的项目。使用 XADES4j 有没
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 4 年前。
我需要使用 XAdES 模板签署 xml。我正在使用 2 个引用。第二个问题是,如果我添加 Transform,它将正常工作(signedXml.CheckSignature() 返回 True),如
我找不到任何理由说明为什么有人更愿意实现面向 CAdES 的电子签名软件解决方案而不是面向 XAdES 的电子签名软件解决方案。 互联网上有更多 XAdES 的开放库和实现案例和示例,但我仍然认为这不
我找到了 Xades Signature for Python GitHub。我的计划是将 Xades-EPES 签名应用于 XML 文件。根据 GitHub 的工作,它能够执行此过程,但我无法运行。
几天来,我一直在为如何计算 XAdES 签名中 SignedProperties 元素的摘要而苦苦思索。我有一个引用 XML 文件,其中计算了两个摘要值(正在签名的文件和已签名的属性),我知道它很好,
几天来,我一直在为如何计算 XAdES 签名中 SignedProperties 元素的摘要而苦苦思索。我有一个引用 XML 文件,其中计算了两个摘要值(正在签名的文件和已签名的属性),我知道它很好,
我正在尝试使用 XAdES4j 库通过封装签名对 xml 进行签名。从我读到的所有内容来看,似乎可以完全按照我想做的事情进行,但我无法找到一个简单的示例来帮助我更好地理解工作流程。该库位于此处: ht
我正在尝试在 Android 中使用 XADES-BES 签署文件。我找到了一个关于这个的图书馆。构建和创建 APK 工作正常。选择文件并单击“签名”按钮后,出现运行时错误。经过调试发现Context
我正在签署的文件看起来像这样。 我正在使用 xadesjs使用以下代码签署此 XML: const crypto = new Crypto(); xadesjs.Application.setE
我是一名优秀的程序员,十分优秀!