#ifndef SECURITY_BUFFER_H #define SECURITY_BUFFER_H #include #include #include #define SECURITY_WIN32 1 #include #include #include #include using namespace v8; using namespace node; class SecurityBuffer : public Nan::ObjectWrap { public: SecurityBuffer(uint32_t security_type, size_t size); SecurityBuffer(uint32_t security_type, size_t size, void *data); ~SecurityBuffer(); // Internal values void *data; size_t size; uint32_t security_type; SecBuffer sec_buffer; // Has instance check static inline bool HasInstance(Local val) { if (!val->IsObject()) return false; Local obj = val->ToObject(); return Nan::New(constructor_template)->HasInstance(obj); }; // Functions available from V8 static void Initialize(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target); static NAN_METHOD(ToBuffer); // Constructor used for creating new Long objects from C++ static Nan::Persistent constructor_template; private: static NAN_METHOD(New); }; #endif