@@ -20,6 +20,7 @@ import {
20
20
} from '#utilities/logs/classLogMethods' ;
21
21
import { read , readStructured , write } from '#utilities/file' ;
22
22
import { cryptoIDVersion } from '#components/cryptoID/defaults' ;
23
+ import path from 'node:path' ;
23
24
import viat from '#crypto/cipherSuite/viat.js' ;
24
25
export class CryptoID {
25
26
constructor ( config , optionalArg ) {
@@ -107,6 +108,7 @@ export class CryptoID {
107
108
return decode ( decrypted ) ;
108
109
}
109
110
async exportKeypairs ( ) {
111
+ console . log ( 'keyExchangeKeypair' , this . keyExchangeKeypair ) ;
110
112
const keyExchangeKeypair = await this . cipherSuite . keyExchange . exportKeypair ( this . keyExchangeKeypair ) ;
111
113
const signatureKeypair = await this . cipherSuite . signature . exportKeypair ( this . signatureKeypair ) ;
112
114
return {
@@ -135,7 +137,8 @@ export class CryptoID {
135
137
}
136
138
async saveToFile ( fileName , fileLocation , encryptionPassword ) {
137
139
const binaryData = await this . exportBinary ( encryptionPassword ) ;
138
- const fullPath = `${ fileLocation } /${ fileName } ` ;
140
+ const fullPath = path . join ( fileLocation , fileName ) ;
141
+ // console.log('FILE WRITE', fullPath, binaryData, encryptionPassword);
139
142
return write ( fullPath , binaryData , 'binary' , true ) ;
140
143
}
141
144
async importFile ( filePath , encryptionPassword ) {
@@ -208,9 +211,9 @@ export async function cryptoID(config, optionalArg) {
208
211
}
209
212
export default cryptoID ;
210
213
// const dirname = currentPath(import.meta);
211
- const exampleCryptoIDExample = await cryptoID ( ) ;
214
+ // const exampleCryptoIDExample = await cryptoID();
212
215
// const encryptionPasswordExample = 'password';
213
- console . log ( await exampleCryptoIDExample . exportBinary ( 'password' ) ) ;
216
+ // console.log(await exampleCryptoIDExample.exportBinary());
214
217
// const exportedKeypairs = await exampleCryptoIDExample.exportKeypairs();
215
218
// console.log(exportedKeypairs);
216
219
// console.log(`Version: ${exampleProfileExample.version}`);
0 commit comments