Gathering detailed insights and metrics for cose-js
Gathering detailed insights and metrics for cose-js
Gathering detailed insights and metrics for cose-js
Gathering detailed insights and metrics for cose-js
npm install cose-js
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
30 Stars
182 Commits
26 Forks
2 Watchers
9 Branches
9 Contributors
Updated on Apr 16, 2025
Latest Version
0.9.0
Package Id
cose-js@0.9.0
Unpacked Size
827.36 kB
Size
121.70 kB
File Count
348
NPM Version
8.5.5
Node Version
17.8.0
Published on
Sep 22, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
JavaScript implementation of COSE, RFC8152
1const cose = require('cose-js'); 2try { 3 const plaintext = 'Important message!'; 4 const headers = { 5 p: { alg: 'SHA-256_64' }, 6 u: { kid: 'our-secret' } 7 }; 8 const recipent = { 9 key: Buffer.from('231f4c4d4d3051fdc2ec0a3851d5b383', 'hex') 10 }; 11 const buf = await cose.mac.create(headers, plaintext, recipent); 12 console.log('MACed message: ' + buf.toString('hex')); 13} catch (error) { 14 console.log(error); 15}
1const cose = require('cose-js'); 2try { 3 const key = Buffer.from('231f4c4d4d3051fdc2ec0a3851d5b383', 'hex'); 4 const COSEMessage = Buffer.from('d18443a10104a1044a6f75722d73656372657472496d706f7274616e74206d65737361676521488894981d4aa5d614', 'hex'); 5 const buf = await cose.mac.read(COSEMessage, key); 6 console.log('Verified message: ' + buf.toString('utf8')); 7} catch (error) { 8 console.log(error); 9}
1const cose = require('cose-js'); 2try { 3 const plaintext = 'Important message!'; 4 const headers = { 5 p: { alg: 'ES256' }, 6 u: { kid: '11' } 7 }; 8 const signer = { 9 key: { 10 d: Buffer.from('6c1382765aec5358f117733d281c1c7bdc39884d04a45a1e6c67c858bc206c19', 'hex') 11 } 12 }; 13 const buf = await cose.sign.create(headers, plaintext, signer); 14 console.log('Signed message: ' + buf.toString('hex')); 15} catch (error) { 16 console.log(error); 17}
1const cose = require('cose-js'); 2try { 3 const verifier = { 4 key: { 5 x: Buffer.from('143329cce7868e416927599cf65a34f3ce2ffda55a7eca69ed8919a394d42f0f', 'hex'), 6 y: Buffer.from('60f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168db9529971a36e7b9', 'hex') 7 } 8 }; 9 const COSEMessage = Buffer.from('d28443a10126a10442313172496d706f7274616e74206d6573736167652158404c2b6b66dfedc4cfef0f221cf7ac7f95087a4c4245fef0063a0fd4014b670f642d31e26d38345bb4efcdc7ded3083ab4fe71b62a23f766d83785f044b20534f9', 'hex'); 10 const buf = await cose.sign.verify(COSEMessage, verifier); 11 console.log('Verified message: ' + buf.toString('utf8')); 12} catch (error) { 13 console.log(error); 14}
1const cose = require('cose-js'); 2try { 3 const plaintext = 'Secret message!'; 4 const headers = { 5 p: { alg: 'A128GCM' }, 6 u: { kid: 'our-secret' } 7 }; 8 const recipient = { 9 key: Buffer.from('231f4c4d4d3051fdc2ec0a3851d5b383', 'hex') 10 }; 11 const buf = await cose.encrypt.create(headers, plaintext, recipient); 12 console.log('Encrypted message: ' + buf.toString('hex')); 13} catch (error) { 14 console.log(error); 15}
1const cose = require('cose-js'); 2try { 3 const key = Buffer.from('231f4c4d4d3051fdc2ec0a3851d5b383', 'hex'); 4 const COSEMessage = Buffer.from('d8608443a10101a2044a6f75722d736563726574054c291a40271067ff57b1623c30581f23b663aaf9dfb91c5a39a175118ad7d72d416385b1b610e28b3b3fd824a397818340a040', 'hex'); 5 const buf = await cose.encrypt.read(COSEMessage, key); 6 console.log('Protected message: ' + buf.toString('utf8')); 7} catch (error) { 8 console.log(error); 9}
npm install cose-js --save
npm test
No vulnerabilities found.
Reason
no vulnerabilities detected
Reason
no dangerous workflow patterns detected
Reason
tokens are read-only in GitHub workflows
Reason
license file detected
Details
Reason
all dependencies are pinned
Details
Reason
no binaries found in the repo
Reason
update tool detected
Details
Reason
GitHub code reviews found for 6 commits out of the last 30 -- score normalized to 2
Details
Reason
0 commit(s) out of 30 and 0 issue activity out of 21 found in the last 90 days -- score normalized to 0
Reason
no badge detected
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Reason
project is not fuzzed
Score
Last Scanned on 2022-08-15
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More