aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src/util.h')
0 files changed, 0 insertions, 0 deletions
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612
@c uiserver.texi                    -*- mode: texinfo; coding: latin-1; -*-
@c Specification of the UI server protocol.
@c To be included by gpgme.texi

@node UI Server Protocol
@appendix The GnuPG UI Server Protocol
@cindex UI server
@cindex user interface server


This section specifies the protocol used between clients and a User
Interface Server (UI server).  This protocol helps to build a system
where all cryptographic operations are done by a server and the server
is responsible for all dialogs.  Although @acronym{GPGME} has no direct
support for this protocol it is believed that servers will utilize the
@acronym{GPGME} library; thus having the specification included in this
manual is an appropriate choice.  This protocol should be referenced as
`The GnuPG UI Server Protocol'.

@noindent
A server needs to implement these commands:@footnote{In all examples we
assume that the connection has already been established; see the Assuan
manual for details.}

@menu
* UI Server Encrypt::                Encrypt a message.
* UI Server Sign::                   Sign a message.
* UI Server Decrypt::                Decrypt a message.
* UI Server Verify::                 Verify a message.
* UI Server Set Input Files::        Specifying the input files to operate on.
* UI Server Sign/Encrypt Files::     Encrypting and signing files.
* UI Server Verify/Decrypt Files::   Decrypting and verifying files.
* UI Server Import/Export Keys::     Managing certificates.
* UI Server Checksum Files::         Create and verify checksums for files.
* Miscellaneous UI Server Commands::   Commands not related to a specific operation.
@end menu



@node UI Server Encrypt
@section UI Server: Encrypt a Message

Before encryption can be done the recipients must be set using the
command:

@deffn Command RECIPIENT @var{string}

Set the recipient for the encryption.  @var{string} is an RFC-2822
recipient name ("mailbox" as per section 3.4).  This command may or may
not check the recipient for validity right away; if it does not all
recipients are expected to be checked at the time of the @code{ENCRYPT}
command.  All @code{RECIPIENT} commands are cumulative until a
successful @code{ENCRYPT} command or until a @code{RESET} command.
Linefeeds are obviously not allowed in @var{string} and should be folded
into spaces (which are equivalent).
@end deffn

@noindent
To tell the server the source and destination of the data, the next two
commands are to be used:

@deffn Command INPUT FD=@var{n}
Set the file descriptor for the message to be encrypted to @var{n}.  The
message send to the server is binary encoded. 

GpgOL is a Windows only program, thus @var{n} is not a libc file
descriptor but a regular system handle.  Given that the Assuan
connection works over a socket, it is not possible to use regular
inheritance to make the file descriptor available to the server.
Thus @code{DuplicateHandle} needs to be used to duplicate a handle
to the server process.  This is the reason that the server needs to
implement the @code{GETINFO pid} command.  Sending this command a second
time replaces the file descriptor set by the last one.
@c If @var{n} is not given, this commands uses the
@c %last file descriptor passed to the application.
@c %@xref{fun-assuan_sendfd, ,the assuan_sendfd function,assuan,the
@c %Libassuan manual}, on how to do descriptor passing.
@end deffn

@deffn Command OUTPUT FD=@var{n}
Set the file descriptor to be used for the output (i.e. the encrypted
message) to @var{n}.  For OpenPGP, the output needs to be ASCII armored;
for CMS, the output needs to be Base-64 encoded.  For details on the
file descriptor, see the @code{INPUT} command.
@end deffn

@noindent  
The setting of the recipients, the data source and destination may
happen in any order, even intermixed.  If this has been done the actual
encryption operation is called using:

@deffn Command ENCRYPT -@w{}-protocol=@var{name}

This command reads the plaintext from the file descriptor set by the
@code{INPUT} command, encrypts it and writes the ciphertext to the file
descriptor set by the @code{OUTPUT} command.  The server may (and
should) overlap reading and writing.  The recipients used for the
encryption are all the recipients set so far.  If any recipient is not
usable the server should take appropriate measures to notify the user
about the problem and may cancel the operation by returning an error
code.  The used file descriptors are void after this command; the
recipient list is only cleared if the server returns success.

@noindent