{"id":19197538,"url":"https://github.com/rikulo/xml-crypto","last_synced_at":"2025-04-10T07:52:24.425Z","repository":{"id":59150219,"uuid":"459944080","full_name":"rikulo/xml-crypto","owner":"rikulo","description":"Xml digital signature library for Dart","archived":false,"fork":false,"pushed_at":"2025-03-17T01:42:52.000Z","size":168,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T08:07:06.520Z","etag":null,"topics":["cryptography","dart","xml","xml-digital-signature","xmldsig"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/xml_crypto","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rikulo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-16T09:54:14.000Z","updated_at":"2025-03-15T14:51:21.000Z","dependencies_parsed_at":"2025-03-15T15:36:21.874Z","dependency_job_id":null,"html_url":"https://github.com/rikulo/xml-crypto","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikulo%2Fxml-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikulo%2Fxml-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikulo%2Fxml-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikulo%2Fxml-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rikulo","download_url":"https://codeload.github.com/rikulo/xml-crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248182024,"owners_count":21060892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","dart","xml","xml-digital-signature","xmldsig"],"created_at":"2024-11-09T12:17:13.694Z","updated_at":"2025-04-10T07:52:24.393Z","avatar_url":"https://github.com/rikulo.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"## xml-crypto\n\n[![Dart](https://github.com/rikulo/xml-crypto/actions/workflows/dart.yml/badge.svg)](https://github.com/rikulo/xml-crypto/actions/workflows/dart.yml)\n\nPort of awesome Node.js library - [xml-crypto](https://github.com/node-saml/xml-crypto) - in Dart.\n\nAn xml digital signature library for Dart.\n\n## Install\nInstall:\n\n    dart pub add xml_crypto\n\n\n## Supported Algorithms\n\n### Canonicalization and Transformation Algorithms\n\n* Canonicalization http://www.w3.org/TR/2001/REC-xml-c14n-20010315\n* Canonicalization with comments http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\n* Exclusive Canonicalization http://www.w3.org/2001/10/xml-exc-c14n#\n* Exclusive Canonicalization with comments http://www.w3.org/2001/10/xml-exc-c14n#WithComments\n* Enveloped Signature transform http://www.w3.org/2000/09/xmldsig#enveloped-signature\n\n### Hashing Algorithms\n\n* SHA1 digests http://www.w3.org/2000/09/xmldsig#sha1\n* SHA256 digests http://www.w3.org/2001/04/xmlenc#sha256\n* SHA512 digests http://www.w3.org/2001/04/xmlenc#sha512\n\n### Signature Algorithms\n\n* RSA-SHA1 http://www.w3.org/2000/09/xmldsig#rsa-sha1\n* RSA-SHA256 http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\n* RSA-SHA512 http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\n\nHMAC-SHA1 is also available but it is disabled by default\n* HMAC-SHA1 http://www.w3.org/2000/09/xmldsig#hmac-sha1\n\nto enable HMAC-SHA1, do:\n```dart\nimport 'package:xml_crypto/xml_crypto.dart';\n\nSignedXml.enableHMAC();\n```\nThis will enable HMAC and disable digital signature algorithms. Due to key\nconfusion issues, it is risky to have both HMAC-based and public key digital\nsignature algorithms enabled at same time.\n\nby default the following algorithms are used:\n\n*Canonicalization/Transformation Algorithm:* Exclusive Canonicalization http://www.w3.org/2001/10/xml-exc-c14n#\n\n*Hashing Algorithm:* SHA1 digest http://www.w3.org/2000/09/xmldsig#sha1\n\n*Signature Algorithm:* RSA-SHA1 http://www.w3.org/2000/09/xmldsig#rsa-sha1\n\n[You are able to extend xml-crypto with custom algorithms.](#customizing-algorithms)\n\n\n## Signing Xml documents\n\nWhen signing a xml document you can specify the following properties on a `SignedXml` instance to customize the signature process:\n\n- `sign.signingKey` - **[required]** a `Uint8List` containing your private key\n- `sign.keyInfoProvider` - **[optional]** a key info provider instance, see [customizing algorithms](#customizing-algorithms) for an implementation example\n- `sign.signatureAlgorithm` - **[optional]** one of the supported [signature algorithms](#signature-algorithms). Ex: `sign.signatureAlgorithm = \"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\";`\n- `sign.canonicalizationAlgorithm` - **[optional]** one of the supported [canonicalization algorithms](#canonicalization-and-transformation-algorithms). Ex: `sign.canonicalizationAlgorithm = \"http://www.w3.org/2001/10/xml-exc-c14n#WithComments\";`\n\nUse this code:\n\n`````dart\n\timport 'dart:io';\n\timport 'package:xml_crypto/xml_crypto.dart';\n\n\tfinal xml = \"\u003clibrary\u003e\"\n\t            \"\u003cbook\u003e\"\n\t              \"\u003cname\u003eHarry Potter\u003c/name\u003e\"\n\t            \"\u003c/book\u003e\"\n\t          \"\u003c/library\u003e\";\n\n\tfinal sig = SignedXml()\n\t\t..addReference(\"//*[local-name()='book']\")\n\t\t..signingKey = File(\"client.pem\").readAsBytesSync()\n\t\t..computeSignature(xml);\n\tFile(\"signed.xml\").writeAsStringSync(sig.signedXml);\n`````\n\nThe result will be:\n\n\n`````xml\n\t\u003clibrary\u003e\n\t  \u003cbook Id=\"_0\"\u003e\n\t    \u003cname\u003eHarry Potter\u003c/name\u003e\n\t  \u003c/book\u003e\n\t  \u003cSignature xmlns=\"http://www.w3.org/2000/09/xmldsig#\"\u003e\n\t    \u003cSignedInfo\u003e\n\t      \u003cCanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" /\u003e\n\t      \u003cSignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\" /\u003e\n\t      \u003cReference URI=\"#_0\"\u003e\n\t        \u003cTransforms\u003e\n\t          \u003cTransform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" /\u003e\n\t        \u003c/Transforms\u003e\n\t        \u003cDigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /\u003e\n\t        \u003cDigestValue\u003ecdiS43aFDQMnb3X8yaIUej3+z9Q=\u003c/DigestValue\u003e\n\t      \u003c/Reference\u003e\n\t    \u003c/SignedInfo\u003e\n\t    \u003cSignatureValue\u003evhWzpQyIYuncHUZV9W...[long base64 removed]...\u003c/SignatureValue\u003e\n\t  \u003c/Signature\u003e\n\t\u003c/library\u003e\n`````\n\nNote:\n\nTo generate a `\u003cX509Data\u003e\u003c/X509Data\u003e` element in the signature you must provide a key info implementation, see [customizing algorithms](#customizing-algorithms) for an example.\n\n## Verifying Xml documents\n\nWhen verifying a xml document you must specify the following properties on a `SignedXml` instance:\n\n- `sign.keyInfoProvider` - **[required]** a key info provider instance containing your certificate, see [customizing algorithms](#customizing-algorithms) for an implementation example\n\nYou can use any dom parser you want in your code (or none, depending on your usage). This sample uses [xml](https://pub.dev/packages/xml) so you should install it first:\n\n    dart pub add xml\n\nExample:\n\n`````dart\n\timport 'dart:io';\n\timport 'package:xml_crypto/xml_crypto.dart';\n\n\tfinal xml = File(\"signed.xml\").readAsStringSync()\n\tvar doc = new dom().parseFromString(xml)    \n\n\tvar signature = select(doc, \"//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']\")[0]\n\tfinal sig = SignedXml()\n\t\t..keyInfoProvider = FileKeyInfo(\"client_public.pem\")\n\t\t..loadSignature(signature);\n\tfinal res = sig.checkSignature(xml);\n\tif (!res) print(sig.validationErrors);\n`````\n\nif the verification process fails `sig.validationErrors` will have the errors.\n\nIn order to protect from some attacks we must check the content we want to use is the one that has been signed:\n`````dart\n\tfinal elem = select(doc, \"/xpath_to_interesting_element\");\n\tfinal uri = sig.references[0].uri; // might not be 0 - depending on the document you verify\n\tfinal id = (uri[0] == '#') ? uri.substring(1) : uri;\n\tif (elem.getAttribute('ID') != id \u0026\u0026 elem.getAttribute('Id') != id \u0026\u0026 elem.getAttribute('id') != id)\n\t\tthrow Error('the interesting element was not the one verified by the signature');\n`````\n\nNote:\n\nThe xml-crypto api requires you to supply it separately the xml signature (\"\u0026lt;Signature\u0026gt;...\u0026lt;/Signature\u0026gt;\", in loadSignature) and the signed xml (in checkSignature). The signed xml may or may not contain the signature in it, but you are still required to supply the signature separately.\n\n\n### Caring for Implicit transform\nIf you fail to verify signed XML, then one possible cause is that there are some hidden implicit transforms(#).  \n(#) Normalizing XML document to be verified. i.e. remove extra space within a tag, sorting attributes, importing namespace declared in ancestor nodes, etc.\n\nThe reason for these implicit transform might come from [complex xml signature specification](https://www.w3.org/TR/2002/REC-xmldsig-core-20020212),\nwhich makes XML developers confused and then leads to incorrect implementation for signing XML document.\n\nIf you keep failing verification, it is worth trying to guess such a hidden transform and specify it to the option as below:\n\n```dart\nfinal option = {\n\t'implicitTransforms': ['http://www.w3.org/TR/2001/REC-xml-c14n-20010315']};\nfinal sig = SignedXml('', option)\n\t..keyInfoProvider = FileKeyInfo(\"client_public.pem\")\n\t..loadSignature(signature);\nfinal res = sig.checkSignature(xml);\n```\n\nYou might find it difficult to guess such transforms, but there are typical transforms you can try.\n\n- http://www.w3.org/TR/2001/REC-xml-c14n-20010315\n- http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\n- http://www.w3.org/2001/10/xml-exc-c14n#\n- http://www.w3.org/2001/10/xml-exc-c14n#WithComments\n\n## API\n\n### SignedXml\n\nThe `SignedXml` constructor provides an abstraction for sign and verify xml documents. The object is constructed using `new SignedXml([String idMode])` where:\n\n- `idMode` - if the value of `\"wssecurity\"` is passed it will create/validate id's with the ws-security namespace.\n\n*API*\n\nA `SignedXml` object provides the following methods:\n\nTo sign xml documents:\n\n- `void addReference(String? xpath, [List\u003cString\u003e? transforms, String? digestAlgorithm])` - adds a reference to a xml element where:\n    - `xpath` - a string containing a XPath expression referencing a xml element\n    - `transforms` - an array of [transform algorithms](#canonicalization-and-transformation-algorithms), the referenced element will be transformed for each value in the array\n    - `digestAlgorithm` - one of the supported [hashing algorithms](#hashing-algorithms)\n- `void computeSignature(String xml, {Map\u003cString, dynamic\u003e? options})` - compute the signature of the given xml where:\n    - `xml` - a string containing a xml document\n    - `options` - a map with the following properties:\n        - `prefix` - adds this value as a prefix for the generated signature tags\n        - `attrs` - a hash of attributes and values `attrName: value` to add to the signature root node\n        - `location` - customize the location of the signature, pass an object with a `reference` key which should contain a XPath expression to a reference node, an `action` key which should contain one of the following values: `append`, `prepend`, `before`, `after`\n        - `existingPrefixes` - A hash of prefixes and namespaces `prefix: namespace` that shouldn't be in the signature because they already exist in the xml \n- `String get signedXml` - returns the original xml document with the signature in it, **must be called only after `computeSignature`**\n- `String get signatureXml` - returns just the signature part, **must be called only after `computeSignature`**\n- `String get originalXmlWithIds` - returns the original xml with Id attributes added on relevant elements (required for validation), **must be called only after `computeSignature`**\n\nTo verify xml documents:\n\n- `void loadSignature(dynamic signatureXml)` - loads the signature where:\n    - `signatureXml` - a string or `XmlNode` object ([xml](https://pub.dev/packages/xml)) containing the xml representation of the signature\n- `bool checkSignature(String xml)` - validates the given xml document and returns true if the validation was successful, `sig.validationErrors` will have the validation errors if any, where:\n    - `xml` - a string containing a xml document\n\n\n### FileKeyInfo\n\nA basic key info provider implementation using `File(file).readAsBytesSync()`, is constructed using `new FileKeyInfo([file])` where:\n\n- `file` - a path to a pem encoded certificate\n\nSee [verifying xml documents](#verifying-xml-documents) for an example usage\n\n\n## Customizing Algorithms\nThe following sample shows how to sign a message using custom algorithms.\n\nFirst import some modules:\n\n`````dart\nimport 'package:xml_crypto/xml_crypto.dart';\n`````\n\n\nNow define the extension point you want to implement. You can choose one or more.\n\nA key info provider is used to extract and construct the key and the KeyInfo xml section.\nImplement it if you want to create a signature with a KeyInfo section, or you want to read your key in a different way then the default file read option.\n`````dart\n\tclass MyKeyInfo implements KeyInfoProvider {\n\t\t@override\n\t\tString getKeyInfo(Uint8List? signingKey, String? prefix) {\n\t\t\tprefix = prefix ?? '';\n\t\t\tprefix = prefix.isNotEmpty ? prefix + ':' : prefix;\n\t\t\treturn '\u003c' + prefix + \"X509Data\u003e\u003c/\" + prefix + 'X509Data\u003e';\n\t\t}\n\n\t\t@override\n\t\t//you can use the keyInfo parameter to extract the key in any way you want\n\t\tUint8List? getKey(String? keyInfo) =\u003e File(\"key.pem\").readAsBytesSync();\n\t}\n`````\n\nA custom hash algorithm is used to calculate digests. Implement it if you want a hash other than the default SHA1.\n\n`````dart\n\tclass MyDigest implements HashAlgorithm {\n\t\t@override\n\t\tString getHash(String xml) =\u003e 'the base64 hash representation of the given xml string'\n\n\t\t@override\n\t\tString get algorithmName =\u003e 'http://myDigestAlgorithm';\n\t}\n`````\n\nA custom signing algorithm. The default is RSA-SHA1\n`````dart\n\tclass MySignatureAlgorithm implements SignatureAlgorithm {\n\t\t/*sign the given SignedInfo using the key. return base64 signature value*/\n\t\t@override\n\t\tString getSignature(String xml, Uint8List signingKey, [CalculateSignatureCallback? callback])\n\t\t=\u003e 'signature of signedInfo as base64...';\n\n\t\t@override\n\t\tbool verifySignature(String xml, Uint8List key, String signatureValue, [ValidateSignatureCallback? callback]) \n\t\t=\u003e true;\n\n\t\t@override\n\t\tString get algorithmName =\u003e 'http://mySigningAlgorithm';\n\t}\n`````\n\nCustom transformation algorithm. The default is exclusive canonicalization.\n\n`````dart\n\tclass MyTransformation implements CanonicalizationAlgorithm\u003cString\u003e {\n\t\t/*given a node (from the xml module) return its canonical representation (as string)*/\n\t\t@override\n\t\tString process(XmlNode node, [Map\u003cString, dynamic\u003e options = const {}]) {\n\t\t\t//you should apply your transformation before returning\n\t\t\treturn node.toString();\n\t\t}\n\n\t\t@override\n\t\tString get algorithmName =\u003e 'http://myTransformation';\n\t}\n`````\nCustom canonicalization is actually the same as custom transformation. It is applied on the SignedInfo rather than on references.\n\n`````dart\n\tclass MyCanonicalization implements CanonicalizationAlgorithm\u003cString\u003e {\n\t\t/*given a node (from the xml module) return its canonical representation (as string)*/\n\t\t@override\n\t\tString process(XmlNode node, [Map\u003cString, dynamic\u003e options = const {}]) {\n\t\t\t//you should apply your transformation before returning\n\t\t\treturn '\u003c x/\u003e';\n\t\t}\n\n\t\t@override\n\t\tString get algorithmName =\u003e 'http://myCanonicalization';\n\t}\n`````\n\nNow you need to register the new algorithms:\n\n`````dart\n\t/*register all the custom algorithms*/\n\n\tSignedXml.canonicalizationAlgorithms[\"http://MyTransformation\"] = MyTransformation();\n\tSignedXml.canonicalizationAlgorithms[\"http://MyCanonicalization\"] = MyCanonicalization();\n\tSignedXml.cashAlgorithms[\"http://myDigestAlgorithm\"] = MyDigest();\n\tSignedXml.signatureAlgorithms[\"http://mySigningAlgorithm\"] = MySignatureAlgorithm();\n`````\n\nNow do the signing. Note how we configure the signature to use the above algorithms:\n\n`````dart\n\tvoid signXml(String xml, String xpath, String key, String dest) {\n\t\tfinal sig = SignedXml();\n\n\t\t/*configure the signature object to use the custom algorithms*/\n\t\tsig.signatureAlgorithm = \"http://mySignatureAlgorithm\";\n\t\tsig.keyInfoProvider = MyKeyInfo();\n\t\tsig.canonicalizationAlgorithm = \"http://MyCanonicalization\";\n\t\tsig.addReference(\"//*[local-name()='x']\", [\"http://MyTransformation\"], \"http://myDigestAlgorithm\");\n\n\t\tsig.signingKey = File(key).readAsBytesSync();\n\t\tsig.addReference(xpath);\n\t\tsig.computeSignature(xml);\n\t\tFile(dest).writeAsStringSync(sig.signedXml);\n\t}\n\n\tvoid main() {\n\t\tvar xml = \"\u003clibrary\u003e\"\n\t\t\t\t\"\u003cbook\u003e\"\n\t\t\t\t\"\u003cname\u003eHarry Potter\u003c/name\u003e\"\n\t\t\t\t\"\u003c/book\u003e\"\n\t\t\t\"\u003c/library\u003e\";\n\n\t\tsignXml(xml,\n\t\t\t\"//*[local-name()='book']\",\n\t\t\t\"client.pem\",\n\t\t\t\"result.xml\");\n\t}\n`````\n\nYou can always look at the actual code as a sample (or drop me a [mail](mailto:yaronn01@gmail.com)).\n\n## Asynchronous signing and verification\n\nIf the private key is not stored locally and you wish to use a signing server or Hardware Security Module (HSM) to sign documents you can create a custom signing algorithm that uses an asynchronous callback.\n\n`````dart\n\tclass AsyncSignatureAlgorithm implements SignatureAlgorithm {\n\t\t@override\n\t\tString getSignature(String xml, Uint8List signingKey, [CalculateSignatureCallback? callback]) {\n\t\t\tfinal rsa = RSAPrivateKey.fromPEM(utf8.decode(signingKey));\n\t\t\tfinal res = rsa.signSsaPkcs1v15ToBase64(utf8.encode(xml), hasher: EmsaHasher.sha1);\n\t\t\t//Do some asynchronous things here\n\t\t\tcallback?.call(null, res);\n\t\t\treturn '';\n\t\t}\n\n\t\t@override\n\t\tbool verifySignature(String xml, Uint8List key, String signatureValue, [ValidateSignatureCallback? callback]) =\u003e true;\n\n\t\t@override\n\t\tString get algorithmName =\u003e 'http://www.w3.org/2000/09/xmldsig#rsa-sha1';\n\t}\n\n\tSignedXml.signatureAlgorithms[\"http://asyncSignatureAlgorithm\"] = AsyncSignatureAlgorithm();\n\tfinal sig = SignedXml();\n\tsig.signatureAlgorithm = \"http://asyncSignatureAlgorithm\";\n\tsig.computeSignature(xml, opts: opts, callback: (err, _) {\n\t\tfinal signedResponse = sig.signedXml;\n\t});\n`````\n\nThe function `sig.checkSignature` may also use a callback if asynchronous verification is needed.\n\n## X.509 / Key formats\nPEM encoded certificates are supported. So to sign an xml use key.pem that looks like this (only the begining of the key content is shown):\n\n\t-----BEGIN PRIVATE KEY-----\n\tMIICdwIBADANBgkqhkiG9w0...\n\t-----END PRIVATE KEY-----\n\nAnd for verification use key_public.pem:\n\n\t-----BEGIN CERTIFICATE-----\n\tMIIBxDCCAW6gAwIBAgIQxUSX...\n\t-----END CERTIFICATE-----\n\n**Converting .pfx certificates to pem**\n\nIf you have .pfx certificates you can convert them to .pem using [openssl](https://www.openssl.org/):\n\n\topenssl pkcs12 -in yourcert.pfx -out cag.pem\n\nThen you could use the result as is for the purpose of signing. For the purpose of validation open the resulting .pem with a text editor and copy from -----BEGIN CERTIFICATE----- to  -----END CERTIFICATE----- (including) to a new text file and save it as .pem.\n\n## Examples\n\n- [how to sign a root node](#) *coming soon*\n\n### how to add a prefix for the signature\nUse the `prefix` option when calling `computeSignature` to add a prefix to the signature. \n`````dart\nimport 'dart:io';\n\nimport 'package:xml_crypto/xml_crypto.dart';\n\nfinal xml = \"\u003clibrary\u003e\"\n            \"\u003cbook\u003e\"\n              \"\u003cname\u003eHarry Potter\u003c/name\u003e\"\n            \"\u003c/book\u003e\"\n          \"\u003c/library\u003e\";\n\nfinal sig = SignedXml();\nsig.addReference(\"//*[local-name()='book']\");\nsig.signingKey = File(\"client.pem\").readAsBytesSync();\nsig.computeSignature(xml, opts: {\n  'prefix': 'ds'\n});\n`````\n\n### how to specify the location of the signature\nUse the `location` option when calling `computeSignature` to move the signature around. \nSet `action` to one of the following: \n- append(default) - append to the end of the xml document\n- prepend - prepend to the xml document\n- before - prepend to a specific node (use the `referenceNode` property)\n- after - append to specific node (use the `referenceNode` property)\n\n`````dart\nimport 'dart:io';\n\nimport 'package:xml_crypto/xml_crypto.dart';\n\nfinal xml = \"\u003clibrary\u003e\"\n            \"\u003cbook\u003e\"\n              \"\u003cname\u003eHarry Potter\u003c/name\u003e\"\n            \"\u003c/book\u003e\"\n          \"\u003c/library\u003e\";\n\nfinal sig = SignedXml();\nsig.addReference(\"//*[local-name()='book']\");\nsig.signingKey = File(\"client.pem\").readAsBytesSync();\nsig.computeSignature(xml, opts: {\n\t\"location\": {\n\t\t\"reference\": \"//*[local-name()='book']\",\n\t\t\"action\": \"after\" //This will place the signature after the book element\n\t}\n});\n`````\n*more examples coming soon*\n\n## Development\nThe test framework is [test](https://pub.dev/packages/test). To run tests use:\n\n    $\u003e dart test\n\n## More information\nVisit this original author's [blog](https://webservices20.blogspot.com/) or [twitter](https://twitter.com/#!/YaronNaveh)\n\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](LICENSE) file for more info.\n\n## Who Uses\n\n* [Quire](https://quire.io) - a simple, collaborative, multi-level task management tool.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikulo%2Fxml-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frikulo%2Fxml-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikulo%2Fxml-crypto/lists"}