How to use the @liskhq/lisk-cryptography.signMessageWithPassphrase function in @liskhq/lisk-cryptography

To help you get started, we’ve selected a few @liskhq/lisk-cryptography examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-sdk / test / utils / cryptography.ts View on Github external
it('should call signMessageWithPassphrase', () => {
			cryptography.signMessage(input);
			return expect(
				cryptographyModule.signMessageWithPassphrase,
			).to.be.calledWithExactly(input.message, input.passphrase);
		});
	});
github LiskHQ / lisk-sdk / commander / src / utils / cryptography.ts View on Github external
export const signMessage = ({ message, passphrase }: SignMessageInputs) =>
	cryptography.signMessageWithPassphrase(message, passphrase);
github LiskHQ / lisk-sdk / commander / src / commands / message / sign.ts View on Github external
const processInputs = (message?: string) => ({
	passphrase,
	data,
}: InputFromSourceOutput) => {
	const targetMessage = message || data;
	if (!targetMessage) {
		throw new ValidationError('No message was provided.');
	}
	if (!passphrase) {
		throw new ValidationError('No passphrase was provided.');
	}

	return signMessageWithPassphrase(targetMessage, passphrase);
};