Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cose Lib Laravel Package

web-auth/cose-lib

PHP 8.1+ COSE (RFC 9052/9053) library: sign, encrypt, and MAC with full tag support (Sign1/Sign, Encrypt0/Encrypt, Mac0/Mac). Supports ECDSA, EdDSA, RSA, and HMAC. Compatible with WebAuthn/FIDO2.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

Feature Development

  • Digital Identity & Authentication:

    • Enable WebAuthn/FIDO2 attestation and assertion signatures (e.g., for passwordless authentication).
    • Support EU Digital COVID Certificate verification for health pass integrations.
    • Build compact, interoperable signatures for IoT devices (e.g., constrained environments with CBOR).
  • Security & Compliance:

    • Replace legacy JWT/RSA signatures with COSE-based signatures for modern cryptographic agility (e.g., post-quantum readiness via EdDSA).
    • Implement selective disclosure for privacy-preserving claims (e.g., age verification without full identity exposure).
    • Enable verifiable credentials (W3C VC) with COSE for decentralized identity systems.
  • API & Microservices Security:

    • Secure service-to-service communication with COSE-encrypted payloads (alternative to TLS for message-level encryption).
    • Add MAC-based integrity checks for high-assurance APIs (e.g., financial transactions).

Roadmap Prioritization

  • Build vs. Buy:
    • Buy: Use this package to avoid reinventing COSE/RFC 9052/9053 compliance (saves 3–6 months of dev effort).
    • Build: Only if needing custom COSE extensions (e.g., proprietary algorithms) or performance optimizations for niche use cases.
  • Phased Rollout:
    • Phase 1: Pilot with WebAuthn or health certificates (low-risk, high-impact).
    • Phase 2: Expand to internal APIs or document signing (higher complexity).

Use Cases

Use Case COSE Feature Business Value
FIDO2/WebAuthn COSE_Sign1 (ES256/EdDSA) Seamless passwordless auth, compliance.
EU Digital COVID Certs COSE_Sign1 (ES256) Mandatory interoperability, no reinvention.
IoT Device Auth COSE_Mac0 (HS256) Lightweight auth for constrained devices.
Verifiable Credentials COSE_Sign (multi-signature) Decentralized identity, W3C compliance.
API Security COSE_Encrypt0 (AES-KW) Message-level encryption beyond TLS.

When to Consider This Package

Adopt This Package If:

  • You need RFC 9052/9053 compliance for COSE (e.g., WebAuthn, health certs, IoT).
  • Your team lacks CBOR/cryptography expertise (library handles serialization/algorithms).
  • You require interoperability with existing COSE ecosystems (e.g., EU DCC gateways).
  • You’re using PHP 8.1+ and can tolerate minor dependency bloat (spomky-labs/cbor-php).
  • Your use case fits signing, MAC, or encryption (not custom COSE extensions).

Look Elsewhere If:

  • You need post-quantum algorithms (this package lacks CRYSTALS-Kyber/Dilithium; track RFC 9180).
  • Your stack is not PHP (e.g., Python: cose-py, JavaScript: cose-js).
  • You require hardware-backed COSE (e.g., HSMs; this is software-only).
  • You’re building a custom COSE profile (e.g., proprietary tags/algorithms).
  • Your team prefers minimal dependencies (this adds cbor-php, pki-framework).

How to Pitch It (Stakeholders)

For Executives:

"COSE is the future of digital signatures—like JWT but modern, compact, and interoperable. This PHP library lets us:

  • Comply with EU health certs without building from scratch (saves €X in dev time).
  • Enable passwordless auth (FIDO2) for better UX and security.
  • Secure IoT/APIs with lightweight cryptography (reduces attack surface). It’s a ‘buy’ vs. ‘build’ win: MIT-licensed, RFC-compliant, and battle-tested in health/identity systems."

For Engineering:

"This is a drop-in COSE library for PHP 8.1+ that:

  • Supports all COSE tags (Sign1, Sign, Encrypt0, Mac0) and 15+ algorithms (ECDSA, EdDSA, RSA, HMAC).
  • Integrates with OpenSSL for verification (no custom crypto needed).
  • Works with CBOR (via spomky-labs/cbor-php) for compact payloads. Use cases:
  • Replace JWTs with COSE for smaller, faster signatures (e.g., WebAuthn).
  • Verify EU Digital COVID Certificates in 2 lines of code.
  • Secure APIs/IoT with COSE_Encrypt0 or COSE_Mac0. Tradeoffs:
  • Adds ~2MB to your vendor dir (cbor-php + dependencies).
  • Requires PHP 8.1+ (strict types). Recommendation: Pilot with FIDO2 or health certs first."**

For Security Teams:

"COSE addresses critical gaps in modern cryptography:

  • Smaller attack surface than JWT (no base64url, no custom parsing).
  • Algorithm agility (swap ES256 for EdDSA without breaking changes).
  • Interoperability with EU DCC, FIDO2, and emerging standards. Risks:
  • Dependency on cbor-php (audit for vulnerabilities).
  • No post-quantum support (monitor RFC 9180 for updates). Mitigation: Use EdDSA (Ed25519) for long-term signatures and HMAC-SHA384 for MACs."**
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests