<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<rfc ipr="trust200902" docName="draft-hallambaker-mesh-reference-08" category="info">
<?rfc toc="yes"?>  
<?rfc symrefs="yes"?>  
<?rfc sortrefs="yes"?>  
<?rfc compact="yes"?>  
<?rfc subcompact="no"?>  
<front>
<title abbrev="Mathematical Mesh Reference">Mathematical Mesh: Reference</title>
<author fullname="Phillip Hallam-Baker" initials="P. M." surname="Hallam-Baker">
<organization>Comodo Group Inc.</organization>
<address>
<email>philliph@comodo.com</email>
</address>
</author>
<date day="10" month="April" year="2018"/>
<area/>
<workgroup/>
<abstract>
<t>
The Mathematical Mesh ?The Mesh? is an end-to-end secure infrastructure that facilitates the exchange of configuration and credential data between multiple user devices. The core protocols of the Mesh are described with examples of common use cases and reference data.</t>
<t>
This document is also available online at <eref target="http://prismproof.org/Documents/draft-hallambaker-mesh-reference.html">
http://prismproof.org/Documents/draft-hallambaker-mesh-reference.html</eref>
.</t>
</abstract>
</front>
<middle>
<section title="Introduction" anchor="s-1">
<t>
NB: The reference material in this document is generated from the schema used to derive the source code. The tool used to create this material has not been optimized to produce output for the IETF documentation format at this time. Consequently, the formatting is currently sub-optimal.</t>
</section>
<section title="Definitions" anchor="s-2">
<t>
This section presents the related specifications and standard, the terms that are used as terms of art within the documents and the terms used as requirements language.</t>
<section title="Requirements Language" anchor="s-2_1">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119">
</xref>
.</t>
</section>
<section title="Defined Terms" anchor="s-2_2">
<t>
The terms of art used in this document are described in the Mesh Architecture Guide <xref target="draft-hallambaker-mesh-architecture">
</xref>
.</t>
</section>
<section title="Related Specifications" anchor="s-2_3">
<t>
The architecture of the Mathematical Mesh is described in the Mesh Architecture Guide <xref target="draft-hallambaker-mesh-architecture">
</xref>
. The Mesh documentation set and related specifications are described in this document.</t>
</section>
<section title="Implementation Status" anchor="s-2_4">
<t>
The implementation status of the reference code base is described in the companion document <xref target="draft-hallambaker-mesh-developer">
</xref>
.</t>
</section>
</section>
<section title="Protocol Overview" anchor="s-3">
<t>
[Account request does not specify the portal in the request body, only the HTTP package includes this information. This is probably a bug.] </t>
<section title="Creating a new portal account" anchor="s-3_1">
<t>
A user interacts with a Mesh service through a Mesh portal provider  with which she establishes a portal account.  </t>
<t>
For user convenience, a portal account identifier has the familiar  &lt;username&gt;@&lt;domain&gt; format established in [~RFC822]. </t>
<t>
For example Alice selects example.com as her  portal provider and chooses the account name alice. Her portal account identifier is alice. </t>
<t>
A user MAY establish accounts with multiple portal providers and/or change their portal provider at any time they choose. </t>
<section title="Checking Account Identifier for uniqueness" anchor="s-3_1_1">
<t>
The first step in creating a new account is to check to see if the chosen account identifier is available. This allows a client to  validate user input and if necessary warn the user that they need  to choose a new account identifier when the data is first entered. </t>
<t>
The ValidateRequest message contains the requested account identifier and an optional language parameter to allow the service to provide informative error messages in a language the user understands. The Language field contains a list of ISO language identifier codes  in order of preference, most preferred first. </t>
<figure anchor="s-3_1_1-3">
<artwork>
<![CDATA[POST /.well-known/mmm/HTTP/1.1
Host: example.com
Content-Length: 90

{
  "ValidateRequest": {
    "Account": "test@prismproof.org",
    "Language": ["en-uk"]}}]]></artwork>
</figure>
<t>
The ValidateResponse message returns the result of the validation request in the Valid field. Note that even if the value true is returned, a subsequent account creation request MAY still fail. </t>
<figure anchor="s-3_1_1-5">
<artwork>
<![CDATA[HTTP/1.1 200 OK
Date: Mon 04 Dec 2017 03:38:57
Content-Length: 190

{
  "ValidateResponse": {
    "Status": 201,
    "StatusDescription": "Operation completed successfully",
    "Valid": true,
    "Minimum": 1,
    "InvalidCharacters": ".,:;{}()[]<>?|\\@#"}}]]></artwork>
