2006-07-06 10:37:52 +00:00
|
|
|
Common Lisp Support for GPGME
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
Requirements:
|
|
|
|
|
2018-10-12 06:49:26 +00:00
|
|
|
ASDF Packaging Support
|
|
|
|
CFFI Foreign Function Interface
|
|
|
|
trivial-garbage Finalizers
|
|
|
|
gpg-error GPG Error Codes
|
2006-07-06 10:37:52 +00:00
|
|
|
|
|
|
|
Use with:
|
|
|
|
|
2018-10-12 06:49:26 +00:00
|
|
|
> (asdf:load-system "gpgme")
|
2006-07-06 10:37:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
Examples
|
|
|
|
--------
|
|
|
|
|
2018-10-12 06:49:26 +00:00
|
|
|
(with-open-file (out "/tmp/myout"
|
|
|
|
:direction :output
|
|
|
|
:if-exists :supersede
|
|
|
|
:element-type '(unsigned-byte 8))
|
2006-07-06 10:37:52 +00:00
|
|
|
(with-context (ctx)
|
2018-10-12 06:49:26 +00:00
|
|
|
(setf (armorp ctx) t)
|
2006-07-06 10:37:52 +00:00
|
|
|
(op-export ctx "DEADBEEF" out)))
|
|
|
|
|
|
|
|
(with-context (ctx)
|
|
|
|
(with-output-to-string (out)
|
2018-10-12 06:49:26 +00:00
|
|
|
(setf (armorp ctx) t)
|
2006-07-06 10:37:52 +00:00
|
|
|
(op-export ctx "McTester" out)))
|
|
|
|
|
|
|
|
(gpgme:with-context (ctx :armor t)
|
|
|
|
(with-output-to-string (out)
|
|
|
|
(gpgme:op-export ctx "McTester" out)))
|
|
|
|
|
2018-10-12 06:49:26 +00:00
|
|
|
(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)))))
|
|
|
|
|
2006-07-06 10:37:52 +00:00
|
|
|
|
|
|
|
TODO
|
|
|
|
----
|
|
|
|
|
|
|
|
* When GPGME defines macros for include cert values -2, -1, 0 and 1,
|
|
|
|
define lisp macros for them as well.
|
|
|
|
|
|
|
|
*
|