Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(function __encryptUsingPassword(encryptedData) {
return password ? iocane.encryptWithPassword(encryptedData, password) : encryptedData;
})
.then(function __encryptUsingKeyFile(encryptedData) {
toSecureString(masterPassword) {
if (typeof masterPassword !== "string") {
return Promise.reject(new Error("Master password must be a string"));
}
return iocane.encryptWithPassword(this.toInsecureString(), masterPassword).then(signEncryptedContent);
}
}
convertToSecureContent(masterPassword) {
if (typeof masterPassword !== "string") {
throw new Error("Master password must be a string");
}
return iocane
.encryptWithPassword(JSON.stringify(this.model.getData()), masterPassword)
.then(signEncryptedContent);
}