</figure>
<t>
[Note that for the sake of concise presentation, the HTTP binding information is omitted from future examples.] </t>
</section>
</section>
<section title="Creating a new user profile" anchor="s-3_2">
<t>
The first step in creating a new personal profile is to create a Master Profile object. This contains the long term Master Signing Key that will remain constant for the life of the profile, at least  one Online Signature Key to be used for administering the personal profile and (optionally), one or more master escrow keys. </t>
<t>
For convenience, the descriptions of the Master Signing Key,  Online Signing Keys and Escrow Keys typically include PKIX  certificates signed by the Master Signing Key. This allows  PKIX based applications to make use of PKIX certificate chains to express the same trust relationships described in the Mesh. </t>
<figure anchor="s-3_2-3">
<artwork>
<![CDATA[{
  "MasterProfile": {
    "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
    "MasterSignatureKey": {
      "UDF": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
      "X509Certificate": "
MIIFXTCCBEWgAwIBAgIRAMLMDJuKzpOYUgyGu-pFSoswDQYJKoZIhvcNAQENBQAw
LjEsMCoGA1UEAxYjTUFMRUktR1RWM0UtNVc3SlItNk5NRVktN0c1MlUtNkszT1Qw
...
9c8HDZ9z9BHj_XwoShvX9neZiiQ26Pw9rJLNJ70Q7Nsi"
,
      "PublicParameters": {
        "PublicKeyRSA": {
          "kid": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
          "n": "
-OVfAVjglTViCa7GRMcZdX8zfuALOIMoVU9itSc6zIZPDNM_D1g_-wI_bM0duKXT
Y2B3gtZJBe6tnlLK2PPnwVEqo1srSmIBGTwgRM_wlJmjQ46rET0SMEI1GuVRqvah
pxqq59XqfDYqydqOvtDcqavgyW33S1UXI7KVSJgwagk3QFnIoErh8bnK54Gdpz-L
BA7EICHqD2Md4pdRVCY1-JFYrG1wX0B5DZzCUQ6fd-TBt4BEBH3ERLQhqQMwIE7x
CaEBahklcP_44FgSmeT21sQFSHhBPZxdqmfAEefKPKu9vuo3XETeSRs3HTrtoImF
IZj421mieaQc0vTYNWL2pQ"
,
          "e": "
AQAB"
}}},
    "MasterEscrowKeys": [{
        "UDF": "MCYWE-GQRSM-NOK5T-3UVLY-AHJF6-T4GZC",
        "X509Certificate": "
MIIFXDCCBESgAwIBAgIQCLpDHbhuyKQxHbawBVlw4TANBgkqhkiG9w0BAQ0FADAu
MSwwKgYDVQQDFiNNQUxFSS1HVFYzRS01VzdKUi02Tk1FWS03RzUyVS02SzNPVDAe
...
mQ46FsAdzE42gLKnIN7IXYHbHr-bbw-5fW1bdQ840O8"
,
        "PublicParameters": {
          "PublicKeyRSA": {
            "kid": "MCYWE-GQRSM-NOK5T-3UVLY-AHJF6-T4GZC",
            "n": "
0aPb4XHnVtVIGWXc8t1mvCkf52UC8NRKPZkjNVY0bY8WwNtUNWbn-Tqv5ncS9hVz
gaRvQIM9U_4JZgwviuy2srJj0_c1yQtGIbBIRsrWt6wfx_gM0g1YCty_06hCrOu0
54JzRMm6wpLcmmws-Ip9rIL931zoNx5HvWEp5bUMFv3qENbYzlAPizobxSDinMLJ
R0gfTPz4FwillrnWRWhsWZ3VscDGZxYTsI3wZhi60B7LDdmTkr9KqXiVt7fefUSP
bGAYGQLuh_296O_Hh6F6N6V2UhvncD0K9F4t6DBt7_H06HojqLrUWsD1juVilE3h
dfFYaMEgyo9bxMIefKeQXQ"
,
            "e": "
AQAB"
}}}],
    "OnlineSignatureKeys": [{
        "UDF": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT",
        "X509Certificate": "
MIIFXDCCBESgAwIBAgIQPcM0MUJ9c57N4f_Z_9uSsDANBgkqhkiG9w0BAQ0FADAu
MSwwKgYDVQQDFiNNQUxFSS1HVFYzRS01VzdKUi02Tk1FWS03RzUyVS02SzNPVDAe
...
eljXhyaFB_QYGvKRAtyaSnU9m51xLX28D5bNq8LO53M"
,
        "PublicParameters": {
          "PublicKeyRSA": {
            "kid": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT",
            "n": "
yVcObdfLYL_Gh36yY_bprL8W7rEgax8Nbe2KFSZWkWayGps79C16pqOV0Doapko1
Lnbb-uB0BTS-Qw6A0F_0ZQyEaWzBMycvPT0Gr87unC-Ow3IaYeA2TbKNMg8Yvd_d
LB4nwWqWianYhV2nSbG4Tfem9zyYvrhG-DcKeMgQmSV6WgdwMCVEdKuuBxl5SL2D
GvmLwDwfRRX3tk0QGraagjywOCjmBd5F2WPaUtKV8HZtT9H9hI6YyztKrL_mp12P
itds_krRRLWf2OFNFMQau93zYxtNObu3xshu3hDzDHL_81pmXzMQ_AZ0vjF7-PA1
dC0VpPs3xxbXRNw64Kf_3Q"
,
            "e": "
AQAB"
}}}]}}]]></artwork>
</figure>
<t>
The Master Profile is always signed using the Master Signing Key: </t>
<figure anchor="s-3_2-5">
<artwork>
<![CDATA[{
  "SignedMasterProfile": {
    "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
    "SignedData": {
      "unprotected": {
        "dig": "S512"},
      "payload": "
ewogICJNYXN0ZXJQcm9maWxlIjogewogICAgIklkZW50aWZpZXIiOiAiTUFMRUkt
R1RWM0UtNVc3SlItNk5NRVktN0c1MlUtNkszT1QiLAogICAgIk1hc3RlclNpZ25h
...
In19fV19fQ"
,
      "signatures": [{
          "header": {
            "kid": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT"},
          "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCnpuZERBMjFPSkZtZk1pdWV6
RWV6dThHWUJzWEVOSXVKZmFOMjJwWV9hTzNHeGl6ZjM3emJVVzFPNEVReDJFZ0IK
cURmRXJwVDdpX2VPVzBYWGk5VmdDUSJ9"
,
          "signature": "
D0cg0pN4-50S1ilo9wrfI6u-R5NvAuZo8j5-XIBr1AylzMDWZk5YpdtoUM1q8FIR
sXVzetQ_6l8zc6fVzUJt7fMN8yBvc9v6owcFBNrujJSHsBU2u_DGxdhH1DW_4MU4
rTGXzek3__8jxo-q8LyzBfX2Wl3jzZz5VP_LhPdRjNFKTuU1e-KlLU43imvn8WTB
TYQas3JVWUgdsyH3OZ-FQ7Z06tNUtmza6qCK2HqRaUmJZ9P35835MaJbZX8D87WB
7R3KHWPNCO8bBkzXJCaM86E0wmYna3u1BuJ1Bg1bPY3t-iqVxv59FPHLB24TVMWP
WQIhxuUIJt5QYj_BhjmeBg"
}]}}}]]></artwork>
</figure>
<t>
Since the device used to create the personal profile is typically connected to the profile, a Device profile entry is created  for it. This contains a Device Signing Key, a Device Encryption Key and a Device Authentication Key: </t>
<figure anchor="s-3_2-7">
<artwork>
<![CDATA[{
  "JoseWebSignature": {
    "unprotected": {
      "dig": "S512"},
    "payload": "
ewogICJEZXZpY2VQcm9maWxlIjogewogICAgIklkZW50aWZpZXIiOiAiTURLVVIt
VFBaUU8tNlo3U1AtUUNFUjYtN0tRU0QtQ05STlEiLAogICAgIk5hbWVzIjogWyJE
...
OUxjUVpRIiwKICAgICAgICAgICJlIjogIgpBUUFCIn19fX19"
,
    "signatures": [{
        "header": {
          "kid": "MDKUR-TPZQO-6Z7SP-QCER6-7KQSD-CNRNQ"},
        "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjFUX0ExbGFSY1M4OWszbFpk
aklSNUx5LVBJWlM5QUM4XzJlWmUyLUF3SXJVMzIwbFNKakhCcU1VRnBTczBTczcK
dzdva1dlV0YtV1VQcll3WjJUU2JFZyJ9"
,
        "signature": "
PUZrcYPUfJRxvKMnPJ6U6mgSx3lJoyY_Q-Takf0ZrnRMbjKi1Nn2nLFlfTi_htVO
Rn45WrLIR-hnZbKLWFkwsNg2HZ55MELcF0Cnvbzb8nj0roy3vc6FSJF5aZiFEn6u
hAAimDiA8HHta0J7nzlStYPeqrb_s0XDiNfpp7aSqckVdGZC2XKhx1RgQuF5ctp3
zLOGzV0Y5No312QmIagOXcLFLXG0awxhvEHhyhsALnQX8rd0z4AZmZavKCHufbcE
n-nRts8GzgcKmnRpmOuPdGhtT-PI8Gn7-sxfb4R95Taf_7_fvLLNG0Sot4DMTMuP
xovBNY1eA23ZHtw9AvmTAg"
}]}}]]></artwork>
</figure>
<t>
The Device Profile is signed using the Device Signing Key: </t>
<figure anchor="s-3_2-9">
<artwork>
<![CDATA[{
  "SignedDeviceProfile": {
    "Identifier": "MDKUR-TPZQO-6Z7SP-QCER6-7KQSD-CNRNQ",
    "SignedData": {
      "unprotected": {
        "dig": "S512"},
      "payload": "
ewogICJEZXZpY2VQcm9maWxlIjogewogICAgIklkZW50aWZpZXIiOiAiTURLVVIt
VFBaUU8tNlo3U1AtUUNFUjYtN0tRU0QtQ05STlEiLAogICAgIk5hbWVzIjogWyJE
...
OUxjUVpRIiwKICAgICAgICAgICJlIjogIgpBUUFCIn19fX19"
,
      "signatures": [{
          "header": {
            "kid": "MDKUR-TPZQO-6Z7SP-QCER6-7KQSD-CNRNQ"},
          "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjFUX0ExbGFSY1M4OWszbFpk
aklSNUx5LVBJWlM5QUM4XzJlWmUyLUF3SXJVMzIwbFNKakhCcU1VRnBTczBTczcK
dzdva1dlV0YtV1VQcll3WjJUU2JFZyJ9"
,
          "signature": "
PUZrcYPUfJRxvKMnPJ6U6mgSx3lJoyY_Q-Takf0ZrnRMbjKi1Nn2nLFlfTi_htVO
Rn45WrLIR-hnZbKLWFkwsNg2HZ55MELcF0Cnvbzb8nj0roy3vc6FSJF5aZiFEn6u
hAAimDiA8HHta0J7nzlStYPeqrb_s0XDiNfpp7aSqckVdGZC2XKhx1RgQuF5ctp3
zLOGzV0Y5No312QmIagOXcLFLXG0awxhvEHhyhsALnQX8rd0z4AZmZavKCHufbcE
n-nRts8GzgcKmnRpmOuPdGhtT-PI8Gn7-sxfb4R95Taf_7_fvLLNG0Sot4DMTMuP
xovBNY1eA23ZHtw9AvmTAg"
}]}}}]]></artwork>
</figure>
<t>
A personal profile would typically contain at least one application when first created. For the sake of demonstration, we will do this later. </t>
<t>
The personal profile thus consists of the master profile and  the device profile: </t>
<figure anchor="s-3_2-12">
<artwork>
<![CDATA[{
  "PersonalProfile": {
    "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
    "SignedMasterProfile": {
      "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
      "SignedData": {
        "unprotected": {
          "dig": "S512"},
        "payload": "
ewogICJNYXN0ZXJQcm9maWxlIjogewogICAgIklkZW50aWZpZXIiOiAiTUFMRUkt
R1RWM0UtNVc3SlItNk5NRVktN0c1MlUtNkszT1QiLAogICAgIk1hc3RlclNpZ25h
...
In19fV19fQ"
,
        "signatures": [{
            "header": {
              "kid": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT"},
            "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCnpuZERBMjFPSkZtZk1pdWV6
RWV6dThHWUJzWEVOSXVKZmFOMjJwWV9hTzNHeGl6ZjM3emJVVzFPNEVReDJFZ0IK
cURmRXJwVDdpX2VPVzBYWGk5VmdDUSJ9"
,
            "signature": "
D0cg0pN4-50S1ilo9wrfI6u-R5NvAuZo8j5-XIBr1AylzMDWZk5YpdtoUM1q8FIR
sXVzetQ_6l8zc6fVzUJt7fMN8yBvc9v6owcFBNrujJSHsBU2u_DGxdhH1DW_4MU4
rTGXzek3__8jxo-q8LyzBfX2Wl3jzZz5VP_LhPdRjNFKTuU1e-KlLU43imvn8WTB
TYQas3JVWUgdsyH3OZ-FQ7Z06tNUtmza6qCK2HqRaUmJZ9P35835MaJbZX8D87WB
7R3KHWPNCO8bBkzXJCaM86E0wmYna3u1BuJ1Bg1bPY3t-iqVxv59FPHLB24TVMWP
WQIhxuUIJt5QYj_BhjmeBg"
}]}},
    "Devices": [{
        "Identifier": "MDKUR-TPZQO-6Z7SP-QCER6-7KQSD-CNRNQ",
        "SignedData": {
          "unprotected": {
            "dig": "S512"},
          "payload": "
ewogICJEZXZpY2VQcm9maWxlIjogewogICAgIklkZW50aWZpZXIiOiAiTURLVVIt
VFBaUU8tNlo3U1AtUUNFUjYtN0tRU0QtQ05STlEiLAogICAgIk5hbWVzIjogWyJE
...
OUxjUVpRIiwKICAgICAgICAgICJlIjogIgpBUUFCIn19fX19"
,
          "signatures": [{
              "header": {
                "kid": "MDKUR-TPZQO-6Z7SP-QCER6-7KQSD-CNRNQ"},
              "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjFUX0ExbGFSY1M4OWszbFpk
aklSNUx5LVBJWlM5QUM4XzJlWmUyLUF3SXJVMzIwbFNKakhCcU1VRnBTczBTczcK
dzdva1dlV0YtV1VQcll3WjJUU2JFZyJ9"
,
              "signature": "
PUZrcYPUfJRxvKMnPJ6U6mgSx3lJoyY_Q-Takf0ZrnRMbjKi1Nn2nLFlfTi_htVO
Rn45WrLIR-hnZbKLWFkwsNg2HZ55MELcF0Cnvbzb8nj0roy3vc6FSJF5aZiFEn6u
hAAimDiA8HHta0J7nzlStYPeqrb_s0XDiNfpp7aSqckVdGZC2XKhx1RgQuF5ctp3
zLOGzV0Y5No312QmIagOXcLFLXG0awxhvEHhyhsALnQX8rd0z4AZmZavKCHufbcE
n-nRts8GzgcKmnRpmOuPdGhtT-PI8Gn7-sxfb4R95Taf_7_fvLLNG0Sot4DMTMuP
xovBNY1eA23ZHtw9AvmTAg"
}]}}],
    "Applications": []}}]]></artwork>
</figure>
<t>
The personal profile is then signed using the Online Signing Key: </t>
<figure anchor="s-3_2-14">
<artwork>
<![CDATA[{
  "SignedPersonalProfile": {
    "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
    "SignedData": {
      "unprotected": {
        "dig": "S512"},
      "payload": "
ewogICJQZXJzb25hbFByb2ZpbGUiOiB7CiAgICAiSWRlbnRpZmllciI6ICJNQUxF
SS1HVFYzRS01VzdKUi02Tk1FWS03RzUyVS02SzNPVCIsCiAgICAiU2lnbmVkTWFz
...
b25zIjogW119fQ"
,
      "signatures": [{
          "header": {
            "kid": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT"},
          "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjhhR1g4Z2hibUlhc2FXVEtm
UjBhQ0QyLU5Fckh3Z0RXRkIwM2diSk1hZFhSVkpyZmpYc1RxNXFZeEhyRDRDTzQK
d0JoWXBkejVyRXJVSmtaUVFQYl9lUSJ9"
,
          "signature": "
v0aUBSoxs6FMtFsbWMZViJvVNh3GNliu7CEnw2Ajj-3mRwEtgTFY0H5RiB9AIbI2
TODq7JPKm7-6CCUEugXGdh4ZOnu5A2pAbwtotdAZBpNlhTQTuN6EE-OXwZmZSQyG
DZil2tIjLxYSlsX6vWB4M00HPPYx44TLvbbNVbTVJpw5gnWTceSw5nzIsUqT3gVE
8mCtN2Vo4EWKcMEhUJMx9nUkIaclW9orbA51S3B8QeMGP179cyZ_X_y6TKC3wIB6
AUm6ZQtpa_gBRnAmkbJj6-H_zI_OQIUO_IO2ANL3jI7TSiGPA7VhKsTYDTihMPHs
wfDAwuxZ2a5enFCczaywlg"
}]}}}]]></artwork>
</figure>
<section title="Publishing a new user profile" anchor="s-3_2_1">
<t>
Once the signed personal profile is created, the client can finaly make the request for the service to create the account. The request object  contains the requested account identifier and profile: </t>
<figure anchor="s-3_2_1-2">
<artwork>
<![CDATA[{
  "CreateRequest": {
    "Account": "test@prismproof.org",
    "Profile": {
      "SignedPersonalProfile": {
        "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
        "SignedData": {
          "unprotected": {
            "dig": "S512"},
          "payload": "
ewogICJQZXJzb25hbFByb2ZpbGUiOiB7CiAgICAiSWRlbnRpZmllciI6ICJNQUxF
SS1HVFYzRS01VzdKUi02Tk1FWS03RzUyVS02SzNPVCIsCiAgICAiU2lnbmVkTWFz
...
b25zIjogW119fQ"
,
          "signatures": [{
              "header": {
                "kid": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT"},
              "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjhhR1g4Z2hibUlhc2FXVEtm
UjBhQ0QyLU5Fckh3Z0RXRkIwM2diSk1hZFhSVkpyZmpYc1RxNXFZeEhyRDRDTzQK
d0JoWXBkejVyRXJVSmtaUVFQYl9lUSJ9"
,
              "signature": "
v0aUBSoxs6FMtFsbWMZViJvVNh3GNliu7CEnw2Ajj-3mRwEtgTFY0H5RiB9AIbI2
TODq7JPKm7-6CCUEugXGdh4ZOnu5A2pAbwtotdAZBpNlhTQTuN6EE-OXwZmZSQyG
DZil2tIjLxYSlsX6vWB4M00HPPYx44TLvbbNVbTVJpw5gnWTceSw5nzIsUqT3gVE
8mCtN2Vo4EWKcMEhUJMx9nUkIaclW9orbA51S3B8QeMGP179cyZ_X_y6TKC3wIB6
AUm6ZQtpa_gBRnAmkbJj6-H_zI_OQIUO_IO2ANL3jI7TSiGPA7VhKsTYDTihMPHs
wfDAwuxZ2a5enFCczaywlg"
}]}}}}}]]></artwork>
</figure>
<t>
The service reports the success (or failure) of the account creation request: </t>
<figure anchor="s-3_2_1-4">
<artwork>
<![CDATA[{
  "CreateResponse": {
    "Status": 201,
    "StatusDescription": "Operation completed successfully"}}]]></artwork>
</figure>
</section>
</section>
<section title="Connecting a device profile to a user profile" anchor="s-3_3">
<t>
Connecting a device to a profile requires the client on the new device to interact with a client on a device that has administration capabilities, i.e. it has access to an Online Signing Key. Since clients cannot  interact directly with other clients, a service is required to  mediate the connection. This service is provided by a Mesh portal provider. </t>
<t>
All service transactions are initiated by the clients. First the  connecting device posts ConnectStart, after which it may poll for the outcome of the connection request using ConnectStatus. </t>
<t>
Periodically, the Administration Device polls for a list of pending connection requests using ConnectPending. After posting a request, the administration device posts the result using ConnectComplete: </t>
<figure anchor="s-3_3-4">
<artwork>
<![CDATA[Connecting                  Mesh                 Administration
  Device                   Service                   Device

	|                         |                         |
	|      ConnectStart       |                         |
	| ----------------------> |                         |
	|                         |      ConnectPending     |
	|                         | <---------------------- |
	|                         |                         |
	|                         |      ConnectComplete    |
	|                         | <---------------------- |
	|      ConnectStatus      |                         |
	| ----------------------> |                         |]]></artwork>
</figure>
<t>
The first step in the process is for the client to generate a device profile. Ideally the device profile is bound to the device in a read-only fashion such that applications running on the  device can make use of the deencryption and authentication keys but these private keys cannot be extracted from the device: </t>
<figure anchor="s-3_3-6">
<artwork>
<![CDATA[{
  "DeviceProfile": {
    "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
    "Names": ["Default"],
    "Description": "Unknown",
    "DeviceSignatureKey": {
      "UDF": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
      "PublicParameters": {
        "PublicKeyRSA": {
          "kid": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
          "n": "
8cxQYz71dYg24QyipvRGE6MAaoWBuFHASmD9LwSFs_A3P-CkxJ9MULvg_VNLpME_
HeNMZPNUDzZEjaUCftNUo77fhHP55xA2s9qlf0l-iYzeJjw9F0nEGNSaQOvJzKV1
VitQuAw546tSNle4I2iNI1caqnDG0567I8mYwZRmifXKuLfXRB3dG-ZiAleeP3R9
5l4aQX3DXpqSMgyl9R5NA5-m9Lv6gjBEuQ2j5BESulXKjiSH8BNjrSIbrFTdesv4
25RNY19gsfOppwvCBp1Fqv5aSc5uAdP6gtkgZ0S2KNPvnlrSl-LKfTy_CPH9kyzy
J8atJh_8pvVgr3LnVD5H-Q"
,
          "e": "
AQAB"
}}},
    "DeviceAuthenticationKey": {
      "UDF": "MBVAM-ERHD2-PPPG3-7VWRP-U4AY2-7VOQ5",
      "PublicParameters": {
        "PublicKeyRSA": {
          "kid": "MBVAM-ERHD2-PPPG3-7VWRP-U4AY2-7VOQ5",
          "n": "
tYv9FY3ON556ZCFQKm1aevnjOaAzezXV5k60B39GTZPyBoM7cfXeUpvxcvvUyE1q
G_w0bBg58PckKZqfDR9dX5cH-MpLprtoXGMlSLLLS4wXkaaKxeHVWWLhoMNpYnSp
xzpTTEikofzJZp5RitOr1hnbfTZ7PRmpBrLajpKgg-ACRDQJ03mIa75D04EoLx77
6Ccu4pK0G3K81nu2Lc4Or3Syu_GR4cepAATudiXOU1pg7dpeBruy8jXespyjXUdQ
-wr32yH8qfJWdvsU6vCKbYXH6Hmf_SbCz8r4px5qpNwRb6Vrq1NEA7CbK9arIPgE
6P_D3SybJ0lKc-Qz7wjqlQ"
,
          "e": "
AQAB"
}}},
    "DeviceEncryptiontionKey": {
      "UDF": "MDT3C-LKVOS-EYFGZ-GML2P-YY2IK-OJJIS",
      "PublicParameters": {
        "PublicKeyRSA": {
          "kid": "MDT3C-LKVOS-EYFGZ-GML2P-YY2IK-OJJIS",
          "n": "
8O0fFIjO5vMCjtvJN9nZ6eBc-EeNAvHOlvLyFZNELiY0OGYXEcjmRnN91qSaiR2I
98vQ3GMWzbA0UoLE08kSoz99za-c2mJx_OPxTKL1ZWSXF7IalPwG8KKBBkg7IQSb
OV1UWFB1jHCmDLn02E-zwO9AhHtIvcTgOLqCzCZv7QyMkQ0r7iJft-HbkFotDG8L
XYz-RJ0UeA2jbmx6PbYkMoGpXZe5KwIssOJhyTOkJtqOSpSgRdhgn37yZ6U1mu79
18bLcufFqQ2THnkmDBG-HNKZtcw53EBGYTSTBr1m34DkUn7oCWIKjPWbubxQt1jd
Rg1q1TRnZFETq6DVvuB1_Q"
,
          "e": "
AQAB"
}}}}}]]></artwork>
</figure>
<t>
The device profile is then signed: </t>
<figure anchor="s-3_3-8">
<artwork>
<![CDATA[{
  "SignedDeviceProfile": {
    "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
    "SignedData": {
      "unprotected": {
        "dig": "S512"},
      "payload": "
ewogICJEZXZpY2VQcm9maWxlIjogewogICAgIklkZW50aWZpZXIiOiAiTUM1WFot
UUxPUFUtNkNLNFktM0lTWjUtS0hJTFYtQURQSEkiLAogICAgIk5hbWVzIjogWyJE
...
ICAgICAgICAgImUiOiAiCkFRQUIifX19fX0"
,
      "signatures": [{
          "header": {
            "kid": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI"},
          "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjhYUVk0VkI5VU04bzd0cUdY
aUdack1nQlVnNm5mWXpLVWhBU1E1VHJKWUE5dGVKcTRQTGhqSDVPQWcyN3hLNEEK
b2RVYjJwT2RZaTFJUkJRRXA4VGlaQSJ9"
,
          "signature": "
P7yjwhMYFUqupGsqcZyokfaDZV2o8-vLpXbHEQKihw_9gRokbMvqkwhhQt4RjeL8
DMBj1CgtpauMKbtmaqrpolJfX5IjQPnULTCdeEDvrGuyzw6zVAL8j0xBKCOqWxz-
pmk_kGA7svNBukfQ4wVAI1-PQw8c-garvpRZWFAD1oSkFhMQxhEG1zn0B3abJRmI
Bf9Fukqp1B5HdmOUOEp0MHJ56SaGHOSxKKmp5L3LtDsgmvJ-LumVrYpcaAAvSqI0
4qaUcWSWIGkEZ0pbXAm6O2rQYZjO2YAbLwPIasuukTHf2ukWM4DKIP8sp2qLS35A
EOTudNFW1ImVOiOKWBt-0A"
}]}}}]]></artwork>
</figure>
<section title="Profile Authentication" anchor="s-3_3_1">
<t>
One of the main architecutral principles of the Mesh is  bilateral authentication. Every device that is connected to a  Mesh profile MUST authenticate the profile it is connecting to and every Mesh profile administrator MUST authenticate devices that are connected. </t>
<t>
Having created the necessary profile, the device MUST verify  that it is connecting to the correct Mesh profile. The best  mechanism for achieving this purpose depends on the capabilities  of the device being connected. The administration device  obviously requires some means of communicating with the  user to serve its function. But the device being connected may have a limited display capability or no user interaction  capability at all. </t>
<section title="Interactive Devices" anchor="s-3_3_1_1">
<t>
If the device has user input and display capabilities, it can verify that it is connecting to the correct display by first requesting the user enter the portal account of the profile  they wish to connect to, retreiving the profile associated  with the device and displaying the profile fingerprint.  </t>
<t>
The client requests the profile for the requested account name: </t>
<figure anchor="s-3_3_1_1-3">
<artwork>
<![CDATA[{
  "GetRequest": {
    "Account": "test@prismproof.org",
    "Multiple": false}}]]></artwork>
</figure>
<t>
The response contains the requested profile information. </t>
<figure anchor="s-3_3_1_1-5">
<artwork>
<![CDATA[{
  "GetResponse": {
    "Status": 201,
    "StatusDescription": "Operation completed successfully",
    "Entries": [{
        "SignedPersonalProfile": {
          "Identifier": "MALEI-GTV3E-5W7JR-6NMEY-7G52U-6K3OT",
          "SignedData": {
            "unprotected": {
              "dig": "S512"},
            "payload": "
ewogICJQZXJzb25hbFByb2ZpbGUiOiB7CiAgICAiSWRlbnRpZmllciI6ICJNQUxF
SS1HVFYzRS01VzdKUi02Tk1FWS03RzUyVS02SzNPVCIsCiAgICAiU2lnbmVkTWFz
...
b25zIjogW119fQ"
,
            "signatures": [{
                "header": {
                  "kid": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT"},
                "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCjhhR1g4Z2hibUlhc2FXVEtm
UjBhQ0QyLU5Fckh3Z0RXRkIwM2diSk1hZFhSVkpyZmpYc1RxNXFZeEhyRDRDTzQK
d0JoWXBkejVyRXJVSmtaUVFQYl9lUSJ9"
,
                "signature": "
v0aUBSoxs6FMtFsbWMZViJvVNh3GNliu7CEnw2Ajj-3mRwEtgTFY0H5RiB9AIbI2
TODq7JPKm7-6CCUEugXGdh4ZOnu5A2pAbwtotdAZBpNlhTQTuN6EE-OXwZmZSQyG
DZil2tIjLxYSlsX6vWB4M00HPPYx44TLvbbNVbTVJpw5gnWTceSw5nzIsUqT3gVE
8mCtN2Vo4EWKcMEhUJMx9nUkIaclW9orbA51S3B8QeMGP179cyZ_X_y6TKC3wIB6
AUm6ZQtpa_gBRnAmkbJj6-H_zI_OQIUO_IO2ANL3jI7TSiGPA7VhKsTYDTihMPHs
wfDAwuxZ2a5enFCczaywlg"
}]}}}]}}]]></artwork>
</figure>
<t>
Having received the profile data, the user can then  verify that the device is attempting to  connect to the correct profile by verifying that the  fingerprint shown by the device attempting to connect is correct. </t>
</section>
<section title="Constrained Interaction Devices" anchor="s-3_3_1_2">
<t>
Connection of an Internet of Things 'IoT' device that does  not have the ability to accept user input requires a mechanism by which the user can identify the device they wish to connect  to their profile and a mechanism to authenticate the profile  to the device. </t>
<t>
If the connecting device has a wired communication capability such as a USB port, this MAY be used to effect the device  connection using a standardized interaction profile. But  an increasing number of constrained IoT devices are only  capable of wireless communication. </t>
<t>
Configuration of such devices for the purpose of the Mesh requires that we also consider configuration of the wireless networking capabilities at the same time. The precise mechanism by which  this is achieved is therefore outside the scope of this particular  document. However prototypes have been built and are being considered that make use of some or all of the following communication techniques: </t>
<t><list style="symbols">
<t>
 DHCP signalling. </t>
<t>
 Machine readable device identifiers (barcodes, QRCodes). </t>
<t>
 Default device profile installed during manufacture. </t>
<t>
 Optical communication path using camera on administrative device and status light on connecting device to communicate the device  identifier, challenge nonce and confirm profile fingerprint. </t>
<t>
 Speech output on audio capable connecting device. </t>
</list></t>
</section>
</section>
<section title="Connection request" anchor="s-3_3_2">
<t>
After the user verifies the device fingerprint as correct, the  client posts a device connection request to the portal: </t>
<figure anchor="s-3_3_2-2">
<artwork>
<![CDATA[{
  "ConnectStartRequest": {
    "SignedRequest": {
      "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
      "SignedData": {
        "unprotected": {
          "dig": "S512"},
        "payload": "
ewogICJDb25uZWN0aW9uUmVxdWVzdCI6IHsKICAgICJQYXJlbnRVREYiOiAiTUFM
RUktR1RWM0UtNVc3SlItNk5NRVktN0c1MlUtNkszT1QiLAogICAgIkRldmljZSI6
...
fX0sCiAgICAiRGV2aWNlRGF0YSI6IFtdfX0"
,
        "signatures": [{
            "header": {
              "kid": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI"},
            "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCm54cTR3NzdoN2FSdk5weC1r
MDNGTTF3b1hEN1lLMTN6RGxzcWltVWRCUjUxWkFzNU0wVnZOOFRwQ3F6aXEzcS0K
T1hwbU9FM0xXLXVkSzJSUmVIdmVQZyJ9"
,
            "signature": "
GzjZPfI5yYIR1g69NWQOU2zKKAl_AY2wPfLHJohJ_cK1NGBqkfXDQMMhWfmkvkb1
qqSja0e1zeNkZbd6HYPy-dXNPIcy-6Bf3sV1IqvVn2-TZQbJO_1VnYdj7Xzj7YG9
8FMCiMvtHXUuWtUJdaUzKhxVGlqGPzkROBgODb8CvMV3NVUwykaP5_myvSk9OXIA
OSub_jZ3OX4RPklHMXuffqea0AjF_ezixgsMv01ZcvL3mFKnpk_FoRFZjYH9vP-t
w7fjP7BmRnN2qB7c3GdfLnbovfw1Fcmi7l2MYZymn9BObm2QVvffiz_UVgJBU-qk
PJMj9rTfd4XzjR7Bwf1f6Q"
}]}},
    "AccountID": "test@prismproof.org"}}]]></artwork>
</figure>
<t>
The portal verifies that the request is accepable and returns  the transaction result: </t>
<figure anchor="s-3_3_2-4">
<artwork>
<![CDATA[{
  "ConnectStartResponse": {}}]]></artwork>
</figure>
</section>
<section title="Administrator Polls Pending Connections" anchor="s-3_3_3">
<t>
The client can poll the portal for the status of pending requests at any time (modulo any service throttling restrictions at the  service side). But the request status will only change when an update is posted by an administration device. </t>
<t>
Since the user is typically connecting a device to their profile, the next step in connecting the device is to start the administration client. When started, the client polls for pending connection  requests using ConnectPendingRequest. </t>
<figure anchor="s-3_3_3-3">
<artwork>
<![CDATA[{
  "ConnectPendingRequest": {
    "AccountID": "test@prismproof.org"}}]]></artwork>
</figure>
<t>
The service responds with a list of pending requests: </t>
<figure anchor="s-3_3_3-5">
<artwork>
<![CDATA[{
  "ConnectPendingResponse": {
    "Pending": [{
        "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
        "SignedData": {
          "unprotected": {
            "dig": "S512"},
          "payload": "
ewogICJDb25uZWN0aW9uUmVxdWVzdCI6IHsKICAgICJQYXJlbnRVREYiOiAiTUFM
RUktR1RWM0UtNVc3SlItNk5NRVktN0c1MlUtNkszT1QiLAogICAgIkRldmljZSI6
...
fX0sCiAgICAiRGV2aWNlRGF0YSI6IFtdfX0"
,
          "signatures": [{
              "header": {
                "kid": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI"},
              "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCm54cTR3NzdoN2FSdk5weC1r
MDNGTTF3b1hEN1lLMTN6RGxzcWltVWRCUjUxWkFzNU0wVnZOOFRwQ3F6aXEzcS0K
T1hwbU9FM0xXLXVkSzJSUmVIdmVQZyJ9"
,
              "signature": "
GzjZPfI5yYIR1g69NWQOU2zKKAl_AY2wPfLHJohJ_cK1NGBqkfXDQMMhWfmkvkb1
qqSja0e1zeNkZbd6HYPy-dXNPIcy-6Bf3sV1IqvVn2-TZQbJO_1VnYdj7Xzj7YG9
8FMCiMvtHXUuWtUJdaUzKhxVGlqGPzkROBgODb8CvMV3NVUwykaP5_myvSk9OXIA
OSub_jZ3OX4RPklHMXuffqea0AjF_ezixgsMv01ZcvL3mFKnpk_FoRFZjYH9vP-t
w7fjP7BmRnN2qB7c3GdfLnbovfw1Fcmi7l2MYZymn9BObm2QVvffiz_UVgJBU-qk
PJMj9rTfd4XzjR7Bwf1f6Q"
}]}}]}}]]></artwork>
</figure>
</section>
<section title="Administrator updates and publishes the personal profile." anchor="s-3_3_4">
<t>
The device profile is added to the Personal profile which is then signed by the online signing key. The administration client publishes the updated profile to the Mesh through the portal: </t>
<figure anchor="s-3_3_4-2">
<artwork>
<![CDATA[{
  "ConnectPendingRequest": {
    "AccountID": "test@prismproof.org"}}]]></artwork>
</figure>
<t>
As usual, the service returns the response code: </t>
<figure anchor="s-3_3_4-4">
<artwork>
<![CDATA[{
  "ConnectPendingResponse": {
    "Pending": [{
        "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
        "SignedData": {
          "unprotected": {
            "dig": "S512"},
          "payload": "
ewogICJDb25uZWN0aW9uUmVxdWVzdCI6IHsKICAgICJQYXJlbnRVREYiOiAiTUFM
RUktR1RWM0UtNVc3SlItNk5NRVktN0c1MlUtNkszT1QiLAogICAgIkRldmljZSI6
...
fX0sCiAgICAiRGV2aWNlRGF0YSI6IFtdfX0"
,
          "signatures": [{
              "header": {
                "kid": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI"},
              "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCm54cTR3NzdoN2FSdk5weC1r
MDNGTTF3b1hEN1lLMTN6RGxzcWltVWRCUjUxWkFzNU0wVnZOOFRwQ3F6aXEzcS0K
T1hwbU9FM0xXLXVkSzJSUmVIdmVQZyJ9"
,
              "signature": "
GzjZPfI5yYIR1g69NWQOU2zKKAl_AY2wPfLHJohJ_cK1NGBqkfXDQMMhWfmkvkb1
qqSja0e1zeNkZbd6HYPy-dXNPIcy-6Bf3sV1IqvVn2-TZQbJO_1VnYdj7Xzj7YG9
8FMCiMvtHXUuWtUJdaUzKhxVGlqGPzkROBgODb8CvMV3NVUwykaP5_myvSk9OXIA
OSub_jZ3OX4RPklHMXuffqea0AjF_ezixgsMv01ZcvL3mFKnpk_FoRFZjYH9vP-t
w7fjP7BmRnN2qB7c3GdfLnbovfw1Fcmi7l2MYZymn9BObm2QVvffiz_UVgJBU-qk
PJMj9rTfd4XzjR7Bwf1f6Q"
}]}}]}}]]></artwork>
</figure>
</section>
<section title="Administrator posts completion request." anchor="s-3_3_5">
<t>
Having accepted the device and connected it to the profile, the administration client creates and signs a connection completion result which is posted to the portal using ConnectCompleteRequest: </t>
<figure anchor="s-3_3_5-2">
<artwork>
<![CDATA[{
  "ConnectCompleteRequest": {
    "Result": {
      "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
      "SignedData": {
        "unprotected": {
          "dig": "S512"},
        "payload": "
ewogICJDb25uZWN0aW9uUmVzdWx0IjogewogICAgIkRldmljZSI6IHsKICAgICAg
IklkZW50aWZpZXIiOiAiTUM1WFotUUxPUFUtNkNLNFktM0lTWjUtS0hJTFYtQURQ
...
CmhCcXZGM2NzWEdKOERfLTVhZlY5OWcifV19fX19fQ"
,
        "signatures": [{
            "header": {
              "kid": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT"},
            "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCmhiZENhZXQ3MXNzaWlqVkpV
TWduTUNIcExyVjUwNmx5ejZKU25SaFpBNG1YU19FcXluLUNfUjhGQkFSamRMR3EK
TVRsaVBEMDZuM0ZsRk1OdXppMTFmQSJ9"
,
            "signature": "
tGk7QPnDx9AinDZbkMHUnSKHDDO0SOTBBDRt-ia3WimTmnpbfPXvdyWhKSwtpyWE
sYx7pQMwufCxtA3v1f02dOMGsJTmQQ44rAmE5InSuFFrWSWoXXZfcfdveiGZg9vj
Mg0_RBDD3pdASLa7ZFQhM1hqmXVCT-zsITzqGHejO3oUWAhRFtWIHycaBWRw4TDM
B4lmQy3qEdgWhbqvllIUPDAw-sBZzRnNRnc4p3SyYXUWAisvdOhjn9ICS9iSeHEY
IvDtR7-Lal2N8mzfRubLEKMtEtj6CEShqTva2sCCgJJEHxyLqcZTUXhE-YGR2nQD
p9KsdZpdLo-RpDVkMnqmQA"
}]}},
    "AccountID": "test@prismproof.org"}}]]></artwork>
</figure>
<t>
Again, the service returns the response code: </t>
<figure anchor="s-3_3_5-4">
<artwork>
<![CDATA[{
  "ConnectCompleteResponse": {}}]]></artwork>
</figure>
</section>
<section title="Connecting device polls for status update." anchor="s-3_3_6">
<t>
As stated previously, the connecting device polls the portal  periodically to determine the status of the pending request using ConnectStatusRequest: </t>
<figure anchor="s-3_3_6-2">
<artwork>
<![CDATA[{
  "ConnectStatusRequest": {
    "AccountID": "test@prismproof.org",
    "DeviceID": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI"}}]]></artwork>
</figure>
<t>
If the response is that the connection status has not changed, the service MAY return a response that specifies a minimum  retry interval. In this case however there is a connection result:  </t>
<figure anchor="s-3_3_6-4">
<artwork>
<![CDATA[{
  "ConnectStatusResponse": {
    "Result": {
      "Identifier": "MC5XZ-QLOPU-6CK4Y-3ISZ5-KHILV-ADPHI",
      "SignedData": {
        "unprotected": {
          "dig": "S512"},
        "payload": "
ewogICJDb25uZWN0aW9uUmVzdWx0IjogewogICAgIkRldmljZSI6IHsKICAgICAg
IklkZW50aWZpZXIiOiAiTUM1WFotUUxPUFUtNkNLNFktM0lTWjUtS0hJTFYtQURQ
...
CmhCcXZGM2NzWEdKOERfLTVhZlY5OWcifV19fX19fQ"
,
        "signatures": [{
            "header": {
              "kid": "MCWKN-SFJ2G-CDZQ4-ZPT4S-GS6LU-Y3COT"},
            "protected": "
ewogICJhbGciOiAiUlM1MTIiLAogICJ2YWwiOiAiCmhiZENhZXQ3MXNzaWlqVkpV
TWduTUNIcExyVjUwNmx5ejZKU25SaFpBNG1YU19FcXluLUNfUjhGQkFSamRMR3EK
TVRsaVBEMDZuM0ZsRk1OdXppMTFmQSJ9"
,
            "signature": "
tGk7QPnDx9AinDZbkMHUnSKHDDO0SOTBBDRt-ia3WimTmnpbfPXvdyWhKSwtpyWE
sYx7pQMwufCxtA3v1f02dOMGsJTmQQ44rAmE5InSuFFrWSWoXXZfcfdveiGZg9vj
Mg0_RBDD3pdASLa7ZFQhM1hqmXVCT-zsITzqGHejO3oUWAhRFtWIHycaBWRw4TDM
B4lmQy3qEdgWhbqvllIUPDAw-sBZzRnNRnc4p3SyYXUWAisvdOhjn9ICS9iSeHEY
IvDtR7-Lal2N8mzfRubLEKMtEtj6CEShqTva2sCCgJJEHxyLqcZTUXhE-YGR2nQD
p9KsdZpdLo-RpDVkMnqmQA"
}]}}}}]]></artwork>
</figure>
<t>
[Should probably unpack further.] </t>
</section>
</section>
<section title="Adding an application profile to a user profile" anchor="s-3_4">
<t>
Application profiles are published separately from the  personal profile to which they are linked. This allows a  device to be given administration capability for a particular application without granting administration capability for  the profile itself and the ability to connect additional  profiles and devices. </t>
<t>
Another advantage of this separation is that an application  profile might be managed by a separate party. In an enterprise, the application profile for a user's corporate email account  could be managed by the corporate IT department. </t>
<t>
A user MAY have multiple application profiles for the same application. If a user has three email accounts, they would  have three email application profiles, one for each account. </t>
<t>
In this example, the user has requested a PaswordProfile to be created. When populated, this records the usernames and passwords for the various Web sites that the user has created accounts at  and has requested the Web browser store in the Mesh. </t>
<t>
Unlike a traditional password management service, the data stored the Password Profile is encrypted end to end and can only be  decrypted by the devices that hold a decryption key. </t>
<figure anchor="s-3_4-6">
<artwork>
<![CDATA[{Example.PasswordProfile1}]]></artwork>
</figure>
<t>
The application profile is published to the Mesh in the same way as any other profile update, via a a Publish transaction: </t>
<t>
% Point = Example.Traces.Get (Example.LabelApplicationWeb1); {Point.Messages[0].String()} </t>
<t>
The service returns a status response. </t>
<t>
{Point.Messages[1].String()} </t>
<t>
Note that the degree of verification to be performed by the service when an application profile is published is an open question. </t>
<t>
Having created the application profile, the administration client adds it to the personal profile and publishes it: </t>
<t>
{Point.Messages[0].String()} </t>
<t>
Note that if the publication was to happen in the reverse order, with the personal profile being published before the application profile, the personal profile might be rejected by the portal for  inconsistency as it links to a non existent application profile. Though the value of such a check is debatable. It might well be preferable to not make such checks as it permits an application profile to have a degree of anonymity. </t>
<t>
{Point.Messages[1].String()} </t>
</section>
<section title="Creating a recovery profile" anchor="s-3_5">
<t>
The Mesh invites users to put all their data eggs in one cryptographic basket. If the private keys in their master profile are lost, they could lose all their digital assets. </t>
<t>
The debate over the desirability of key escrow is a complex one. Not least because voluntary key escrow by the user to protect the user's digital assets is frequently conflated with mechanisms to support 'Lawful Access' through government managed backdoors. </t>
<t>
Accidents happen and so do disasters. For most users and most applications, data loss is a much more important concern than data disclosure. The option  of using a robust key recovery mechanism is therefore essential for use of  strong cryptography is to become ubiquitous. </t>
<t>
There are of course circumstances in which some users may prefer to risk losing some of their data rather than risk disclosure. Since any key recovery infrastructure necessarily introduces the risk of coercion, the choice of whether to use key recovery or not is left to the user to  decide. </t>
<t>
The Mesh permits users to escrow their private keys in the Mesh itself in an OfflineEscrowEntry. Such entries are encrypted using the strongest degree of encryption available under a symmetric key.  The symmetric key is then in turn split using Shamir secret sharing using an n of m threshold scheme. </t>
<t>
The OfflineEscrowEntry identifier is a UDF fingerprint of the symmetric key used to encrypt the data. This guarantees that a party that has the decryption key has the ability to locate the corresponding Escrow entry. </t>
<t>
The OfflineEscrowEntry is published using the usual Publish transaction: </t>
<t>
{Point.Messages[0].String()} </t>
<t>
The response indicates success or failure: </t>
<t>
{Point.Messages[1].String()} </t>
</section>
<section title="Recovering a profile" anchor="s-3_6">
<t>
To recover a profile, the user MUST supply the necessary number of  secret shares. These are then used to calculate the UDF fingerprint to use as the locator in a Get transaction: </t>
<t>
{Point.Messages[0].String()} </t>
<t>
If the transaction succeeds, GetResponse is returned with the  requested data. </t>
<t>
{Point.Messages[1].String()} </t>
<t>
The client can now decrypt the OfflineEscrowEntry to recover the  private key(s). </t>
</section>
</section>
<section title="Shared Classes" anchor="s-4">
<t>
The following classes are used as common elements in Mesh profile specifications.a </t>
<section title="Cryptographic Data Classes" anchor="s-4_1">
<t>
Most Mesh objects are signed and/or encrypted. For consistency all Mesh classes make use of the cryptographic data classes described in this section. </t>
<section title="Structure: PublicKey" anchor="s-4_1_1">
<t>
The PublicKey class is used to describe public key pairs and  trust assertions associated with a public key. </t>
<t><list style="hanging">
<t hangText="UDF: String (Optional)">
UDF fingerprint of the public key parameters/ </t>
<t hangText="X509Certificate: Binary (Optional)">
List of X.509 Certificates </t>
<t hangText="X509Chain: Binary [0..Many]">
X.509 Certificate chain. </t>
<t hangText="X509CSR: Binary (Optional)">
X.509 Certificate Signing Request.  </t>
</list></t>
</section>
<section title="Structure: SignedData" anchor="s-4_1_2">
<t>
Container for JOSE signed data and related attributes. </t>
<t><list style="hanging">
<t hangText="Data: Binary (Optional)">
The signed data  </t>
</list></t>
</section>
<section title="Structure: EncryptedData" anchor="s-4_1_3">
<t>
Container for JOSE encrypted data and related attributes. </t>
<t><list style="hanging">
<t hangText="Data: Binary (Optional)">
The encrypted data  </t>
</list></t>
</section>
</section>
<section title="Common Application Classes" anchor="s-4_2">
<section title="Structure: Connection" anchor="s-4_2_1">
<t>
Describes network connection parameters for an application </t>
<t><list style="hanging">
<t hangText="ServiceName: String (Optional)">
DNS address of the server </t>
<t hangText="Port: Integer (Optional)">
TCP/UDP Port number </t>
<t hangText="Prefix: String (Optional)">
DNS service prefix as described in [!RFC6335] </t>
<t hangText="Security: String [0..Many]">
Describes the security mode to use. Valid choices are Direct/Upgrade/None </t>
<t hangText="UserName: String (Optional)">
Username to present to the service for authentication </t>
<t hangText="Password: String (Optional)">
Password to present to the service for authentication </t>
<t hangText="URI: String (Optional)">
Service connection parameters in URI format </t>
<t hangText="Authentication: String (Optional)">
List of the supported/acceptable authentication mechanisms, preferred mechanism first. </t>
<t hangText="TimeOut: Integer (Optional)">
Service timeout in seconds. </t>
<t hangText="Polling: Boolean (Optional)">
If set, the client should poll the specified service intermittently for updates.  </t>
</list></t>
</section>
</section>
</section>
<section title="Mesh Profile Objects" anchor="s-5">
<section title="Base Profile Objects" anchor="s-5_1">
<section title="Structure: Entry" anchor="s-5_1_1">
<t>
Base class for all Mesh Profile objects. </t>
<t><list style="hanging">
<t hangText="Identifier: String (Optional)">
Globally unique identifier that remains constant for the lifetime of the  entry.  </t>
</list></t>
</section>
<section title="Structure: SignedProfile" anchor="s-5_1_2">
<t><list style="hanging">
<t hangText="Inherits: Entry"></t>
</list></t>
<t>
Contains a signed profile entry </t>
<t><list style="hanging">
<t hangText="SignedData: JoseWebSignature (Optional)">
The signed profile. </t>
<t>
Note that each child of SignedProfile requires that the Payload field of the SignedData object contain an object of a specific type.  For example, a SignedDeviceProfile object MUST contain a Payload field that contains a DeviceProfile object. </t>
<t hangText="Unauthenticated: Advice (Optional)">
Additional data that is not authenticated.  </t>
</list></t>
</section>
<section title="Structure: Advice" anchor="s-5_1_3">
<t>
Additional data bound to a signed profile that is not authenticated. </t>
<t><list style="hanging">
<t hangText="Default: DateTime (Optional)">
If specified, the profile was the default profile at the specified  date and time. The current default for that type of profile is the profile with the most recent Default timestamp.  </t>
</list></t>
</section>
<section title="Structure: PortalAdvice" anchor="s-5_1_4">
<t>
Describes the portal(s) at which the profile is registered. </t>
<t><list style="hanging">
<t hangText="Inherits: Advice">
</t>
<t hangText="Inherits: Advice"></t>
<t hangText="PortalAddress: String [0..Many]">
A portal address at which this profile is registered.  </t>
</list></t>
</section>
<section title="Structure: Profile" anchor="s-5_1_5">
<t><list style="hanging">
<t hangText="Inherits: Entry"></t>
</list></t>
<t>
Parent class from which all profile types are derived </t>
<t><list style="hanging">
<t hangText="Names: String [0..Many]">
Fingerprints of index terms for profile retrieval. The use of the fingerprint of the name rather than the name itself is a precaution against enumeration attacks and other forms of abuse. </t>
<t hangText="Updated: DateTime (Optional)">
The time instant the profile was last modified. </t>
<t hangText="NotaryToken: String (Optional)">
A Uniform Notary Token providing evidence that a signature was performed after the notary token was created.  </t>
</list></t>
</section>
</section>
<section title="Device Profile Classes" anchor="s-5_2">
<section title="Structure: SignedDeviceProfile" anchor="s-5_2_1">
<t><list style="hanging">
<t hangText="Inherits: SignedProfile"></t>
</list></t>
<t>
Contains a signed device profile </t>
<t>
[No fields] </t>
</section>
<section title="Structure: DeviceProfile" anchor="s-5_2_2">
<t><list style="hanging">
<t hangText="Inherits: Profile"></t>
</list></t>
<t>
Describes a mesh device. </t>
<t><list style="hanging">
<t hangText="Description: String (Optional)">
Description of the device </t>
<t hangText="DeviceSignatureKey: PublicKey (Optional)">
Key used to sign certificates for the DAK and DEK. The fingerprint of the DSK is the UniqueID of the Device Profile </t>
<t hangText="DeviceAuthenticationKey: PublicKey (Optional)">
Key used to authenticate requests made by the device. </t>
<t hangText="DeviceEncryptiontionKey: PublicKey (Optional)">
Key used to pass encrypted data to the device such as a DeviceUseEntry  </t>
</list></t>
</section>
<section title="Structure: DevicePrivateProfile" anchor="s-5_2_3">
<t>
Private portion of device encryption profile.  </t>
<t><list style="hanging">
<t hangText="DeviceSignatureKey: Key (Optional)">
Private portion of the DeviceSignatureKey </t>
<t hangText="DeviceAuthenticationKey: Key (Optional)">
Private portion of the DeviceAuthenticationKey </t>
<t hangText="DeviceEncryptiontionKey: Key (Optional)">
Private portion of the DeviceEncryptiontionKey  </t>
</list></t>
</section>
</section>
<section title="Master Profile Objects" anchor="s-5_3">
<section title="Structure: SignedMasterProfile" anchor="s-5_3_1">
<t><list style="hanging">
<t hangText="Inherits: SignedProfile"></t>
</list></t>
<t>
Contains a signed Personal master profile </t>
<t>
[No fields] </t>
</section>
<section title="Structure: MasterProfile" anchor="s-5_3_2">
<t><list style="hanging">
<t hangText="Inherits: Profile"></t>
</list></t>
<t>
Describes the long term parameters associated with a personal profile. </t>
<t><list style="hanging">
<t hangText="MasterSignatureKey: PublicKey (Optional)">
The root of trust for the Personal PKI, the public key of the PMSK  is presented as a self-signed X.509v3 certificate with Certificate  Signing use enabled. The PMSK is used to sign certificates for the  PMEK, POSK and PKEK keys. </t>
<t hangText="MasterEscrowKeys: PublicKey [0..Many]">
A Personal Profile MAY contain one or more PMEK keys to enable escrow  of private keys used for stored data.  </t>
<t hangText="OnlineSignatureKeys: PublicKey [0..Many]">
A Personal profile contains at least one POSK which is used to sign  device administration application profiles.  </t>
</list></t>
</section>
</section>
<section title="Personal Profile Objects" anchor="s-5_4">
<section title="Structure: SignedPersonalProfile" anchor="s-5_4_1">
<t><list style="hanging">
<t hangText="Inherits: SignedProfile"></t>
</list></t>
<t>
Contains a signed Personal current profile </t>
<t>
[No fields] </t>
</section>
<section title="Structure: PersonalProfile" anchor="s-5_4_2">
<t><list style="hanging">
<t hangText="Inherits: Profile"></t>
</list></t>
<t>
Describes the current applications and devices connected to a  personal master profile. </t>
<t><list style="hanging">
<t hangText="SignedMasterProfile: SignedMasterProfile (Optional)">
The corresponding master profile.  The profile MUST be signed by the PMSK. </t>
<t hangText="Devices: SignedDeviceProfile [0..Many]">
The set of device profiles connected to the profile. The profile MUST be signed by the DSK in the profile. </t>
<t hangText="Applications: ApplicationProfileEntry [0..Many]">
Application profiles connected to this profile.  </t>
</list></t>
</section>
<section title="Structure: ApplicationProfileEntry" anchor="s-5_4_3">
<t>
Personal profile entry describing the privileges of specific devices. </t>
<t><list style="hanging">
<t hangText="Identifier: String (Optional)">
The unique identifier of the application </t>
<t hangText="Type: String (Optional)">
The application type </t>
<t hangText="Friendly: String (Optional)">
Optional friendly name identifying the application. </t>
<t hangText="AdminDeviceUDF: String [0..Many]">
List of devices authorized to sign application profiles </t>
<t hangText="DecryptDeviceUDF: String [0..Many]">
List of devices authorized to read private parts of application  profiles. </t>
<t hangText="AccountID: String (Optional)">
The account at which the profile is located.  </t>
</list></t>
</section>
</section>
<section title="Application Profile Objects" anchor="s-5_5">
<section title="Structure: SignedApplicationProfile" anchor="s-5_5_1">
<t><list style="hanging">
<t hangText="Inherits: SignedProfile"></t>
</list></t>
<t>
Contains a signed device profile </t>
<t>
[No fields] </t>
</section>
<section title="Structure: ApplicationProfile" anchor="s-5_5_2">
<t><list style="hanging">
<t hangText="Inherits: Profile"></t>
</list></t>
<t>
Parent class from which all application profiles inherit. </t>
<t>
[No fields] </t>
</section>
<section title="Structure: ApplicationProfilePrivate" anchor="s-5_5_3">
<t><list style="hanging">
<t hangText="Inherits: Entry"></t>
</list></t>
<t>
The base class for all private profiles. </t>
<t>
[No fields] </t>
</section>
<section title="Structure: ApplicationDevicePublic" anchor="s-5_5_4">
<t><list style="hanging">
<t hangText="Inherits: Entry"></t>
</list></t>
<t>
Describes the public per device data </t>
<t><list style="hanging">
<t hangText="DeviceDescription: String (Optional)">
Description of the device for convenience of the user. </t>
<t hangText="DeviceUDF: String (Optional)">
Fingerprint of device that this key corresponds to.  </t>
</list></t>
</section>
<section title="Structure: ApplicationDevicePrivate" anchor="s-5_5_5">
<t><list style="hanging">
<t hangText="Inherits: Entry"></t>
</list></t>
<t>
Describes the private per device data </t>
<t>
[No fields] </t>
</section>
</section>
<section title="Key Escrow Objects" anchor="s-5_6">
<section title="Structure: EscrowEntry" anchor="s-5_6_1">
<t><list style="hanging">
<t hangText="Inherits: Entry"></t>
</list></t>
<t>
Contains escrowed data </t>
<t><list style="hanging">
<t hangText="EncryptedData: JoseWebEncryption (Optional)">
The encrypted escrow data   </t>
</list></t>
</section>
<section title="Structure: OfflineEscrowEntry" anchor="s-5_6_2">
<t><list style="hanging">
<t hangText="Inherits: EscrowEntry"></t>
</list></t>
<t>
Contains data escrowed using the offline escrow mechanism. </t>
<t>
[No fields] </t>
</section>
<section title="Structure: OnlineEscrowEntry" anchor="s-5_6_3">
<t><list style="hanging">
<t hangText="Inherits: EscrowEntry"></t>
</list></t>
<t>
Contains data escrowed using the online escrow mechanism. </t>
<t>
[No fields] </t>
</section>
<section title="Structure: EscrowedKeySet" anchor="s-5_6_4">
<t>
A set of escrowed keys.  </t>
<t>
[No fields] </t>
</section>
</section>
</section>
<section title="Portal Connection" anchor="s-6">
<section title="Connection Request and Response Structures" anchor="s-6_1">
<section title="Structure: ConnectionRequest" anchor="s-6_1_1">
<t>
Describes a connection request. </t>
<t><list style="hanging">
<t hangText="ParentUDF: String (Optional)">
UDF of Mesh Profile to which connection is requested. </t>
<t hangText="Device: SignedDeviceProfile (Optional)">
The Device profile to be connected  </t>
</list></t>
</section>
<section title="Structure: SignedConnectionRequest" anchor="s-6_1_2">
<t><list style="hanging">
<t hangText="Inherits: SignedProfile"></t>
</list></t>
<t>
Contains a ConnectionRequest signed by the  corresponding device signature key. </t>
<t>
[No fields] </t>
</section>
<section title="Structure: ConnectionResult" anchor="s-6_1_3">
<t>
Describes the result of a connection request. </t>
<t><list style="hanging">
<t hangText="Inherits: ConnectionRequest">
</t>
<t hangText="Inherits: ConnectionRequest"></t>
<t hangText="Result: String (Optional)">
The result of the connection request. Valid responses are: Accepted, Refused, Query.  </t>
</list></t>
</section>
<section title="Structure: SignedConnectionResult" anchor="s-6_1_4">
<t><list style="hanging">
<t hangText="Inherits: SignedProfile"></t>
</list></t>
<t>
Contains a signed connection result </t>
<t>
[No fields] </t>
</section>
</section>
</section>
<section title="Mesh Portal Service Reference" anchor="s-7">
<t><list style="hanging">
<t hangText="HTTP Well Known Service Prefix: /.well-known/mmm"></t>
</list></t>
<t>
Every Mesh Portal Service transaction consists of exactly one request followed by exactly one response. Mesh Service transactions MAY cause modification of the data stored in the Mesh Portal or the Mesh itself but do not cause changes to the connection state. The protocol itself is thus idempotent. There is no set sequence in which operations are required to be performed. It is not necessary to perform a Hello transaction prior to a ValidateAccount, Publish or any other transaction. </t>
<section title="Request Messages" anchor="s-7_1">
<t>
A Mesh Portal Service request consists of a payload object that inherits from the MeshRequest class. When using the  HTTP binding, the request MUST specify the portal DNS address in the HTTP Host field.  </t>
<section title="Message: MeshRequest" anchor="s-7_1_1">
<t>
Base class for all request messages. </t>
<t><list style="hanging">
<t hangText="Portal: String (Optional)">
Name of the Mesh Portal Service to which the request  is directed.  </t>
</list></t>
</section>
</section>
<section title="Response Messages" anchor="s-7_2">
<t>
A Mesh Portal Service response consists of a payload object that inherits from the MeshResponse class. When using the HTTP binding, the response SHOULD report the Status response code in the HTTP response  message. However the response code returned in the payload object MUST always be considered authoritative. </t>
<section title="Message: MeshResponse" anchor="s-7_2_1">
<t>
Base class for all response messages. Contains only the status code and status description fields. </t>
<t>
[No fields] </t>
</section>
</section>
<section title="Imported Objects" anchor="s-7_3">
<t>
The Mesh Service protocol makes use of JSON objects defined in the JOSE Signatgure and Encryption specifications. </t>
</section>
<section title="Common Structures" anchor="s-7_4">
<t>
The following common structures are used in the protocol messages: </t>
<section title="Structure: KeyValue" anchor="s-7_4_1">
<t>
Describes a Key/Value structure used to make queries for records matching one or more selection criteria. </t>
<t><list style="hanging">
<t hangText="Key: String (Optional)">
The data retrieval key. </t>
<t hangText="Value: String (Optional)">
The data value to match.  </t>
</list></t>
</section>
<section title="Structure: SearchConstraints" anchor="s-7_4_2">
<t>
Specifies constraints to be applied to a search result. These  allow a client to limit the number of records returned, the quantity of data returned, the earliest and latest data returned, etc. </t>
<t><list style="hanging">
<t hangText="NotBefore: DateTime (Optional)">
Only data published on or after the specified time instant  is requested. </t>
<t hangText="Before: DateTime (Optional)">
Only data published before the specified time instant is requested. This excludes data published at the specified time instant. </t>
<t hangText="MaxEntries: Integer (Optional)">
Maximum number of data entries to return. </t>
<t hangText="MaxBytes: Integer (Optional)">
Maximum number of data bytes to return. </t>
<t hangText="PageKey: String (Optional)">
Specifies a page key returned in a previous search operation in which the number of responses exceeded the specified bounds. </t>
<t>
When a page key is specified, all the other search parameters except for MaxEntries and MaxBytes are ignored and the service returns the next set of data responding to the earlier query.  </t>
</list></t>
</section>
</section>
<section title="Transaction: Hello" anchor="s-7_5">
<t><list style="hanging">
<t hangText="Request: HelloRequest">
</t>
<t hangText="Request: HelloRequest"></t>
<t hangText="Response: HelloResponse"></t>
</list></t>
<t>
Report service and version information.  </t>
<t>
The Hello transaction provides a means of determining which protocol versions, message encodings and transport protocols are supported by the service. </t>
</section>
<section title="Transaction: ValidateAccount" anchor="s-7_6">
<t><list style="hanging">
<t hangText="Request: ValidateRequest">
</t>
<t hangText="Request: ValidateRequest"></t>
<t hangText="Response: ValidateResponse"></t>
</list></t>
<t>
Request validation of a proposed name for a new account. </t>
<t>
For validation of a user's account name during profile creation. </t>
<section title="Message: ValidateRequest" anchor="s-7_6_1">
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
Describes the proposed account properties. Currently, these are limited to the account name but could be extended in future versions of the protocol. </t>
<t><list style="hanging">
<t hangText="Account: String (Optional)">
Account name requested </t>
<t hangText="Reserve: Boolean (Optional)">
If true, request a reservation for the specified account name. Note that the service is not obliged to honor reservation  requests. </t>
<t hangText="Language: String [0..Many]">
List of ISO language codes in order of preference. For creating explanatory text.  </t>
</list></t>
</section>
<section title="Message: ValidateResponse" anchor="s-7_6_2">
<t><list style="hanging">
<t hangText="Inherits: MeshResponse"></t>
</list></t>
<t>
States whether the proposed account properties are acceptable and (optional) returns an indication of what properties are valid. </t>
<t>
Note that receiving a 'Valid' responseto a Validate Request does not guarantee creation of the account. In addition to the possibility  that the account namecould be requested by another user between the  Validate and Create transactions, a portal service MAY perform more  stringent validation criteria when an account is actually being  created. For example, checking with the authoritative list of current accounts rather than a cached copy. </t>
<t><list style="hanging">
<t hangText="Valid: Boolean (Optional)">
If true, the specified account identifier is acceptable. If false, the account identifier is rejected. </t>
<t hangText="Minimum: Integer (Optional)">
Specifies the minimum length of an account name. </t>
<t hangText="Maximum: Integer (Optional)">
Specifies the maximum length of an account name. </t>
<t hangText="InvalidCharacters: String (Optional)">
A list of characters that the service  does not accept in account names. The list of characters  MAY not be exhaustive but SHOULD include any illegal characters in the proposed account name. </t>
<t hangText="Reason: String (Optional)">
Text explaining the reason an account name was rejected.  </t>
</list></t>
</section>
</section>
<section title="Transaction: CreateAccount" anchor="s-7_7">
<t><list style="hanging">
<t hangText="Request: CreateRequest">
</t>
<t hangText="Request: CreateRequest"></t>
<t hangText="Response: CreateResponse"></t>
</list></t>
<t>
Request creation of a new portal account. </t>
<t>
Unlike a profile, a mesh account is specific to a particular  Mesh portal. A mesh account must be created and accepted before a profile can be published. </t>
<section title="Message: CreateRequest" anchor="s-7_7_1">
<t>
Request creation of a new portal account. The request specifies the requested account identifier and the Mesh profile to be associated  with the account. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="Account: String (Optional)">
Account identifier requested.  </t>
</list></t>
</section>
<section title="Message: CreateResponse" anchor="s-7_7_2">
<t><list style="hanging">
<t hangText="Inherits: MeshResponse"></t>
</list></t>
<t>
Reports the success or failure of a Create transaction. </t>
<t>
[No fields] </t>
</section>
</section>
<section title="Transaction: DeleteAccount" anchor="s-7_8">
<t><list style="hanging">
<t hangText="Request: DeleteRequest">
</t>
<t hangText="Request: DeleteRequest"></t>
<t hangText="Response: DeleteResponse"></t>
</list></t>
<t>
Request deletion of a portal account. </t>
<t>
Deletes a portal account but not the underlying profile. Once registered, profiles are permanent. </t>
<section title="Message: DeleteRequest" anchor="s-7_8_1">
<t>
Request deletion of a new portal account. The request specifies the requested account identifier. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="Account: String (Optional)">
Account identifier to be deleted.  </t>
</list></t>
</section>
<section title="Message: DeleteResponse" anchor="s-7_8_2">
<t><list style="hanging">
<t hangText="Inherits: MeshResponse"></t>
</list></t>
<t>
Reports the success or failure of a Delete transaction. </t>
<t>
[No fields] </t>
</section>
</section>
<section title="Transaction: Get" anchor="s-7_9">
<t><list style="hanging">
<t hangText="Request: GetRequest">
</t>
<t hangText="Request: GetRequest"></t>
<t hangText="Response: GetResponse"></t>
</list></t>
<t>
Search for data in the mesh that matches a set of properties described by a sequence of key/value pairs. </t>
<section title="Message: GetRequest" anchor="s-7_9_1">
<t>
Describes the Portal or Mesh data to be retreived. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="Identifier: String (Optional)">
Lookup by profile ID </t>
<t hangText="Account: String (Optional)">
Lookup by Account ID </t>
<t hangText="KeyValues: KeyValue [0..Many]">
List of KeyValue pairs specifying the conditions to be met </t>
<t hangText="SearchConstraints: SearchConstraints (Optional)">
Constrain the search to a specific time interval and/or  limit the number and/or total size of data records returned. </t>
<t hangText="Multiple: Boolean (Optional)">
If true return multiple responses if available </t>
<t hangText="Full: Boolean (Optional)">
If true, the client requests that the full Mesh data record  be returned containing both the Mesh entry itself and the  Mesh metadata that allows the date and time of the  publication of the Mesh entry to be verified.  </t>
</list></t>
</section>
<section title="Message: GetResponse" anchor="s-7_9_2">
<t>
Reports the success or failure of a Get transaction. If a Mesh entry matching the specified profile is found, containsthe list of entries matching the request. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshResponse">
</t>
<t hangText="Inherits: MeshResponse"></t>
<t hangText="DataItems: DataItem [0..Many]">
List of mesh data records matching the request. </t>
<t hangText="PageKey: String (Optional)">
If non-null, indicates that the number and/or size of the data records returned exceeds either the SearchConstraints specified in the request or internal server limits.  </t>
</list></t>
</section>
</section>
<section title="Transaction: Publish" anchor="s-7_10">
<t><list style="hanging">
<t hangText="Request: PublishRequest">
</t>
<t hangText="Request: PublishRequest"></t>
<t hangText="Response: PublishResponse"></t>
</list></t>
<t>
Publish a profile or key escrow entry to the mesh. </t>
<section title="Message: PublishRequest" anchor="s-7_10_1">
<t>
Requests publication of the specified Mesh entry. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
[No fields] </t>
</section>
<section title="Message: PublishResponse" anchor="s-7_10_2">
<t>
Reports the success or failure of a Publish transaction. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshResponse"></t>
</list></t>
<t>
[No fields] </t>
</section>
</section>
<section title="Transaction: Status" anchor="s-7_11">
<t><list style="hanging">
<t hangText="Request: StatusRequest">
</t>
<t hangText="Request: StatusRequest"></t>
<t hangText="Response: StatusResponse"></t>
</list></t>
<t>
Request the current status of the mesh as seen by the portal to which it is directed. </t>
<t>
The response to the status request contains the last signed checkpoint and proof chains for each of the peer portals that have been checkpointed. </t>
<t>
[Not currently implemented] </t>
<section title="Message: StatusRequest" anchor="s-7_11_1">
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
Initiates a status transaction. </t>
<t>
[No fields] </t>
</section>
<section title="Message: StatusResponse" anchor="s-7_11_2">
<t>
Reports the success or failure of a Status transaction. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshResponse">
</t>
<t hangText="Inherits: MeshResponse"></t>
<t hangText="LastWriteTime: DateTime (Optional)">
Time that the last write update was made to the Mesh </t>
<t hangText="LastCheckpointTime: DateTime (Optional)">
Time that the last Mesh checkpoint was calculated. </t>
<t hangText="NextCheckpointTime: DateTime (Optional)">
Time at which the next Mesh checkpoint should be calculated. </t>
<t hangText="CheckpointValue: String (Optional)">
Last checkpoint value.  </t>
</list></t>
</section>
</section>
<section title="Transaction: ConnectStart" anchor="s-7_12">
<t><list style="hanging">
<t hangText="Request: ConnectStartRequest">
</t>
<t hangText="Request: ConnectStartRequest"></t>
<t hangText="Response: ConnectStartResponse"></t>
</list></t>
<t>
Request connection of a new device to a mesh profile </t>
<section title="Message: ConnectStartRequest" anchor="s-7_12_1">
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
Initial device connection request. </t>
<t><list style="hanging">
<t hangText="SignedRequest: SignedConnectionRequest (Optional)">
Device connection request signed by thesignature key of the  device requesting connection. </t>
<t hangText="AccountID: String (Optional)">
Account identifier of account to which the device is requesting connection.  </t>
</list></t>
</section>
<section title="Message: ConnectStartResponse" anchor="s-7_12_2">
<t>
Reports the success or failure of a ConnectStart transaction. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
[No fields] </t>
</section>
</section>
<section title="Transaction: ConnectStatus" anchor="s-7_13">
<t><list style="hanging">
<t hangText="Request: ConnectStatusRequest">
</t>
<t hangText="Request: ConnectStatusRequest"></t>
<t hangText="Response: ConnectStatusResponse"></t>
</list></t>
<t>
Request status of pending connection request of a new device  to a mesh profile </t>
<section title="Message: ConnectStatusRequest" anchor="s-7_13_1">
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
Request status information for a pending request posted previously. </t>
<t><list style="hanging">
<t hangText="AccountID: String (Optional)">
Account identifier for which pending connection information is requested. </t>
<t hangText="DeviceID: String (Optional)">
Device identifier of device requesting status information.  </t>
</list></t>
</section>
<section title="Message: ConnectStatusResponse" anchor="s-7_13_2">
<t>
Reports the success or failure of a ConnectStatus transaction. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="Result: SignedConnectionResult (Optional)">
The signed ConnectionResult object.  </t>
</list></t>
</section>
</section>
<section title="Transaction: ConnectPending" anchor="s-7_14">
<t><list style="hanging">
<t hangText="Request: ConnectPendingRequest">
</t>
<t hangText="Request: ConnectPendingRequest"></t>
<t hangText="Response: ConnectPendingResponse"></t>
</list></t>
<t>
Request a list of pending requests for an administration profile. </t>
<section title="Message: ConnectPendingRequest" anchor="s-7_14_1">
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
Specify the criteria for pending requests. </t>
<t><list style="hanging">
<t hangText="AccountID: String (Optional)">
The account identifier of the account for which pending connection requests are requested. </t>
<t hangText="SearchConstraints: SearchConstraints (Optional)">
Constrain the search to a specific time interval and/or  limit the number and/or total size of data records returned.  </t>
</list></t>
</section>
<section title="Message: ConnectPendingResponse" anchor="s-7_14_2">
<t>
Reports the success or failure of a ConnectPending transaction. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="Pending: SignedConnectionRequest [0..Many]">
A list of pending requests satisfying the criteria set out in the request. </t>
<t hangText="PageKey: String (Optional)">
If non-null, indicates that the number and/or size of the data records returned exceeds either the SearchConstraints specified in the request or internal server limits.  </t>
</list></t>
</section>
</section>
<section title="Transaction: ConnectComplete" anchor="s-7_15">
<t><list style="hanging">
<t hangText="Request: ConnectCompleteRequest">
</t>
<t hangText="Request: ConnectCompleteRequest"></t>
<t hangText="Response: ConnectCompleteResponse"></t>
</list></t>
<t>
Post response to a pending connection request. </t>
<section title="Message: ConnectCompleteRequest" anchor="s-7_15_1">
<t>
Reports the success or failure of a ConnectComplete transaction. </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="Result: SignedConnectionResult (Optional)">
The connection result to be posted to the portal. The result MUST be signed by a valid administration key for the Mesh profile. </t>
<t hangText="AccountID: String (Optional)">
The account identifier to which the connection result is posted.  </t>
</list></t>
</section>
<section title="Message: ConnectCompleteResponse" anchor="s-7_15_2">
<t><list style="hanging">
<t hangText="Inherits: MeshRequest"></t>
</list></t>
<t>
Reports the success or failure of a ConnectComplete transaction. </t>
<t>
[No fields] </t>
</section>
</section>
<section title="Transaction: Transfer" anchor="s-7_16">
<t><list style="hanging">
<t hangText="Request: TransferRequest">
</t>
<t hangText="Request: TransferRequest"></t>
<t hangText="Response: TransferResponse"></t>
</list></t>
<t>
Perform a bulk transfer of the log between the specified transaction identifiers. Requires appropriate authorization </t>
<t>
[Not currently implemented] </t>
<section title="Message: TransferRequest" anchor="s-7_16_1">
<t>
Request a bulk transfer of the log between the specified transaction identifiers. Requires appropriate authorization </t>
<t><list style="hanging">
<t hangText="Inherits: MeshRequest">
</t>
<t hangText="Inherits: MeshRequest"></t>
<t hangText="SearchConstraints: SearchConstraints (Optional)">
Constrain the search to a specific time interval and/or  limit the number and/or total size of data records returned.  </t>
</list></t>
</section>
<section title="Message: TransferResponse" anchor="s-7_16_2">
<t><list style="hanging">
<t hangText="Inherits: MeshResponse"></t>
</list></t>
<t>
Reports the success or failure of a Transfer transaction. If successful, contains the list of Mesh records to be transferred. </t>
<t><list style="hanging">
<t hangText="DataItems: DataItem [0..Many]">
List of mesh data records matching the request. </t>
<t hangText="PageKey: String (Optional)">
If non-null, indicates that the number and/or size of the data records returned exceeds either the SearchConstraints specified in the request or internal server limits.  </t>
</list></t>
</section>
</section>
</section>
<section title="Security Considerations" anchor="s-8">
</section>
<section title="IANA Considerations" anchor="s-9">
<t>
All the IANA considerations for the Mesh documents are specified in this document</t>
</section>
<section title="Acknowledgements" anchor="s-10">
<t>
</t>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="RFC2119">
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author fullname="S. Bradner" initials="S." surname="Bradner">
<organization/>
<address>
</address>
</author>
<date month="March" year="1997"/>
</front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
<seriesInfo name="DOI" value="10.17487/RFC2119"/>
</reference>
<reference anchor="RFC6335">
<front>
<title>Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry</title>
<author fullname="M. Cotton" initials="M." surname="Cotton">
<organization/>
<address>
</address>
</author>
<author fullname="L. Eggert" initials="L." surname="Eggert">
<organization/>
<address>
</address>
</author>
<author fullname="J. Touch" initials="J." surname="Touch">
<organization/>
<address>
</address>
</author>
<author fullname="M. Westerlund" initials="M." surname="Westerlund">
<organization/>
<address>
</address>
</author>
<author fullname="S. Cheshire" initials="S." surname="Cheshire">
<organization/>
<address>
</address>
</author>
<date month="August" year="2011"/>
</front>
<seriesInfo name="BCP" value="165"/>
<seriesInfo name="RFC" value="6335"/>
<seriesInfo name="DOI" value="10.17487/RFC6335"/>
</reference>
</references>
<references title="Informative References">
<reference anchor="RFC822">
<front>
<title>STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES</title>
<author fullname="D. Crocker" initials="D." surname="Crocker">
<organization/>
<address>
</address>
</author>
<date month="August" year="1982"/>
</front>
<seriesInfo name="STD" value="11"/>
<seriesInfo name="RFC" value="822"/>
<seriesInfo name="DOI" value="10.17487/RFC0822"/>
</reference>
<reference anchor="draft-hallambaker-mesh-architecture">
<front>
<title>Mathematical Mesh: Architecture</title>
<author fullname="Phillip Hallam-Baker" initials="P" surname="Hallam-Baker">
<organization/>
<address>
</address>
</author>
<date day="18" month="September" year="2017"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-hallambaker-mesh-architecture-04"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-hallambaker-mesh-architecture-04.txt"/>
</reference>
<reference anchor="draft-hallambaker-mesh-developer">
<front>
<title>Mathematical Mesh: Reference Implementation</title>
<author fullname="Phillip Hallam-Baker" initials="P" surname="Hallam-Baker">
<organization/>
<address>
</address>
</author>
<date day="18" month="September" year="2017"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-hallambaker-mesh-developer-05"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-hallambaker-mesh-developer-05.txt"/>
</reference>
</references>
</back>
</rfc>
