gpgme/lang/cl
Guillaume LE VAILLANT 85d7af8ff2
cl: Several fixes
--

* Use wrapper types calling translation functions instead of
  TRANSLATE-{FROM,TO}-FOREIGN methods as they seem not to be
  called in some cases.
* Use the (:STRUCT SOME-C-STRUCT) notation instead of the
  deprecated direct reference to SOME-C-STRUCT.
* Add missing values in enums and bit fields.
* Use cffi-grovel to define system types (SIZE-T, OFF-T, etc).
* Wrap GPGME-DATA-T in a class (like contexts).
* Use the FINALIZE function from trivial-garbage to free the
  C objects for contexts, keys and data automatically.
* Make DATA-READ-CB and DATA-WRITE-CB run faster.
* Update the README file.

Signed-off-by: Guillaume LE VAILLANT <glv@posteo.net>
2018-10-12 09:02:18 +02:00
..
.gitignore .gitignore: flesh out rules and add subdirectory-.gitignores. 2012-04-20 16:05:11 +02:00
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-02 11:36:37 +01:00
gpgme-package.lisp cl: Several fixes 2018-10-12 09:02:18 +02:00
gpgme.asd.in cl: Several fixes 2018-10-12 09:02:18 +02:00
gpgme.lisp cl: Several fixes 2018-10-12 09:02:18 +02:00
Makefile.am cl: Several fixes 2018-10-12 09:02:18 +02:00
README cl: Several fixes 2018-10-12 09:02:18 +02:00

Common Lisp Support for GPGME
-----------------------------

Requirements:

ASDF             Packaging Support
CFFI             Foreign Function Interface
trivial-garbage  Finalizers
gpg-error        GPG Error Codes

Use with:

> (asdf:load-system "gpgme")


Examples
--------

(with-open-file (out "/tmp/myout"
                     :direction :output
                     :if-exists :supersede
                     :element-type '(unsigned-byte 8))
  (with-context (ctx)
    (setf (armorp ctx) t)
    (op-export ctx "DEADBEEF" out)))

(with-context (ctx)
  (with-output-to-string (out)
    (setf (armorp ctx) t)
    (op-export ctx "McTester" out)))

(gpgme:with-context (ctx :armor t)
  (with-output-to-string (out)
    (gpgme:op-export ctx "McTester" out)))

(gpgme:with-context (ctx :armor t)
  (let ((recipient1 (gpgme:get-key ctx "DEADBEEF"))
        (recipient2 (gpgme:get-key ctx "Alice"))
        (message "Hello, world!"))
    (with-output-to-string (out)
      (with-input-from-string (in message)
        (gpgme:op-encrypt ctx (vector recipient1 recipient2) in out)))))

(gpgme:with-context (ctx :armor t)
  (let ((message "Hello, world!"))
    (with-output-to-string (out)
      (with-input-from-string (in message)
        (gpgme:op-sign ctx in out)))))


TODO
----

* When GPGME defines macros for include cert values -2, -1, 0 and 1,
  define lisp macros for them as well.

*