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 8522923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:15:54+00:00 2026-06-11T07:15:54+00:00

i have noticed when using python gnupg, that if i sign some data and

  • 0

i have noticed when using python gnupg, that if i sign some data and save the signed data to a file using pickle, lots of data gets saved along with the signed data. one of these things is a timestamp in unix time, for example the following line is part of a timestamp:

p24
sS'timestamp'
p25
V1347364912

the documentation does not mention any of this, which makes me a little confused. after loading in the file using pickle, i can’t see any mention of the timestamp or any way to return the value. but if pickle is saving it, it must be part of the python object. does this mean there should be a way i can get to this information in python? i would also like to utilise this data, which i can maybe do by reading in the file itself but am looking for a cleaner way to do it using the gnupg module.

  • 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-06-11T07:15:56+00:00Added an answer on June 11, 2026 at 7:15 am

    gnupg isn’t very well documented but if you Inspect it you will see there are attributes besides the ones normally used…

    #234567891123456789212345678931234567894123456789512345678961234567897123456789
    
    # core
    import inspect
    import pickle
    import datetime
    
    # 3rd party
    import gnupg
    
    
    def depickle():
        """ pull and depickle our signed data """
        f = open('pickle.txt', 'r')
        signed_data = pickle.load(f)
        f.close()
        return signed_data
    
    # depickle our signed data
    signed_data = depickle()
    # inspect the object
    for key, value in inspect.getmembers(signed_data):
        print key
    

    One of them is your timestamp… aptly named timestamp. Now that you know it you can use it easily enough…

    # use the attribute now that we know it
    print signed_data.timestamp
    # make it pretty
    print datetime.datetime.fromtimestamp(float(signed_data.timestamp))
    

    That felt long winded but I thought this discussion would benefit from documenting the use of inspect to identify the undocumented attributes instead of just saying “use signed_data.timestamp”.

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

Sidebar

Related Questions

I have some data that uses unixtime . I'm using Python and MySQL. I
I have noticed that when using actionBar.setSelectedNavigationItem(x) in the onCreate() method of my Activity,
I am using jquery cluetip and i have noticed taht in some cases the
Using Dalvic Debug Monitor I have noticed that slight pauses in my game coincide
We're using the LightweightBrowserCache provided by RESTEasy 2.2.3.GA but have noticed that when the
I'm using the i18n feature of Django. I have noticed that even though I
I noticed that the launching of Java applets using deployJava.js seems to have stopped
I just started using Qt and noticed that all the example class definitions have
I'm using protobuf-net r278 in C#, and I just noticed that if I have
I've noticed that when I'm using python, I'll occasionally make a typographical error and

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.