Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6331501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:04:54+00:00 2026-05-24T18:04:54+00:00

I have search all over the web, but unable to find an answer, so

  • 0

I have search all over the web, but unable to find an answer, so I hope I can find one here.

I have a web application run on Windows and IIS written in Perl.
One of the scripts perfroms multiple tasks. One of them executes a command to encrypt a file. Here is the command:

my $cmd = "c:\\gnupg\\pub\\gpg -ase --always-trust --batch --passphrase mypassphrase --output $filename.pgp -r stuff $filename";

qx/$cmd/;

Unfortunately, this does not work.
The error I get is:

gpg: no default secret key: No secret key gpg: C:\\Dev\\somefile.csv: sign+encrypt failed: No secret key

When I am trying to run same command on same server from cmd it works fine.

From what I understand, when you run a scrip through web, it runs as anonymous user. So it does not see the secrey key generated as a local user. If I run the command locally through cmd it sees the secret key since it runs as a local user.

The question is: how do I solve this problem and make the scrip work?

Thank you,

-Andrey

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:04:55+00:00Added an answer on May 24, 2026 at 6:04 pm

    I FINALLY figured out how to solve this problem.
    The way I did it was:
    1. Export both public and secret keys as a local user.
    2. Import public key using web perl script.
    my $cmd = “c:\gnupg\pub\gpg –import c:\public.key”;
    qx/$cmd/;
    3. Do same to inport the secret key.

    I have to run the script once for each key so that the keys are created for web server user.
    After that my application started to worked flawlessly!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have search all over the web but could not find answer to this
I have search all over Stack Overflow site but I can find an answer
I have been search all over the net and couldn't find an appropriate solution
i have a search page in my site, where user can search all the
I have to search through a list and replace all occurrences of one element
In the Google Web History interface I can see all the search queries I
We have a web service which provides search over hotels. There is a problem
ALL, I tried to search the suggested threads here but to no availability. I
I've looked all over the web only to find ways to make searches insensitive
I have just taken over maintenance of a large web application which is over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.