@transmute/cose
Advanced tools
Comparing version 0.0.4 to 0.0.5
/// <reference types="node" /> | ||
declare const cose: { | ||
binToHex: (bytes: any) => any; | ||
hexToBin: (hexString: string) => Uint8Array; | ||
cbor: { | ||
@@ -13,3 +15,3 @@ web: typeof import("cbor-web"); | ||
inclusion_proof: ({ log_id, leaf_index, leaves, signer, }: import("./types").RequestInclusionProof) => Promise<Uint8Array>; | ||
verify_inclusion_proof: ({ leaf, signed_inclusion_proof, verifier, }: import("./types").RequestInclusionProofVerification) => Promise<boolean>; | ||
verify_inclusion_proof: ({ leaf, signed_inclusion_proof, verifier, }: import("./types").RequestInclusionProofVerification) => Promise<Uint8Array>; | ||
consistency_proof: ({ log_id, leaves, signed_inclusion_proof, signer, }: import("./types").RequestConsistencyProof) => Promise<Buffer>; | ||
@@ -16,0 +18,0 @@ verify_consistency_proof: ({ old_root, signed_consistency_proof, verifier, }: import("./types").RequestConsistencyProofVerification) => Promise<boolean>; |
@@ -28,3 +28,6 @@ "use strict"; | ||
const attachPayload_1 = __importDefault(require("./attachPayload")); | ||
const rfc9162_1 = require("@transmute/rfc9162"); | ||
const cose = { | ||
binToHex: rfc9162_1.RFC9162.binToHex, | ||
hexToBin: rfc9162_1.RFC9162.hexToBin, | ||
cbor: cbor_1.default, | ||
@@ -31,0 +34,0 @@ merkle: merkle_1.default, |
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
inclusion_proof: ({ log_id, leaf_index, leaves, signer, }: import("..").RequestInclusionProof) => Promise<Uint8Array>; | ||
verify_inclusion_proof: ({ leaf, signed_inclusion_proof, verifier, }: import("..").RequestInclusionProofVerification) => Promise<boolean>; | ||
verify_inclusion_proof: ({ leaf, signed_inclusion_proof, verifier, }: import("..").RequestInclusionProofVerification) => Promise<Uint8Array>; | ||
consistency_proof: ({ log_id, leaves, signed_inclusion_proof, signer, }: import("..").RequestConsistencyProof) => Promise<Buffer>; | ||
@@ -10,0 +10,0 @@ verify_consistency_proof: ({ old_root, signed_consistency_proof, verifier, }: import("..").RequestConsistencyProofVerification) => Promise<boolean>; |
import { RequestInclusionProofVerification } from '../types'; | ||
export declare const verify_inclusion_proof: ({ leaf, signed_inclusion_proof, verifier, }: RequestInclusionProofVerification) => Promise<boolean>; | ||
export declare const verify_inclusion_proof: ({ leaf, signed_inclusion_proof, verifier, }: RequestInclusionProofVerification) => Promise<Uint8Array>; |
@@ -28,13 +28,6 @@ "use strict"; | ||
}); | ||
if (validated_root === false) { | ||
return false; | ||
} | ||
const attached = (0, attachPayload_1.default)(signed_inclusion_proof, validated_root); | ||
const verified_root = yield verifier.verify(attached); | ||
if (verified_root) { | ||
// console.log(verified_root) | ||
return true; | ||
} | ||
return false; | ||
return verified_root; | ||
}); | ||
exports.verify_inclusion_proof = verify_inclusion_proof; |
{ | ||
"name": "@transmute/cose", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "COSE and related work.", | ||
@@ -43,3 +43,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@transmute/rfc9162": "^0.0.2", | ||
"@transmute/rfc9162": "^0.0.3", | ||
"cbor-web": "^9.0.0", | ||
@@ -46,0 +46,0 @@ "cose-js": "^0.8.4", |
@@ -10,3 +10,7 @@ import signer from './signer' | ||
import { RFC9162 } from '@transmute/rfc9162' | ||
const cose = { | ||
binToHex: RFC9162.binToHex, | ||
hexToBin: RFC9162.hexToBin, | ||
cbor, | ||
@@ -13,0 +17,0 @@ merkle, |
@@ -24,12 +24,5 @@ import { CoMETRE } from '@transmute/rfc9162' | ||
) | ||
if (validated_root === false) { | ||
return false | ||
} | ||
const attached = attachPayload(signed_inclusion_proof, validated_root) | ||
const verified_root = await verifier.verify(attached) | ||
if (verified_root) { | ||
// console.log(verified_root) | ||
return true | ||
} | ||
return false | ||
return verified_root | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70727
1304
+ Added@transmute/rfc9162@0.0.3(transitive)
- Removed@transmute/rfc9162@0.0.2(transitive)
Updated@transmute/rfc9162@^0.0.3