Sponsored Content
Top Forums Shell Programming and Scripting How to use gpg to encrypt data in batch/non-interactive mode? Post 302951035 by calredd on Friday 31st of July 2015 02:37:12 PM
Old 07-31-2015
I tried with --yes option without success.

Code:
$ gpg --yes --output test.gpg --encrypt --recipient janedoe@abc.com test.out
gpg: FC8B84A4: There is no assurance this key belongs to the named user

pub  2048g/FC8B84A4 2006-05-16 jdoe@abc.com <janedoe@abc.com>
 Primary key fingerprint: 3D8A 4A1C 2E78 386D B127  C705 47B3 C177 6E2B 6A83
      Subkey fingerprint: 85C9 A419 B16C 4815 3C65  D8C3 A11E 62A3 FC8B 84A4

It is NOT certain that the key belongs to the person named
in the user ID.  If you *really* know what you are doing,
you may answer the next question with yes.

Use this key anyway? (y/N) y

Moderator's Comments:
Mod Comment Please use CODE tags; not ICODE tags for full line and for multi-line sample input, output, and code segments.

Last edited by Don Cragun; 07-31-2015 at 07:27 PM.. Reason: Change ICODE tags to CODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Interactive Mode?

:confused: Can anyone please tell me how to get into Interactive Mode? (2 Replies)
Discussion started by: Nomad
2 Replies

2. Shell Programming and Scripting

Perl Interactive mode

Hi All, Does perl has an interactive mode like other shell? If there is, can any one show me the equivalent code for the below csh script ? This csh code prompts user for their name and prints the name. #!/bin/csh echo -n "Pls enter the your name: " set name = ($<) echo "You hav... (2 Replies)
Discussion started by: Raynon
2 Replies

3. UNIX for Dummies Questions & Answers

Regarding interactive ID of batch job

Hi all, We are running a batch job using Unix script. This batch job is running daily to get data from a Mainframe database and to load our tables. We are using an interactive ID for the batch job. If we removed that interactive ID, the batch job fails. What's my question is.. Is the... (1 Reply)
Discussion started by: pradeep.edara
1 Replies

4. UNIX for Advanced & Expert Users

SU command in non interactive mode

Can i run the SU command in a non interactive mode. What i want to do is to pass the username and the password as commandline or batch parameters. Please let me if its possible and how to pass them. A sample file will be appreciated. Thanks, (6 Replies)
Discussion started by: rohitag
6 Replies

5. Shell Programming and Scripting

script to non interactive mode

Gud morning everybody, I need small help form you people,Please advice me. I have a utility(adpatch) which takes 10-15 prompts, i want to automate this by calling this utility in shell script. Now my qiestion i want to run the script in non interactive mode. An example. $adpatch... (1 Reply)
Discussion started by: swetham.apps
1 Replies

6. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

7. Shell Programming and Scripting

shell script encrypt a file using gpg

Hi, I have a requirement to encrypt a file using gpg with a public key. However when i encrypt a file, i get a question like 'Do you want to go ahead with unverified user?' . when i press 'y' file is encrypted. I am not able to automate this job because of this interactive mode. Could... (3 Replies)
Discussion started by: Deepakbabu
3 Replies

8. UNIX for Advanced & Expert Users

sudo in non interactive mode

Hi , I login to unix using my id and then do a sudo to execute any programs i want. sudo su - <id> password : xxxxxxx Is there a way to make it non interactive so that i can use it in shell script. (1 Reply)
Discussion started by: ashwin3086
1 Replies

9. Shell Programming and Scripting

SFTPing non-interactive mode

Hi All, I need to sftp without any intervention.(LInux,Ksh) I have tried some ideas listed here...but its not working... Please advise on it. (1 Reply)
Discussion started by: jesu
1 Replies

10. UNIX for Beginners Questions & Answers

Batch processing files through an interactive script

I am newish to the site and to unix. I have a functioning interactive script running on Mac that sorts and processes files located in an unsorted folder on my desktop. As it currently stands, the user types jpg into the command line, the script executes and iterates through the unsorted... (8 Replies)
Discussion started by: Braveheart
8 Replies
Mail::GnuPG(3pm)					User Contributed Perl Documentation					  Mail::GnuPG(3pm)

