class

GPGME::Context

Inherits Reference < Object

Main context for GPGME operations

Constructors

new(protocol : LibGPGME::Protocol = LibGPGME::Protocol::OpenPGP)
Source

Instance methods

armor=(value : Bool)

Enable or disable ASCII armor for output

Source
armor?

Check if ASCII armor is enabled

Source
decrypt(ciphertext : String | Bytes) : String

Decrypt data

Source
encrypt(plaintext : String | Bytes, recipients : Array(String), armor : Bool = true) : String

Encrypt data for the specified recipients recipients can be fingerprints, key IDs, or email addresses

Source
finalize
Source
get_key(fingerprint : String, secret : Bool = false) : Key

Get a specific key by fingerprint

Source
list_keys(pattern : String | Nil = nil, secret : Bool = false) : Array(Key)

List all public keys matching the pattern If pattern is nil, lists all keys

Source
private_keys(pattern : String | Nil = nil) : Array(Key)

List all private (secret) keys

Source
public_keys(pattern : String | Nil = nil) : Array(Key)

List all public keys

Source
sign(plaintext : String | Bytes, mode : LibGPGME::SigMode = LibGPGME::SigMode::Clear, armor : Bool = true) : String

Sign data

Source
verify(signature : String | Bytes, signed_text : String | Bytes | Nil = nil) : Bool

Verify a signature

Source