Skip to content

Instantly share code, notes, and snippets.

@OnlyInAmerica
Last active April 19, 2016 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OnlyInAmerica/0567ea1d73268159bfc1e83d86e2df66 to your computer and use it in GitHub Desktop.
Save OnlyInAmerica/0567ea1d73268159bfc1e83d86e2df66 to your computer and use it in GitHub Desktop.
Java Wrapping Matrix's Olm using SWIG
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
public class Account {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected Account(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(Account obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
OlmJni.delete_Account(swigCPtr);
}
swigCPtr = 0;
}
}
public Account() {
this(OlmJni.new_Account(), true);
}
public void setIdentity_keys(IdentityKeys value) {
OlmJni.Account_identity_keys_set(swigCPtr, this, IdentityKeys.getCPtr(value), value);
}
public IdentityKeys getIdentity_keys() {
long cPtr = OlmJni.Account_identity_keys_get(swigCPtr, this);
return (cPtr == 0) ? null : new IdentityKeys(cPtr, false);
}
public void setOne_time_keys(SWIGTYPE_p_olm__ListT_olm__OneTimeKey_100_t value) {
OlmJni.Account_one_time_keys_set(swigCPtr, this, SWIGTYPE_p_olm__ListT_olm__OneTimeKey_100_t.getCPtr(value));
}
public SWIGTYPE_p_olm__ListT_olm__OneTimeKey_100_t getOne_time_keys() {
long cPtr = OlmJni.Account_one_time_keys_get(swigCPtr, this);
return (cPtr == 0) ? null : new SWIGTYPE_p_olm__ListT_olm__OneTimeKey_100_t(cPtr, false);
}
public void setNext_one_time_key_id(long value) {
OlmJni.Account_next_one_time_key_id_set(swigCPtr, this, value);
}
public long getNext_one_time_key_id() {
return OlmJni.Account_next_one_time_key_id_get(swigCPtr, this);
}
public void setLast_error(ErrorCode value) {
OlmJni.Account_last_error_set(swigCPtr, this, value.swigValue());
}
public ErrorCode getLast_error() {
return ErrorCode.swigToEnum(OlmJni.Account_last_error_get(swigCPtr, this));
}
public long new_account_random_length() {
return OlmJni.Account_new_account_random_length(swigCPtr, this);
}
public long new_account(byte[] random, long random_length) {
return OlmJni.Account_new_account(swigCPtr, this, random, random_length);
}
public long get_identity_json_length() {
return OlmJni.Account_get_identity_json_length(swigCPtr, this);
}
public long get_identity_json(byte[] identity_json, long identity_json_length) {
return OlmJni.Account_get_identity_json(swigCPtr, this, identity_json, identity_json_length);
}
public long signature_length() {
return OlmJni.Account_signature_length(swigCPtr, this);
}
public long sign(byte[] message, long message_length, byte[] signature, long signature_length) {
return OlmJni.Account_sign(swigCPtr, this, message, message_length, signature, signature_length);
}
public long get_one_time_keys_json_length() {
return OlmJni.Account_get_one_time_keys_json_length(swigCPtr, this);
}
public long get_one_time_keys_json(byte[] one_time_json, long one_time_json_length) {
return OlmJni.Account_get_one_time_keys_json(swigCPtr, this, one_time_json, one_time_json_length);
}
public long mark_keys_as_published() {
return OlmJni.Account_mark_keys_as_published(swigCPtr, this);
}
public long max_number_of_one_time_keys() {
return OlmJni.Account_max_number_of_one_time_keys(swigCPtr, this);
}
public long generate_one_time_keys_random_length(long number_of_keys) {
return OlmJni.Account_generate_one_time_keys_random_length(swigCPtr, this, number_of_keys);
}
public long generate_one_time_keys(long number_of_keys, byte[] random, long random_length) {
return OlmJni.Account_generate_one_time_keys(swigCPtr, this, number_of_keys, random, random_length);
}
public OneTimeKey lookup_key(Curve25519PublicKey public_key) {
long cPtr = OlmJni.Account_lookup_key(swigCPtr, this, Curve25519PublicKey.getCPtr(public_key), public_key);
return (cPtr == 0) ? null : new OneTimeKey(cPtr, false);
}
public long remove_key(Curve25519PublicKey public_key) {
return OlmJni.Account_remove_key(swigCPtr, this, Curve25519PublicKey.getCPtr(public_key), public_key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment