]> WPIA git - cassiopeia.git/blob - docs/Protocol.md
fix: use correct prepared statement for writing logs
[cassiopeia.git] / docs / Protocol.md
1 Record Format
2 =============
3
4 The signer and signer-client communicate through individual "records" (in a TLS-Session using a SLIP-like protocol, via Serial). All multi-byte integers are transfered in little-endian order. Each record has the following format:
5
6 1 byte ":" (fixed ascii ':')
7 Hex encoding of:
8 2 byte command
9   see type of commands below
10 1 byte flags
11   flags for this command (currently unused)
12 4 byte session identifier
13   session identifier (must be equal for all commands in one TLS session)
14 2 byte command identifier (counter)
15   identifier for invocation. A command may be split into multiple records. All such records must have the same command identifier.
16 4 byte total length
17   total length of the payload
18 2 byte offset
19   indicates which chunk of data is being sent (currently unused)
20 2 byte length
21   length of payload in this record
22 <length> byte data
23   the playload data of this record
24 1 byte checksum
25   bitwise complement of the sum of all bytes until now.
26 End hex encoding.
27 1 byte "\n" (fixed ascii '\n')
28
29 Record Types/Commands
30 ---------------------
31
32 's' indicates commands set by the signer while all other commands are sent by the signer client.
33
34 (0x01) setCSR
35   Sets the target key of the certificate that is to be created to the one contained in the given CSR.
36 (0x02) setSPKAC
37   Sets the target key of the certificate that is to be created to the one contained in the given SPKAC-Request.
38 (0x10) setSignatureType
39   Sets the signing algorithms digest algorithm.
40   (sha512|sha384|sha256)
41 (0x11) setProfile
42   Sets the certificate profile to sign with.
43 (0x12) wishFrom
44   Sets the desired starting date.
45 (0x13) wishTo
46   Sets the desired ending date (or validity-period).
47 (0x14) ocspTargetCA
48   Used instead of (0x11) when signing OCSP certs. The payload is an exact time-CA name (e.g. orga_2017_1).
49 (0x18) addSAN
50   Adds a given SAN (Subject alternative name) to the certificate.
51   (DNS,<dnsname> or email,<email address>)
52 (0x19) addAVA
53   Adds an AVA (Attribute value association) to this certificates subject.
54
55 (0x40) addProofLine
56 <hex>timestamp,<hex>table,<hex>PK,<hex>column=value,<hex>column=value
57
58 (0x80) sign
59   Issue signing request.
60 s(0x80) setLog
61   Provide Log of certificate creation.
62 (0x81) logSaved (checksum of log)
63   Confirm that the log has been saved.
64 s(0x81) respondCertificate
65   Provide the newly created certificate.
66 s(0x82) signingCA
67   Provide the name of the CA-certificate with which this certificate has been signed.
68
69 (0x102) addSerial
70   Add a serial of a certificate that should be revoked.
71 (0x100) revoke
72   Revoke the provided serials for the CA given in this command.
73 s(0x100) revoked
74   Confirm revocation. Provide the "date" for all newly created CRL-entries and a new CRL-signature. The local CRL should be updated accordingly, the signature updated and then validated.
75
76 (0x101) getFullCRL
77   Request a full version of the current CRL.
78 s(0x101) fullCRL
79   Reply with the full CRL.
80
81 (0xC0) getTimestamp
82 s(0xC0) timestampResponse