Moved data structures to new collections subfolder
[strongswan.git] / src / libstrongswan / credentials / keys / shared_key.h
index 86586a7..900c661 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef SHARED_KEY_H_
 #define SHARED_KEY_H_
 
 #ifndef SHARED_KEY_H_
 #define SHARED_KEY_H_
 
-#include <utils/enumerator.h>
+#include <collections/enumerator.h>
 #include <utils/identification.h>
 
 typedef struct shared_key_t shared_key_t;
 #include <utils/identification.h>
 
 typedef struct shared_key_t shared_key_t;
@@ -41,6 +41,8 @@ enum shared_key_type_t {
        SHARED_PRIVATE_KEY_PASS,
        /** PIN to unlock a smartcard */
        SHARED_PIN,
        SHARED_PRIVATE_KEY_PASS,
        /** PIN to unlock a smartcard */
        SHARED_PIN,
+       /** Calculated NT Hash = MD4(UTF-16LE(password)) */
+       SHARED_NT_HASH,
 };
 
 /**
 };
 
 /**
@@ -55,32 +57,41 @@ extern enum_name_t *shared_key_type_names;
  * reading.
  */
 struct shared_key_t {
  * reading.
  */
 struct shared_key_t {
-       
+
        /**
         * Get the kind of this key.
         *
         * @return                      type of the key
         */
        shared_key_type_t (*get_type)(shared_key_t *this);
        /**
         * Get the kind of this key.
         *
         * @return                      type of the key
         */
        shared_key_type_t (*get_type)(shared_key_t *this);
-       
+
        /**
         * Get the shared key data.
         *
         * @return                      chunk pointing to the internal key
         */
        chunk_t (*get_key)(shared_key_t *this);
        /**
         * Get the shared key data.
         *
         * @return                      chunk pointing to the internal key
         */
        chunk_t (*get_key)(shared_key_t *this);
-       
-       /** 
+
+       /**
         * Increase refcount of the key.
         *
         * Increase refcount of the key.
         *
-        * @return                      this with an increased refcount 
+        * @return                      this with an increased refcount
         */
        shared_key_t* (*get_ref)(shared_key_t *this);
         */
        shared_key_t* (*get_ref)(shared_key_t *this);
-               
+
        /**
        /**
-     * Destroy a shared_key instance if all references are gone.
-     */
-    void (*destroy)(shared_key_t *this);
+        * Destroy a shared_key instance if all references are gone.
+        */
+       void (*destroy)(shared_key_t *this);
 };
 
 };
 
+/**
+ * A simple private key implementation
+ *
+ * @param type         type of the shared key
+ * @param key          key data, gets owned by instance
+ * @return                     simple shared key instance
+ */
+shared_key_t *shared_key_create(shared_key_type_t type, chunk_t key);
+
 #endif /** SHARED_KEY_H_ @} */
 #endif /** SHARED_KEY_H_ @} */