pkcs7
1.0.6, released 2 years ago by nfet.net
Parse, generate, and verify PKCS#7 messages and X509 certificates
What it does
The pkcs7 package provides a simple API to parse and build PKCS#7 messages, generate X509 certificates, and verify signatures. It supports SM3 OID and can handle S‑mime messages.
AI-written summary of version 1.0.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to create or verify PKCS#7 or S‑mime messages in a Dart/Flutter app
- You need to parse X509 certificates from PEM and work with their properties
- You want a lightweight, cross‑platform crypto helper without external build steps
Skip it when
- You require high‑performance or hardware‑accelerated cryptography
- You need a full TLS/SSL stack or certificate authority management
Strengths
- Cross‑platform support (Android, iOS, web, desktop)
- Simple imperative API
- SM3 OID support added in 1.0.6
- No build_runner or codegen required
Weaknesses
- Limited to PKCS#7/S‑mime only
- No async or streaming API
- Relies on pointycastle for crypto, which may be heavy for some use cases
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
final cert = X509.fromPem(CA);
print(cert.pem);
final pkcs7Builder = Pkcs7Builder();
pkcs7Builder.addCertificate(cert);
final signerInfo = Pkcs7SignerInfoBuilder.rsa(issuer: issuer, privateKey: privateKey);
signerInfo.addSMimeDigest(digest: hash);
final pkcs7 = pkcs7Builder.build();
print(pkcs7.pem);Alternatives
Packages that do the same job and could replace pkcs7.
- webcrypto
Cross-platform implementation of Web Cryptography APIs for Dart.
89Compare - conventional_commit
Parse a git commit message using the Conventional Commits specification.
74Compare - msgpack_dart
MessagePack implementation for Dart
50Compare - uuid_type
Provides UUID parsing, generation (v1, v4, v5) and comparison for Dart.
59Compare
Works with
Packages commonly used together with pkcs7: ones it builds on, ones built on it, and its own family.
- pointycastlepkcs7 depends on itA Dart library providing a wide range of cryptographic algorithms and primitives.
- pempkcs7 depends on itPEM encoding and decoding of textual keys and certificates following RFC 7468.
- passkitBuilt on pkcs7Pure Dart library to create and read Apple PkPass and order files for Apple Wallet.