Converts a GPGME hash algorithm name to one conforming to RFC3156.
GPGME returns hash algorithm names such as “SHA256”, but RFC3156 says that programs need to use names such as “pgp-sha256” instead.
Parameters: | hash_algo – GPGME hash_algo |
---|---|
Return type: | str |
Decrypts the given ciphertext string and returns both the signatures (if any) and the plaintext.
Parameters: | encrypted – the mail to decrypt |
---|---|
Returns: | a tuple (sigs, plaintext) with sigs being a list of a gpgme.Signature and plaintext is a str holding the decrypted mail |
Raises: | GPGProblem if the decryption fails |
Signs the given plaintext string and returns the detached signature.
A detached signature in GPG speak is a separate blob of data containing a signature for the specified plaintext.
Parameters: |
|
---|---|
Return type: | tuple of gpgme.NewSignature array and str |
Encrypts the given plaintext string and returns a PGP/MIME compatible string
Parameters: |
|
---|---|
Return type: | a string holding the encrypted mail |
Gets a key from the keyring by filtering for the specified keyid, but only if the given keyid is specific enough (if it matches multiple keys, an exception will be thrown).
If validate is True also make sure that returned key is not invalid, revoked or expired. In addition if encrypt or sign is True also validate that key is valid for that action. For example only keys with private key can sign.
Parameters: |
|
---|---|
Return type: | gpgme.Key |
Returns a hash of the given key. This is a workaround for https://bugs.launchpad.net/pygpgme/+bug/1089865 and can be removed if the missing feature is added to pygpgme
Parameters: | key – the key we want a hash of |
---|---|
Return type: | a has of the key as string |
Returns a list of all keys containing keyid.
Parameters: |
|
---|---|
Return type: | list |
Verifies whether the message is authentic by checking the signature.
Parameters: |
|
---|---|
Returns: | a list of gpgme.Signature |
Raises: | GPGProblem if the verification fails |