xml_crypto
5.1.0, released 3 months ago by quire.io
Xml digital signature library for Dart for signing and verifying XML documents.
What it does
Allows you to sign XML documents and verify XML digital signatures using various canonicalization, transformation, hashing, and signature algorithms including RSA and ECDSA.
AI-written summary of version 5.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to create XML digital signatures for SOAP or other XML-based web services.
- You need to verify signed XML documents received from external clients or services.
Skip it when
- You are working with JSON data instead of XML.
- You do not require cryptographic XML signatures.
Strengths
- Supports multiple signature, hashing, and canonicalization algorithms (RSA, ECDSA, SHA, C14N).
- Port of the established Node.js xml-crypto library.
Weaknesses
- XML digital signature specifications can be complex and prone to subtle verification errors (implicit transforms, etc.).
- HMAC-SHA1 is disabled by default due to key confusion risks.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
Not documented
import 'dart:io';
import 'package:xml_crypto/xml_crypto.dart';
final xml = "<library>" \
"<book>" \
"<name>Harry Potter</name>" \
"</book>" \
"</library>";
final sig = SignedXml()
..addReference("//*[local-name()='book']")
..signingKey = File("client.pem").readAsBytesSync()
..computeSignature(xml);
File("signed.xml").writeAsStringSync(sig.signedXml);Alternatives
Packages that do the same job and could replace xml_crypto.
- crypto_keys
Library for signing, verifying, encrypting and decrypting using pointycastle.
71Compare - cryptography_plus
Cryptographic algorithms for encryption, signatures, key agreement, and hashing across platforms.
68Compare - cryptography
Cross‑platform cryptographic algorithms for Dart and Flutter.
67Compare - crypton
A simple Dart library for asymmetric encryption and digital signatures.
50Compare
Works with
Packages commonly used together with xml_crypto: ones it builds on, ones built on it, and its own family.
- cryptoxml_crypto depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- xmlxml_crypto depends on itFull-featured XML and XPath library for DOM parsing, SAX streaming, and fluent building.
- pointycastlexml_crypto depends on itA Dart library providing a wide range of cryptographic algorithms and primitives.
- basic_utilsxml_crypto depends on itCommon utility classes for Strings, Dates, X509, PKCS, Cryptography and HTTP requests.
- rsa_pkcsxml_crypto depends on itPrivacy-Enhanced Mail (PEM) parser for RSA, PKCS#1, PKCS#8, and X.509 formats
- ninjaxml_crypto depends on itCryptography library for Dart to encrypt, decrypt, sign, and verify messages using RSA and AES.