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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:52:41+00:00 2026-05-12T16:52:41+00:00

I just installed pyme on my ubuntu system. it was easy (thanks apt-get) and

  • 0

I just installed pyme on my ubuntu system. it was easy (thanks apt-get) and I can reproduce the example code (encrypting using a public key in my keyring). now I would like to sign some data and I didn’t manage to find any example code nor much documentation.

this is what I’ve been doing:

>>> plain = pyme.core.Data('this is just some sample text\n')
>>> cipher = pyme.core.Data()
>>> c = pyme.core.Context()
>>> c.set_armor(1)
>>> name='me@office.com'
>>> c.op_keylist_start(name, 0)
>>> r = c.op_keylist_next()
>>> c.op_sign(???)

I don’t know what to give as parameters, the op_sign method tells me

>>> help(c.op_sign)
Help on function _funcwrap in module pyme.util:

_funcwrap(*args, **kwargs)
    gpgme_op_sign(ctx, plain, sig, mode) -> gpgme_error_t

but I do not know how to create such objects.

  • 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-12T16:52:41+00:00Added an answer on May 12, 2026 at 4:52 pm

    You can follow example from pyme doc and modify it a bit:

    import pyme.core
    import pyme.pygpgme
    
    plaintext = pyme.core.Data('this is a test message')
    ciphertext = pyme.core.Data()
    ctx = pyme.core.Context()
    ctx.set_armor(1)
    name = 'me@office.com'
    ctx.op_keylist_start(name, 0)
    key = ctx.op_keylist_next()
    # first argument is message to sign, second argument is buffer where to write
    # the signature, third argument is signing mode, see
    # http://www.gnupg.org/documentation/manuals/gpgme/Creating-a-Signature.html#Creating-a-Signature for more details.
    ctx.op_sign(plaintext, ciphertext, pyme.pygpgme.GPGME_SIG_MODE_CLEAR)
    ciphertext.seek(0, 0)
    print ciphertext.read()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just installed Django (with easy_install) and created a project, but can't get mysql to
Just installed POI 3.8 jars and changing over code...I get this error: public static
Just installed Python 2.7.3 on a Windows7 machine. How do I get .py files
Just installed Jenkins in Ubuntu 12.04 and I wanted to create a simple build
Just installed EE everything seems clear however I can't seem to find a solution
I just installed FuzzyFinder for gvim, though for some reason it's using an ultra
I just installed Graphite & statsd to get some statistics for my web-application. It
just installed new ubuntu vm to test around with node installed things in this
Just installed Aptana Studio 3. For the life of me I can't figure out
Just installed Gollum wiki on Ubuntu server 11.10, and when I go to launch

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.