Why does PGP lock its keyrings?

Posted on 2005-05-17
Last Modified: 2010-04-11
I am trying to run 2 script-based data transfer jobs. The files transferred are sent to a remote Ftp site and are therefore encrypted in the scripts. Problem is... if the two jobs begin running at the same time and are set up to use the same private key to encrypt, one of them fails. It seems that PGP locks the key when it is using the key for encryption. Any ideas? Is there a work-around? We have a real setup with many such jobs and have encountered this problem.
Question by:kerzner
    LVL 27

    Accepted Solution

    You could create a temp folder for each job using encryption via pgp

    E.g. jobA copies the original pgp keyring to programs\jobA\temp
    advises pgp by comand line option to use the keyking in the obove folder
    after work is done deletes the copy...

    Or you could use some kind of mutual exclusion like a file that only exists if no job is currently running.

    E.g. as pseudo batchfile

    @echo off
    if not exists pgpunused.txt goto sleep
    del pgpunused.txt
    <<make some pgp operations>>
    echo 1 > pgpunused.txt
    goto end

    sleep 10
    goto start


    Here is the sleep command available:


    LVL 1

    Author Comment

    Tolomir, thanks for your help. I will use one of these two approaches. Thanks!


    Featured Post

    Superior storage. Superior surveillance.

    WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

    Join & Write a Comment

    Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
    This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now