public EncryptCommand() :
     base("Encrypt",
          "Encrypt standard input using the given sender private key and recipient public key. Prints two lines to standard output: first the nonce (hex), and then the box (hex).")
 {
     this.privateKeyField = this.CreatePrivateKeyField("privateKey");
     this.publicKeyField  = this.CreatePublicKeyField("publicKey");
 }
示例#2
0
        protected PrivateKeyField CreatePrivateKeyField(string key, bool required)
        {
            PrivateKeyField field = new PrivateKeyField(key, required);

            this.AddField(field);
            return(field);
        }
 public DecryptCommand() :
     base("Decrypt",
          "Decrypt standard input using the given recipient private key and sender public key. The nonce must be given on the command line, and the box (hex) on standard input. Prints the decrypted message to standard output.")
 {
     this.privateKeyField = this.CreatePrivateKeyField("privateKey");
     this.publicKeyField  = this.CreatePublicKeyField("publicKey");
     this.nonceField      = this.CreateByteArrayField("nonce");
 }
示例#4
0
 public SendE2ETextMessageCommand() :
     base("Send End-to-End Encrypted Text Message",
          "Encrypt standard input and send the message to the given ID. 'from' is the API identity and 'secret' is the API secret. Prints the message ID on success.")
 {
     this.threemaId       = this.CreateThreemaId("to");
     this.fromField       = this.CreateThreemaId("from");
     this.secretField     = this.CreateTextField("secret");
     this.privateKeyField = this.CreatePrivateKeyField("privateKey");
 }
 public SendE2EImageMessageCommand() :
     base("Send End-to-End Encrypted Image Message",
          "Encrypt standard input and send the message to the given ID. 'from' is the API identity and 'secret' is the API secret. Prints the message ID on success.")
 {
     this.toField         = this.CreateThreemaId("to", true);
     this.fromField       = this.CreateThreemaId("from", true);
     this.secretField     = this.CreateTextField("secret", true);
     this.privateKeyField = this.CreatePrivateKeyField("privateKey", true);
     this.imageFilePath   = this.CreateFolderField("imageFilePath", true);
 }
示例#6
0
 public SendE2EFileMessageCommand() :
     base("Send End-to-End Encrypted File Message",
          "Encrypt the file (and thumbnail) and send a file message to the given ID. 'from' is the API identity and 'secret' is the API secret. Prints the message ID on success.")
 {
     this.threemaId       = this.CreateThreemaId("to");
     this.fromField       = this.CreateThreemaId("from");
     this.secretField     = this.CreateTextField("secret");
     this.privateKeyField = this.CreatePrivateKeyField("privateKey");
     this.fileField       = this.CreateFileField("file");
     this.thumbnailField  = this.CreateFileField("thumbnail", false);
 }
 public DecryptAndDownloadCommand() :
     base("Decrypt and download",
          "Decrypt a box (box from the stdin) message and download (if the message is a image or file message) the file(s) to the defined directory")
 {
     this.threemaId         = this.CreateThreemaId("id");
     this.fromField         = this.CreateThreemaId("from");
     this.secretField       = this.CreateTextField("secret");
     this.privateKeyField   = this.CreatePrivateKeyField("privateKey");
     this.messageIdField    = this.CreateTextField("messageId");
     this.nonceField        = this.CreateByteArrayField("nonce");
     this.outputFolderField = this.CreateFolderField("outputFolder", false);
 }
示例#8
0
 public DerivePublicKeyCommand() :
     base("Derive Public Key", "Derive the public key that corresponds with the given private key.")
 {
     this.privateKeyField = this.CreatePrivateKeyField("privateKey");
 }