public static bool auth(Shared shared, Users authorizedUsers, PicoBuffer returnedStoredData, QrCallback qrCallback, object data, PicoBuffer localSymmetricKey) { IntPtr sharedPtr = IntPtr.Zero; if (shared != null) { sharedPtr = shared.getIntPtr(); } IntPtr usersPtr = IntPtr.Zero; if (authorizedUsers != null) { usersPtr = authorizedUsers.getIntPtr(); } IntPtr storedDataPtr = IntPtr.Zero; if (returnedStoredData != null) { storedDataPtr = returnedStoredData.getIntPtr(); } IntPtr localSymmetricKeyPtr = IntPtr.Zero; if (localSymmetricKey != null) { localSymmetricKeyPtr = localSymmetricKey.getIntPtr(); } PicoDLL.QrCallbackFunctionInternal internalDelegate = delegate(string qrData, IntPtr intPtr) { return(qrCallback(qrData, ((GCHandle)intPtr).Target)); }; return(PicoDLL.auth(sharedPtr, usersPtr, storedDataPtr, internalDelegate, (IntPtr)GCHandle.Alloc(data), localSymmetricKeyPtr)); }
public void set(PicoBuffer serviceAddress, string terminalAddress, PicoBuffer terminalCommitment, KeyPair serviceIdentityKey) { IntPtr terminalCommitmentPtr = IntPtr.Zero; if (terminalCommitment != null) { terminalCommitmentPtr = terminalCommitment.getIntPtr(); } PicoDLL.keyauth_set(handle, serviceAddress.getIntPtr(), terminalAddress, terminalCommitmentPtr, serviceIdentityKey.getIntPtr()); }
public static bool pair(Shared shared, string serviceName, string extraData, PicoBuffer returnedStoredData, QrCallback qrCallback, object data) { IntPtr sharedPtr = IntPtr.Zero; if (shared != null) { sharedPtr = shared.getIntPtr(); } IntPtr storedDataPtr = IntPtr.Zero; if (returnedStoredData != null) { storedDataPtr = returnedStoredData.getIntPtr(); } PicoDLL.QrCallbackFunctionInternal internalDelegate = delegate(string qrData, IntPtr intPtr) { return(qrCallback(qrData, ((GCHandle)intPtr).Target)); }; return(PicoDLL.pair(sharedPtr, serviceName, extraData, storedDataPtr, internalDelegate, (IntPtr)GCHandle.Alloc(data))); }
public static bool generate_sha256(PicoBuffer bufferin, PicoBuffer bufferout) { return(PicoDLL.cryptosupport_generate_sha256(bufferin.getIntPtr(), bufferout.getIntPtr())); }
public void get_next_key(PicoBuffer keyBytes, int length) { PicoDLL.sigmakeyderiv_get_next_key(handle, keyBytes.getIntPtr(), length); }
public bool read(PicoBuffer buff) { return(PicoDLL.channel_read(handle, buff.getIntPtr())); }
public void get_url(PicoBuffer buff) { PicoDLL.channel_get_url(handle, buff.getIntPtr()); }
public void set_buffer(PicoBuffer buff) { PicoDLL.nonce_set_buffer(handle, buff.getIntPtr()); }
public void sign_data(PicoBuffer bufferin, PicoBuffer bufferout) { PicoDLL.keypair_sign_data(handle, bufferin.getIntPtr(), bufferout.getIntPtr()); }
public int append_lengthprepend(PicoBuffer buff) { return(PicoDLL.buffer_append_buffer_lengthprepend(handle, buff.getIntPtr())); }
public int copy_lengthprepend(int start, PicoBuffer bufferout) { return(PicoDLL.buffer_copy_lengthprepend(handle, start, bufferout.getIntPtr())); }
public static bool verify_signature(IntPtr publickey, PicoBuffer bufferin, PicoBuffer sigin) { return(PicoDLL.cryptosupport_verify_signature(publickey, bufferin.getIntPtr(), sigin.getIntPtr())); }
public static void generate_iv(PicoBuffer iv) { PicoDLL.cryptosupport_generate_iv(iv.getIntPtr()); }
public static bool generate_mac(PicoBuffer macKey, PicoBuffer data, PicoBuffer bufferout) { return(PicoDLL.cryptosupport_generate_mac(macKey.getIntPtr(), data.getIntPtr(), bufferout.getIntPtr())); }
public static void getpublicder(IntPtr eckey, PicoBuffer buffer) { PicoDLL.cryptosupport_getpublicder(eckey, buffer.getIntPtr()); }
public bool deserialize(PicoBuffer buff) { return(PicoDLL.json_deserialize_buffer(handle, buff.getIntPtr())); }
public int serialize(PicoBuffer buffer) { return(PicoDLL.json_serialize_buffer(handle, buffer.getIntPtr())); }
public void add(string key, PicoBuffer value) { PicoDLL.json_add_buffer(handle, key, value.getIntPtr()); }
public bool equals(PicoBuffer buff) { return(PicoDLL.buffer_equals(handle, buff.getIntPtr())); }
public static bool generate_commitment_base64(IntPtr publickey, PicoBuffer commitment) { return(PicoDLL.cryptosupport_generate_commitment_base64(publickey, commitment.getIntPtr())); }
public int add_user(string name, IntPtr key, PicoBuffer symmetric_key) { return(PicoDLL.users_add_user(handle, name, key, symmetric_key.getIntPtr())); }
public static IntPtr read_buffer_public_key(PicoBuffer keybuffer) { return(PicoDLL.cryptosupport_read_buffer_public_key(keybuffer.getIntPtr())); }
public void getpublicder(PicoBuffer buff) { PicoDLL.keypair_getpublicder(handle, buff.getIntPtr()); }
public static bool encrypt_iv_base64(PicoBuffer key, PicoBuffer bufferin, PicoBuffer encryptedout) { return(PicoDLL.cryptosupport_encrypt_iv_base64(key.getIntPtr(), bufferin.getIntPtr(), encryptedout.getIntPtr())); }
public static bool decrypt_iv_base64(PicoBuffer key, PicoBuffer bufferin, PicoBuffer cleartextout) { return(PicoDLL.cryptosupport_decrypt_iv_base64(key.getIntPtr(), bufferin.getIntPtr(), cleartextout.getIntPtr())); }
public static bool generate_symmetric_key(PicoBuffer key, int size) { return(PicoDLL.cryptosupport_generate_symmetric_key(key.getIntPtr(), size)); }
public bool write_buffer(PicoBuffer buff) { return(PicoDLL.channel_write_buffer(handle, buff.getIntPtr())); }
public static void generate_secret(IntPtr vEphemPriv, IntPtr pEphemPub, PicoBuffer sharedSecretOut) { PicoDLL.keyagreement_generate_secret(vEphemPriv, pEphemPub, sharedSecretOut.getIntPtr()); }
public static bool verify(Shared shared, Channel channel, Users authorizedUsers, string extraData, PicoBuffer returnedStoredData, PicoBuffer localSymmetricKey) { IntPtr usersPtr = IntPtr.Zero; if (authorizedUsers != null) { usersPtr = authorizedUsers.getIntPtr(); } IntPtr storedDataPtr = IntPtr.Zero; if (returnedStoredData != null) { storedDataPtr = returnedStoredData.getIntPtr(); } IntPtr localSymmetricKeyPtr = IntPtr.Zero; if (localSymmetricKey != null) { localSymmetricKeyPtr = localSymmetricKey.getIntPtr(); } return(PicoDLL.sigmaverifier(shared.getIntPtr(), channel.getIntPtr(), usersPtr, extraData, storedDataPtr, localSymmetricKeyPtr)); }
public void set(PicoBuffer sharedSecret, Nonce picoNonce, Nonce serviceNonce) { PicoDLL.sigmakeyderiv_set(handle, sharedSecret.getIntPtr(), picoNonce.getIntPtr(), serviceNonce.getIntPtr()); }