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 __decryptUsingPassword(encryptedData) {
// optionally decrypt using a password
return password ? iocane.decryptWithPassword(encryptedData, password) : encryptedData;
})
.then(function __marshallHistoryToArray(decrypted) {
Credentials.createFromSecureContent = function(content, password) {
return iocane
.decryptWithPassword(unsignEncryptedContent(content), password)
.then((decryptedContent) => new Credentials(JSON.parse(decryptedContent)));
};
static fromSecureString(content, password) {
return iocane
.decryptWithPassword(unsignEncryptedContent(content), password)
.then(decryptedContent => JSON.parse(decryptedContent))
.then(
credentialsData =>
Array.isArray(credentialsData)
? new Credentials({ ...credentialsData[1], type: credentialsData[0] })
: new Credentials(credentialsData)
);
}