from io import BytesIO
gpgme.Context() strio = BytesIO(open("id_rsa.pub", 'rb').read()) ctx.import_(strio)
Works for me. if the key is in a variable one have to encode it:
ctx = gpgme.Context() result = ctx.import_(BytesIO(keytext.encode('utf-8')))
from io import BytesIO
gpgme.Context() open("id_ rsa.pub" , 'rb').read())
strio = BytesIO(
ctx.import_(strio)
Works for me. if the key is in a variable one have to encode it:
ctx = gpgme.Context() (BytesIO( keytext. encode( 'utf-8' )))
result = ctx.import_