NAME
Mail::GnuPG - Process email with GPG. SYNOPSIS
use Mail::GnuPG; my $mg = new Mail::GnuPG( key => 'ABCDEFGH' ); $ret = $mg->mime_sign( $MIMEObj, 'you@my.dom' ); DESCRIPTION
Use GnuPG::Interface to process or create PGP signed or encrypted email. new Create a new Mail::GnuPG instance. Arguments: Paramhash... key => gpg key id keydir => gpg configuration/key directory passphrase => primary key password use_agent => use gpg-agent if non-zero always_trust => always trust a public key # FIXME: we need more things here, maybe primary key id. decrypt Decrypt an encrypted message Input: MIME::Entity containing email message to decrypt. The message can either be in RFC compliant-ish multipart/encrypted format, or just a single part ascii armored message. Output: On Failure: Exit code of gpg. (0 on success) On Success: (just encrypted) (0, undef, undef) On success: (signed and encrypted) ( 0, keyid, # ABCDDCBA emailaddress # Foo Bar <foo@bar.com> ) where the keyid is the key that signed it, and emailaddress is full name and email address of the primary uid $self->{last_message} => any errors from gpg $self->{plaintext} => plaintext output from gpg $self->{decrypted} => parsed output as MIME::Entity get_decrypt_key determines the decryption key (and corresponding mail) of a message Input: MIME::Entity containing email message to analyze. The message can either be in RFC compliant-ish multipart/signed format, or just a single part ascii armored message. Output: $key -- decryption key $mail -- corresponding mail address verify verify a signed message Input: MIME::Entity containing email message to verify. The message can either be in RFC compliant-ish multipart/signed format, or just a single part ascii armored message. Note that MIME-encoded data should be supplied unmodified inside the MIME::Entity input message, otherwise the signature will be broken. Since MIME-tools version 5.419, this can be achieved with the C<decode_bodies> method of MIME::Parser. See the MIME::Parser documentation for more information. Output: On error: Exit code of gpg. (0 on success) On success ( 0, keyid, # ABCDDCBA emailaddress # Foo Bar <foo@bar.com> ) where the keyid is the key that signed it, and emailaddress is full name and email address of the primary uid $self->{last_message} => any errors from gpg has_public_key Does the keyring have a public key for the specified email address? FIXME: document better. talk about caching. maybe put a better interface in. mime_sign sign an email message Input: MIME::Entity containing email message to sign Output: Exit code of gpg. (0 on success) $self->{last_message} => any errors from gpg The provided $entity will be signed. (i.e. it _will_ be modified.) clear_sign clearsign the body of an email message Input: MIME::Entity containing email message to sign. This entity MUST have a body. Output: Exit code of gpg. (0 on success) $self->{last_message} => any errors from gpg The provided $entity will be signed. (i.e. it _will_ be modified.) ascii_encrypt encrypt an email message body using ascii armor Input: MIME::Entity containing email message to encrypt. This entity MUST have a body. list of recipients Output: Exit code of gpg. (0 on success) $self->{last_message} => any errors from gpg The provided $entity will be encrypted. (i.e. it _will_ be modified.) ascii_signencrypt encrypt and sign an email message body using ascii armor Input: MIME::Entity containing email message to encrypt. This entity MUST have a body. list of recipients Output: Exit code of gpg. (0 on success) $self->{last_message} => any errors from gpg The provided $entity will be encrypted. (i.e. it _will_ be modified.) mime_encrypt encrypt an email message Input: MIME::Entity containing email message to encrypt list of email addresses to sign to Output: Exit code of gpg. (0 on success) $self->{last_message} => any errors from gpg The provided $entity will be encrypted. (i.e. it _will_ be modified.) mime_signencrypt sign and encrypt an email message Input: MIME::Entity containing email message to sign encrypt list of email addresses to sign to Output: Exit code of gpg. (0 on success) $self->{last_message} => any errors from gpg The provided $entity will be encrypted. (i.e. it _will_ be modified.) is_signed best guess as to whether a message is signed or not (by looking at the mime type and message content) Input: MIME::Entity containing email message to test Output: True or False value is_encrypted best guess as to whether a message is signed or not (by looking at the mime type and message content) Input: MIME::Entity containing email message to test Output: True or False value LICENSE
Copyright 2003 Best Practical Solutions, LLC This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; version 2 http://www.opensource.org/licenses/gpl-license.php b) the "Artistic License" http://www.opensource.org/licenses/artistic-license.php This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. AUTHOR
Robert Spier David Bremner <ddb@cpan.org> BUGS
/ISSUES/PATCHES Please send all bugs/issues/patches to bug-Mail-GnuPG@rt.cpan.org SEE ALSO
perl. GnuPG::Interface, MIME::Entity perl v5.14.2 2011-12-12 Mail::GnuPG(3pm)
All times are GMT -4. The time now is 11:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy