Exemplo n.º 1
0
 openDemo: function(callback) {
     var password = kdbxweb.ProtectedValue.fromString('demo');
     var credentials = new kdbxweb.Credentials(password);
     var demoFile = kdbxweb.ByteUtils.arrayToBuffer(kdbxweb.ByteUtils.base64ToBytes(demoFileData));
     kdbxweb.Kdbx.load(demoFile, credentials, (function(db) {
         this.db = db;
         this.set('name', 'Demo');
         this.readModel();
         this.setOpenFile({passwordLength: 4, demo: true});
         callback();
     }).bind(this));
 },
Exemplo n.º 2
0
 addCustomIcon: function(iconData) {
     const uuid = kdbxweb.KdbxUuid.random();
     this.db.meta.customIcons[uuid] = kdbxweb.ByteUtils.arrayToBuffer(kdbxweb.ByteUtils.base64ToBytes(iconData));
     return uuid.toString();
 },