
5 changed files with 200 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||
|
package org.pEp.jniadapter; |
||||
|
|
||||
|
public class Blob { |
||||
|
public byte[] data; |
||||
|
public String mime_type; |
||||
|
public String filename; |
||||
|
} |
||||
|
|
@ -0,0 +1,67 @@ |
|||||
|
package org.pEp.jniadapter; |
||||
|
|
||||
|
public enum CommType { |
||||
|
PEP_ct_unknown (0), |
||||
|
|
||||
|
// range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
|
||||
|
|
||||
|
PEP_ct_no_encryption (0x01), // generic
|
||||
|
PEP_ct_no_encrypted_channel (0x02), |
||||
|
PEP_ct_key_not_found (0x03), |
||||
|
PEP_ct_key_expired (0x04), |
||||
|
PEP_ct_key_revoked (0x05), |
||||
|
PEP_ct_key_b0rken (0x06), |
||||
|
PEP_ct_my_key_not_included (0x09), |
||||
|
|
||||
|
PEP_ct_security_by_obscurity (0x0a), |
||||
|
PEP_ct_b0rken_crypto (0x0b), |
||||
|
PEP_ct_key_too_short (0x0e), |
||||
|
|
||||
|
PEP_ct_compromized (0x0f), // known compromized connection
|
||||
|
|
||||
|
// range 0x10 to 0x3f: unconfirmed encryption
|
||||
|
|
||||
|
PEP_ct_unconfirmed_encryption (0x10), // generic
|
||||
|
PEP_ct_OpenPGP_weak_unconfirmed (0x11), // RSA 1024 is weak
|
||||
|
|
||||
|
PEP_ct_to_be_checked (0x20), // generic
|
||||
|
PEP_ct_SMIME_unconfirmed (0x21), |
||||
|
PEP_ct_CMS_unconfirmed (0x22), |
||||
|
|
||||
|
PEP_ct_strong_but_unconfirmed (0x30), // generic
|
||||
|
PEP_ct_OpenPGP_unconfirmed (0x38), // key at least 2048 bit RSA or EC
|
||||
|
PEP_ct_OTR_unconfirmed (0x3a), |
||||
|
|
||||
|
// range 0x40 to 0x7f: unconfirmed encryption and anonymization
|
||||
|
|
||||
|
PEP_ct_unconfirmed_enc_anon (0x40), // generic
|
||||
|
PEP_ct_PEP_unconfirmed (0x7f), |
||||
|
|
||||
|
PEP_ct_confirmed (0x80), // this bit decides if trust is confirmed
|
||||
|
|
||||
|
// range 0x81 to 0x8f: reserved
|
||||
|
// range 0x90 to 0xbf: confirmed encryption
|
||||
|
|
||||
|
PEP_ct_confirmed_encryption (0x90), // generic
|
||||
|
PEP_ct_OpenPGP_weak (0x91), // RSA 1024 is weak
|
||||
|
|
||||
|
PEP_ct_to_be_checked_confirmed (0xa0), //generic
|
||||
|
PEP_ct_SMIME (0xa1), |
||||
|
PEP_ct_CMS (0xa2), |
||||
|
|
||||
|
PEP_ct_strong_encryption (0xb0), // generic
|
||||
|
PEP_ct_OpenPGP (0xb8), // key at least 2048 bit RSA or EC
|
||||
|
PEP_ct_OTR (0xba), |
||||
|
|
||||
|
// range 0xc0 to 0xff: confirmed encryption and anonymization
|
||||
|
|
||||
|
PEP_ct_confirmed_enc_anon (0xc0), // generic
|
||||
|
PEP_ct_pEp (0xff); |
||||
|
|
||||
|
public final int value; |
||||
|
|
||||
|
CommType(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
package org.pEp.jniadapter; |
||||
|
|
||||
|
public class Identity { |
||||
|
public String address; |
||||
|
public String fpr; |
||||
|
public String user_id; |
||||
|
public String username; |
||||
|
CommType comm_type; |
||||
|
public String lang; |
||||
|
private boolean me; |
||||
|
|
||||
|
public Identity() { this.me = false; } |
||||
|
public Identity(boolean me) { this.me = me; } |
||||
|
} |
||||
|
|
@ -0,0 +1,103 @@ |
|||||
|
package org.pEp.jniadapter; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class MimeMessage { |
||||
|
public enum TextFormat { |
||||
|
plain (0), |
||||
|
html (1), |
||||
|
other (255); |
||||
|
|
||||
|
public final int value; |
||||
|
|
||||
|
TextFormat(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public enum Direction { |
||||
|
incoming (0), |
||||
|
outgoing (1); |
||||
|
|
||||
|
public final int value; |
||||
|
|
||||
|
Direction(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public enum EncFormat { |
||||
|
none (0), |
||||
|
pieces (1), |
||||
|
S_MIME (2), |
||||
|
PGP_MIME (3), |
||||
|
PEP (4); |
||||
|
|
||||
|
public final int value; |
||||
|
|
||||
|
EncFormat(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public native Direction dir(); |
||||
|
public native void dir(Direction value); |
||||
|
|
||||
|
public native String id(); |
||||
|
public native void id(String value); |
||||
|
|
||||
|
public native String shortmsg(); |
||||
|
public native void shortmsg(String value); |
||||
|
|
||||
|
public native String longmsg(); |
||||
|
public native void longmsg(String value); |
||||
|
|
||||
|
public native String longmsg_formatted(); |
||||
|
public native void longmsg_formatted(String value); |
||||
|
|
||||
|
public native Blob[] attachments(); |
||||
|
public native void attachments(Blob[] value); |
||||
|
|
||||
|
public native Date sent(); |
||||
|
public native void sent(Date value); |
||||
|
|
||||
|
public native Date recv(); |
||||
|
public native void recv(Date value); |
||||
|
|
||||
|
public native Identity from(); |
||||
|
public native void from(Identity value); |
||||
|
|
||||
|
public native Identity[] to(); |
||||
|
public native void to(Identity[] value); |
||||
|
|
||||
|
public native Identity recv_by(); |
||||
|
public native void recv_by(Identity value); |
||||
|
|
||||
|
public native Identity[] cc(); |
||||
|
public native void cc(Identity[] value); |
||||
|
|
||||
|
public native Identity[] bcc(); |
||||
|
public native void bcc(Identity[] value); |
||||
|
|
||||
|
public native Identity[] reply_to(); |
||||
|
public native void reply_to(Identity[] value); |
||||
|
|
||||
|
public native String[] in_reply_to(); |
||||
|
public native void in_reply_to(String[] value); |
||||
|
|
||||
|
public native String[] references(); |
||||
|
public native void references(String[] value); |
||||
|
|
||||
|
public native String[] keywords(); |
||||
|
public native void keywords(String[] value); |
||||
|
|
||||
|
public native String comments(); |
||||
|
public native void comments(String value); |
||||
|
|
||||
|
public native Pair<String, String>[] opt_fields(); |
||||
|
public native void opt_fields(Pair<String, String>[] value); |
||||
|
|
||||
|
public native EncFormat enc_format(); |
||||
|
public native void enc_format(EncFormat value); |
||||
|
} |
||||
|
|
@ -0,0 +1,7 @@ |
|||||
|
package org.pEp.jniadapter; |
||||
|
|
||||
|
public class Pair<F, S> { |
||||
|
private F first; |
||||
|
private S second; |
||||
|
} |
||||
|
|
Loading…
Reference in new issue