[tpmd] add interface docs

Change-Id: Id24a70bf1c9664866470a5e6e4e9a8b3c72168ef
Signed-off-by: Elly Jones <ellyjones@chromium.org>
diff --git a/share/org.chromium.tpmd.nvram.xml b/share/org.chromium.tpmd.nvram.xml
new file mode 100644
index 0000000..a4ce788
--- /dev/null
+++ b/share/org.chromium.tpmd.nvram.xml
@@ -0,0 +1,51 @@
+<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <interface name="org.chromium.tpmd.nvram">
+    <method name="Free">
+      <tp:docstring>
+        Frees this nvram region, destroying all data inside it.
+      </tp:docstring>
+    </method>
+    <method name="Write">
+      <tp:docstring>
+        Writes the supplied bytes to this nvram region. Fails if the region is
+        not writeable or too few or too many bytes are supplied.
+      </tp:docstring>
+      <arg name="bytes" type="ay" direction="in">
+        <tp:docstring>
+          Bytes to write.
+        </tp:docstring>
+      </arg>
+      <arg name="result" type="b" direction="out">
+      </arg>
+    </method>
+    <method name="Read">
+      <tp:docstring>
+        Reads bytes from this nvram region. Fails if the region is not allocated
+        or written.
+      </tp:docstring>
+      <arg name="bytes" type="ay" direction="out">
+        <tp:docstring>
+          The bytes read from this nvram region.
+        </tp:docstring>
+      </arg>
+      <arg name="result" type="b" direction="out">
+      </arg>
+    </method>
+    <property name="IsDefined" type="b">
+      <tp:docstring>
+        Has this nvram region been written?
+      </tp:docstring>
+    </property>
+    <property name="IsLocked" type="b">
+      <tp:docstring>
+        Has this nvram region been locked? (i.e., can it no longer be written?)
+      </tp:docstring>
+    </property>
+    <property name="Size" type="u">
+      <tp:docstring>
+        The size of this nvram region, in bytes.
+      </tp:docstring>
+    </property>
+  </interface>
+</node>
+
diff --git a/share/org.chromium.tpmd.xml b/share/org.chromium.tpmd.xml
new file mode 100644
index 0000000..3c84959
--- /dev/null
+++ b/share/org.chromium.tpmd.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <interface name="org.chromium.tpmd">
+    <method name="AllocateNvram">
+      <tp:docstring>
+        Allocates an nvram at the specified index of the specified size. If
+        there is an existing nvram at the specified index, fails.
+      </tp:docstring>
+      <arg name="index" type="u" direction="in">
+        <tp:docstring>
+          Index at which to allocate the nvram object on the TPM.
+        </tp:docstring>
+      </arg>
+      <arg name="size" type="u" direction="in">
+        <tp:docstring>
+          Length of the allocated nvram, in bytes.
+        </tp:docstring>
+      </arg>
+      <arg name="options" type="a{sv}" direction="in">
+        <tp:docstring>
+          Extra options for this NVRAM area. Supported keys: "LockOnce", with a
+          boolean value.
+        </tp:docstring>
+      </arg>
+      <arg name="path" type="o" direction="out">
+        <tp:docstring>
+          The path to a DBus object representing the newly-allocated nvram slot.
+        </tp:docstring>
+      </arg>
+    </method>
+    <method name="GetNvram">
+      <tp:docstring>
+        Returns the path of a DBus object representing an existing nvram slot on
+        the TPM.
+      </tp:docstring>
+      <arg name="index" type="u" direction="in">
+        <tp:docstring>
+          Index at which to allocate the nvram object on the TPM.
+        </tp:docstring>
+      </arg>
+      <arg name="path" type="o" direction="out">
+        <tp:docstring>
+          The path to a DBus object representing the newly-allocated nvram slot.
+        </tp:docstring>
+      </arg>
+    </method>
+    <method name="Encrypt">
+      <tp:docstring>
+        Encrypts a supplied plaintext with the tpmd sealing key, returning the
+        ciphertext.
+      </tp:docstring>
+      <arg name="plaintext" type="ay" direction="in">
+        <tp:docstring>
+          Plaintext to encrypt with the sealing key.
+        </tp:docstring>
+      </arg>
+      <arg name="ciphertext" type="ay" direction="out">
+        <tp:docstring>
+          Ciphertext encrypted with the sealing key.
+        </tp:docstring>
+      </arg>
+    </method>
+    <method name="Decrypt">
+      <tp:docstring>
+        Decrypts a supplied ciphertext with the tpmd sealing key, returning the
+        plaintext.
+      </tp:docstring>
+      <arg name="ciphertext" type="ay" direction="in">
+        <tp:docstring>
+          Ciphertext to decrypt with the sealing key.
+        </tp:docstring>
+      </arg>
+      <arg name="plaintext" type="ay" direction="out">
+        <tp:docstring>
+          Plaintext decrypted with the sealing key.
+        </tp:docstring>
+      </arg>
+    </method>
+    <method name="GetStatus">
+      <tp:docstring>
+        Returns the status of the TPM as a JSON string.
+      </tp:docstring>
+      <arg name="status" type="s" direction="out">
+        <tp:docstring>
+          TPM status.
+        </tp:docstring>
+      </arg>
+    </method>
+    <property name="IsReady" type="b">
+      <tp:docstring>
+        True if the TPM is ready for Encrypt, Decrypt, and NVRAM operations. It
+        is always safe to call GetStatus.
+      </tp:docstring>
+    </property>
+  </interface>
+</node>