/
verify.command.ts
50 lines (45 loc) 路 1.26 KB
/
verify.command.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import verify from "@sebastienrousseau/crypto-lib/dist/lib/verify";
import prompts from "prompts";
const handleVerify = async () => {
const responseVerify = await prompts([
{
type: "text",
name: "message",
message: "Provide a message to be verified.",
},
{
type: "text",
name: "verificationKeys",
message:
"Provide an array of publicKeys or single key, to verify signatures in base64 format",
},
{
type: "text",
name: "date",
message:
"Provide an ISO Date string formatted date to verify message. If not provided, current date will be used. (YYYY-MM-DDTHH:mm:ss.sssZ)",
},
]);
console.log(responseVerify);
const data = {
message: responseVerify.message,
verificationKeys: responseVerify.verificationKeys,
date: new Date(),
};
if (
responseVerify.message === "" ||
responseVerify.verificationKeys === "" ||
responseVerify.date === ""
) {
console.error(
"\n馃敂 You must provide a value for each of the properties.\n",
);
} else {
console.log(data);
await verify(data);
}
};
export default handleVerify;
// # sourceMappingURL=verify.command.js.map
// Language: typescript
// path: packages/crypto-cli/src/commands/verify.command.ts