aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/thialfihar/android/apg/KeyServer.java
blob: c6782632e2e7717ab249d872c21d117b1c3c61e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package org.thialfihar.android.apg;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Vector;

public abstract class KeyServer {
    static public class QueryException extends Exception {
        private static final long serialVersionUID = 2703768928624654512L;
        public QueryException(String message) {
            super(message);
        }
    }
    
    static public class TooManyResponses extends Exception {
        private static final long serialVersionUID = 2703768928624654513L;
    }
    
    static public class InsufficientQuery extends Exception {
        private static final long serialVersionUID = 2703768928624654514L;
    }
    
    static public class AddKeyException extends Exception {
        private static final long serialVersionUID = -507574859137295530L;
    }
    
    static public class KeyInfo implements Serializable {
        private static final long serialVersionUID = -7797972113284992662L;
        Vector<String> userIds;
        String revoked;
        Date date;
        String fingerPrint;
        long keyId;
        int size;
        String algorithm;
    }
    
    abstract List<KeyInfo> search(String query) throws QueryException, TooManyResponses, InsufficientQuery;
    abstract String get(long keyId) throws QueryException;
    abstract void add(String armouredText) throws AddKeyException;
}