Skip to content

Commit

Permalink
fix(sdk): Remove stray call to node:Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
dmihalcik-virtru committed Oct 22, 2024
1 parent 9637022 commit a616e67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tdf3/src/models/assertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { canonicalizeEx } from 'json-canonicalize';
import { SignJWT, jwtVerify } from 'jose';
import { AssertionKey } from './../client/AssertionConfig.js';
import { ConfigurationError, InvalidFileError } from '../../../src/errors.js';
import { hex } from 'src/encodings/index.js';

export type AssertionKeyAlg = 'RS256' | 'HS256';
export type AssertionType = 'handling' | 'other';
Expand Down Expand Up @@ -47,7 +48,7 @@ export async function hash(this: Assertion): Promise<string> {
const result = canonicalizeEx(this, { exclude: ['binding', 'hash', 'sign', 'verify'] });

const hash = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(result));
return Buffer.from(hash).toString('hex');
return hex.encodeArrayBuffer(hash);
}

/**
Expand Down

0 comments on commit a616e67

Please sign in to comment.