|
Packit |
d7e8d0 |
Common Lisp Support for GPGME
|
|
Packit |
d7e8d0 |
-----------------------------
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
Requirements:
|
|
Packit |
d7e8d0 |
|
|
Packit Service |
30b792 |
ASDF Packaging Support
|
|
Packit Service |
30b792 |
CFFI Foreign Function Interface
|
|
Packit Service |
30b792 |
trivial-garbage Finalizers
|
|
Packit Service |
30b792 |
gpg-error GPG Error Codes
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
Use with:
|
|
Packit |
d7e8d0 |
|
|
Packit Service |
30b792 |
> (asdf:load-system "gpgme")
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
Examples
|
|
Packit |
d7e8d0 |
--------
|
|
Packit |
d7e8d0 |
|
|
Packit Service |
30b792 |
(with-open-file (out "/tmp/myout"
|
|
Packit Service |
30b792 |
:direction :output
|
|
Packit Service |
30b792 |
:if-exists :supersede
|
|
Packit Service |
30b792 |
:element-type '(unsigned-byte 8))
|
|
Packit |
d7e8d0 |
(with-context (ctx)
|
|
Packit Service |
30b792 |
(setf (armorp ctx) t)
|
|
Packit |
d7e8d0 |
(op-export ctx "DEADBEEF" out)))
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
(with-context (ctx)
|
|
Packit |
d7e8d0 |
(with-output-to-string (out)
|
|
Packit Service |
30b792 |
(setf (armorp ctx) t)
|
|
Packit |
d7e8d0 |
(op-export ctx "McTester" out)))
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
(gpgme:with-context (ctx :armor t)
|
|
Packit |
d7e8d0 |
(with-output-to-string (out)
|
|
Packit |
d7e8d0 |
(gpgme:op-export ctx "McTester" out)))
|
|
Packit |
d7e8d0 |
|
|
Packit Service |
30b792 |
(gpgme:with-context (ctx :armor t)
|
|
Packit Service |
30b792 |
(let ((recipient1 (gpgme:get-key ctx "DEADBEEF"))
|
|
Packit Service |
30b792 |
(recipient2 (gpgme:get-key ctx "Alice"))
|
|
Packit Service |
30b792 |
(message "Hello, world!"))
|
|
Packit Service |
30b792 |
(with-output-to-string (out)
|
|
Packit Service |
30b792 |
(with-input-from-string (in message)
|
|
Packit Service |
30b792 |
(gpgme:op-encrypt ctx (vector recipient1 recipient2) in out)))))
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
(gpgme:with-context (ctx :armor t)
|
|
Packit Service |
30b792 |
(let ((message "Hello, world!"))
|
|
Packit Service |
30b792 |
(with-output-to-string (out)
|
|
Packit Service |
30b792 |
(with-input-from-string (in message)
|
|
Packit Service |
30b792 |
(gpgme:op-sign ctx in out)))))
|
|
Packit Service |
30b792 |
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
TODO
|
|
Packit |
d7e8d0 |
----
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
* When GPGME defines macros for include cert values -2, -1, 0 and 1,
|
|
Packit |
d7e8d0 |
define lisp macros for them as well.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
*
|