blob: f1b5cb39786c40f77279f5e7be0b659a359b5b8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import cbor from 'cbor';
/**
* Convert an extension data buffer to a proper object
*
* @param extensionDataBuffer Extension Data buffer
*/
export default function decodeExtensionDataBuffer(extensionDataBuffer: Buffer): ExtensionsJSON {
const toCBOR: ExtensionsJSON = cbor.decodeAllSync(extensionDataBuffer)[0];
return toCBOR;
}
export type ExtensionsJSON = {
dpk?: Buffer;
scp?: Buffer;
sig?: string;
aaguid?: Buffer;
};
|