]> WPIA git - cassiopeia.git/blob - docs/Protocol.md
590658c2204ff861a8239d5a710100f0c88a2d12
[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 (0x18) addSAN
48   Adds a given SAN (Subject alternative name) to the certificate.
49   (DNS,<dnsname> or email,<email address>)
50 (0x19) addAVA
51   Adds an AVA (Attribute value association) to this certificates subject.
52
53 (0x40) addProofLine
54 <hex>timestamp,<hex>table,<hex>PK,<hex>column=value,<hex>column=value
55
56 (0x80) sign
57   Issue signing request.
58 s(0x80) setLog
59   Provide Log of certificate creation.
60 (0x81) logSaved (checksum of log)
61   Confirm that the log has been saved.
62 s(0x81) respondCertificate
63   Provide the newly created certificate.
64 s(0x82) signingCA
65   Provide the name of the CA-certificate with which this certificate has been signed.
66
67 (0x102) addSerial
68   Add a serial of a certificate that should be revoked.
69 (0x100) revoke
70   Revoke the provided serials for the CA given in this command.
71 s(0x100) revoked
72   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.
73
74 (0x101) getFullCRL
75   Request a full version of the current CRL.
76 s(0x101) fullCRL
77   Reply with the full CRL.
78
79 (0xC0) getTimestamp
80 s(0xC0) timestampResponse