libimcv: Moved REST API from imv_swid and imv_swima to libimcv
[strongswan.git] / src / libtpmtss / tpm_tss.h
index 4f4b9e2..f408d04 100644 (file)
@@ -120,6 +120,30 @@ struct tpm_tss_t {
                                  tpm_tss_quote_info_t **quote_info, chunk_t *quote_sig);
 
        /**
+        * Do a signature over a data hash using a TPM key handle (TPM 2.0 only)
+        *
+        * @param handle                object handle of TPM key to be used for signature
+        * @param hierarchy             hierarchy the TPM key object is attached to
+        * @param scheme                scheme to be used for signature
+        * @param data                  data to be hashed and signed
+        * @param pin                   PIN code or empty chunk
+        * @param signature             returns signature
+        * @return                              TRUE if signature succeeded
+        */
+       bool (*sign)(tpm_tss_t *this, uint32_t hierarchy, uint32_t handle,
+                                signature_scheme_t scheme, chunk_t data, chunk_t pin,
+                                chunk_t *signature);
+
+       /**
+        * Get random bytes from the TPM
+        *
+        * @param bytes                 number of random bytes requested
+        * @param buffer                buffer where the random bytes are written into
+        * @return                              TRUE if random bytes could be delivered
+        */
+       bool (*get_random)(tpm_tss_t *this, size_t bytes, uint8_t *buffer);
+
+       /**
         * Destroy a tpm_tss_t.
         */
        void (*destroy)(tpm_tss_t *this);