274 lines
10 KiB
Java
274 lines
10 KiB
Java
|
|
/* ----------------------------------------------------------------------------
|
||
|
|
* 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.
|
||
|
|
* ----------------------------------------------------------------------------- */
|
||
|
|
|
||
|
|
package com.sequencelogic;
|
||
|
|
|
||
|
|
public class Keyring {
|
||
|
|
private transient long swigCPtr;
|
||
|
|
protected transient boolean swigCMemOwn;
|
||
|
|
|
||
|
|
protected Keyring(long cPtr, boolean cMemoryOwn) {
|
||
|
|
swigCMemOwn = cMemoryOwn;
|
||
|
|
swigCPtr = cPtr;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected static long getCPtr(Keyring obj) {
|
||
|
|
return (obj == null) ? 0 : obj.swigCPtr;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void finalize() {
|
||
|
|
delete();
|
||
|
|
}
|
||
|
|
|
||
|
|
public synchronized void delete() {
|
||
|
|
if (swigCPtr != 0) {
|
||
|
|
if (swigCMemOwn) {
|
||
|
|
swigCMemOwn = false;
|
||
|
|
eyeinterfaceJNI.delete_Keyring(swigCPtr);
|
||
|
|
}
|
||
|
|
swigCPtr = 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public Keyring(String name, String database, Key key) {
|
||
|
|
this(eyeinterfaceJNI.new_Keyring__SWIG_0(name, database, Key.getCPtr(key), key), true);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Keyring(String name, String database, String password) {
|
||
|
|
this(eyeinterfaceJNI.new_Keyring__SWIG_1(name, database, password), true);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Keyring(String name, String desc) {
|
||
|
|
this(eyeinterfaceJNI.new_Keyring__SWIG_2(name, desc), true);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Keyring(String filename) {
|
||
|
|
this(eyeinterfaceJNI.new_Keyring__SWIG_3(filename), true);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean IsLocked() {
|
||
|
|
return eyeinterfaceJNI.Keyring_IsLocked(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Keyring.RING_STATUS GetStatus() {
|
||
|
|
return Keyring.RING_STATUS.swigToEnum(eyeinterfaceJNI.Keyring_GetStatus(swigCPtr, this));
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean Lock(String password) {
|
||
|
|
return eyeinterfaceJNI.Keyring_Lock__SWIG_0(swigCPtr, this, password);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean Unlock(String password) {
|
||
|
|
return eyeinterfaceJNI.Keyring_Unlock__SWIG_0(swigCPtr, this, password);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean Lock(SWIGTYPE_p_unsigned_char key) {
|
||
|
|
return eyeinterfaceJNI.Keyring_Lock__SWIG_1(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(key));
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean Unlock(SWIGTYPE_p_unsigned_char key) {
|
||
|
|
return eyeinterfaceJNI.Keyring_Unlock__SWIG_1(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(key));
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean Save() {
|
||
|
|
return eyeinterfaceJNI.Keyring_Save(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean SaveAs(String filename) {
|
||
|
|
return eyeinterfaceJNI.Keyring_SaveAs(swigCPtr, this, filename);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean AddKey(Key key) {
|
||
|
|
return eyeinterfaceJNI.Keyring_AddKey__SWIG_0(swigCPtr, this, Key.getCPtr(key), key);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean AddKey(String name, String desc, long len, SWIGTYPE_p_unsigned_char key, Key.KEY_TYPE type) {
|
||
|
|
return eyeinterfaceJNI.Keyring_AddKey__SWIG_1(swigCPtr, this, name, desc, len, SWIGTYPE_p_unsigned_char.getCPtr(key), type.swigValue());
|
||
|
|
}
|
||
|
|
|
||
|
|
public Key GetKey(String keyname) {
|
||
|
|
long cPtr = eyeinterfaceJNI.Keyring_GetKey__SWIG_0(swigCPtr, this, keyname);
|
||
|
|
return (cPtr == 0) ? null : new Key(cPtr, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GetKey(String name, Key key) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetKey__SWIG_1(swigCPtr, this, name, Key.getCPtr(key), key);
|
||
|
|
}
|
||
|
|
|
||
|
|
public String GetPubKey(String keyname) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetPubKey(swigCPtr, this, keyname);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean RemoveKey(String keyname) {
|
||
|
|
return eyeinterfaceJNI.Keyring_RemoveKey(swigCPtr, this, keyname);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean UpdateKey(Key key) {
|
||
|
|
return eyeinterfaceJNI.Keyring_UpdateKey(swigCPtr, this, Key.getCPtr(key), key);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateRSAKey(String name, String desc) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateRSAKey__SWIG_0(swigCPtr, this, name, desc);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateAESKey(String name, String desc) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateAESKey(swigCPtr, this, name, desc);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateAESHMACKey(String name, String desc) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateAESHMACKey(swigCPtr, this, name, desc);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateECKey(String name, String desc) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateECKey__SWIG_0(swigCPtr, this, name, desc);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean ImportPubKeyFromCert(String filename) {
|
||
|
|
return eyeinterfaceJNI.Keyring_ImportPubKeyFromCert(swigCPtr, this, filename);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateRSAKey(String keyname, String desc, String seed) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateRSAKey__SWIG_1(swigCPtr, this, keyname, desc, seed);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean ProvisionChallengeRSAKey(String keyname, String challenges, SWIGTYPE_p_std__string salt) {
|
||
|
|
return eyeinterfaceJNI.Keyring_ProvisionChallengeRSAKey(swigCPtr, this, keyname, challenges, SWIGTYPE_p_std__string.getCPtr(salt));
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean ProvisionAccountRSAKey(String keyname, SWIGTYPE_p_std__string code, SWIGTYPE_p_std__string salt, String challenges) {
|
||
|
|
return eyeinterfaceJNI.Keyring_ProvisionAccountRSAKey(swigCPtr, this, keyname, SWIGTYPE_p_std__string.getCPtr(code), SWIGTYPE_p_std__string.getCPtr(salt), challenges);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateRSAKey(String name, String desc, String challenges, String secret, SWIGTYPE_p_std__string salt) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateRSAKey__SWIG_2(swigCPtr, this, name, desc, challenges, secret, SWIGTYPE_p_std__string.getCPtr(salt));
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateECKey(String name, String desc, String challenges) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateECKey__SWIG_1(swigCPtr, this, name, desc, challenges);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateECKey(String name, String desc, String challenges, String secret, SWIGTYPE_p_std__string salt) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateECKey__SWIG_2(swigCPtr, this, name, desc, challenges, secret, SWIGTYPE_p_std__string.getCPtr(salt));
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean GenerateRSAKeys(String van, SWIGTYPE_p_std__vectorT_std__string_t emailist) {
|
||
|
|
return eyeinterfaceJNI.Keyring_GenerateRSAKeys(swigCPtr, this, van, SWIGTYPE_p_std__vectorT_std__string_t.getCPtr(emailist));
|
||
|
|
}
|
||
|
|
|
||
|
|
public SWIGTYPE_p_unsigned_char Encrypt(String keyname, SWIGTYPE_p_unsigned_char plaintext, long inlen, SWIGTYPE_p_size_t outlen, SWIGTYPE_p_unsigned_char iv) {
|
||
|
|
long cPtr = eyeinterfaceJNI.Keyring_Encrypt__SWIG_0(swigCPtr, this, keyname, SWIGTYPE_p_unsigned_char.getCPtr(plaintext), inlen, SWIGTYPE_p_size_t.getCPtr(outlen), SWIGTYPE_p_unsigned_char.getCPtr(iv));
|
||
|
|
return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public SWIGTYPE_p_unsigned_char Encrypt(String keyname, SWIGTYPE_p_unsigned_char plaintext, long inlen, SWIGTYPE_p_size_t outlen) {
|
||
|
|
long cPtr = eyeinterfaceJNI.Keyring_Encrypt__SWIG_1(swigCPtr, this, keyname, SWIGTYPE_p_unsigned_char.getCPtr(plaintext), inlen, SWIGTYPE_p_size_t.getCPtr(outlen));
|
||
|
|
return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public SWIGTYPE_p_unsigned_char Decrypt(String keyname, SWIGTYPE_p_unsigned_char ciphertext, long inlen, SWIGTYPE_p_size_t outlen, SWIGTYPE_p_unsigned_char iv) {
|
||
|
|
long cPtr = eyeinterfaceJNI.Keyring_Decrypt__SWIG_0(swigCPtr, this, keyname, SWIGTYPE_p_unsigned_char.getCPtr(ciphertext), inlen, SWIGTYPE_p_size_t.getCPtr(outlen), SWIGTYPE_p_unsigned_char.getCPtr(iv));
|
||
|
|
return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public SWIGTYPE_p_unsigned_char Decrypt(String keyname, SWIGTYPE_p_unsigned_char ciphertext, long inlen, SWIGTYPE_p_size_t outlen) {
|
||
|
|
long cPtr = eyeinterfaceJNI.Keyring_Decrypt__SWIG_1(swigCPtr, this, keyname, SWIGTYPE_p_unsigned_char.getCPtr(ciphertext), inlen, SWIGTYPE_p_size_t.getCPtr(outlen));
|
||
|
|
return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean AddKeyring(Keyring keyring) {
|
||
|
|
return eyeinterfaceJNI.Keyring_AddKeyring(swigCPtr, this, Keyring.getCPtr(keyring), keyring);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean RemoveKeyring(String ringname) {
|
||
|
|
return eyeinterfaceJNI.Keyring_RemoveKeyring(swigCPtr, this, ringname);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Keyring GetKeyring(String ringname) {
|
||
|
|
long cPtr = eyeinterfaceJNI.Keyring_GetKeyring(swigCPtr, this, ringname);
|
||
|
|
return (cPtr == 0) ? null : new Keyring(cPtr, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean LoadFromJSON(String json) {
|
||
|
|
return eyeinterfaceJNI.Keyring_LoadFromJSON(swigCPtr, this, json);
|
||
|
|
}
|
||
|
|
|
||
|
|
public String GetKeyNames() {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetKeyNames(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public String Stringify(Key key) {
|
||
|
|
return eyeinterfaceJNI.Keyring_Stringify(swigCPtr, this, Key.getCPtr(key), key);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Dump() {
|
||
|
|
eyeinterfaceJNI.Keyring_Dump(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public String GetName() {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetName(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public String GetDescription() {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetDescription(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public long GetNumKeys() {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetNumKeys(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public long GetNumRings() {
|
||
|
|
return eyeinterfaceJNI.Keyring_GetNumRings(swigCPtr, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public final static class RING_STATUS {
|
||
|
|
public final static Keyring.RING_STATUS VALID = new Keyring.RING_STATUS("VALID");
|
||
|
|
public final static Keyring.RING_STATUS INVALID = new Keyring.RING_STATUS("INVALID");
|
||
|
|
public final static Keyring.RING_STATUS CORRUPT = new Keyring.RING_STATUS("CORRUPT");
|
||
|
|
|
||
|
|
public final int swigValue() {
|
||
|
|
return swigValue;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String toString() {
|
||
|
|
return swigName;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static RING_STATUS swigToEnum(int swigValue) {
|
||
|
|
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
|
||
|
|
return swigValues[swigValue];
|
||
|
|
for (int i = 0; i < swigValues.length; i++)
|
||
|
|
if (swigValues[i].swigValue == swigValue)
|
||
|
|
return swigValues[i];
|
||
|
|
throw new IllegalArgumentException("No enum " + RING_STATUS.class + " with value " + swigValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
private RING_STATUS(String swigName) {
|
||
|
|
this.swigName = swigName;
|
||
|
|
this.swigValue = swigNext++;
|
||
|
|
}
|
||
|
|
|
||
|
|
private RING_STATUS(String swigName, int swigValue) {
|
||
|
|
this.swigName = swigName;
|
||
|
|
this.swigValue = swigValue;
|
||
|
|
swigNext = swigValue+1;
|
||
|
|
}
|
||
|
|
|
||
|
|
private RING_STATUS(String swigName, RING_STATUS swigEnum) {
|
||
|
|
this.swigName = swigName;
|
||
|
|
this.swigValue = swigEnum.swigValue;
|
||
|
|
swigNext = this.swigValue+1;
|
||
|
|
}
|
||
|
|
|
||
|
|
private static RING_STATUS[] swigValues = { VALID, INVALID, CORRUPT };
|
||
|
|
private static int swigNext = 0;
|
||
|
|
private final int swigValue;
|
||
|
|
private final String swigName;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|