summaryrefslogtreecommitdiffstats
path: root/base/tps/src/org/dogtagpki/server/tps/processor/AppletInfo.java
blob: bc46eaba8a2dff3cff7341b33a3382b2fcfe3747 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package org.dogtagpki.server.tps.processor;

import org.dogtagpki.tps.main.TPSBuffer;


public class AppletInfo {

    private byte majorVersion;
    private byte minorVersion;
    private byte appMajorVersion;
    private byte appMinorVersion;

    private TPSBuffer aid;
    private TPSBuffer cuid;
    private TPSBuffer msn;
    private int totalMem;
    private int freeMem;

    public AppletInfo(byte appletMajorVer,byte appletMinorVer,byte appMajorVer,byte appMinorVer) {

        majorVersion = appletMajorVer;
        minorVersion = appletMinorVer;
        appMajorVersion = appMajorVer;
        appMinorVersion = appMinorVer;

    }

    public void setCUID(TPSBuffer theCuid) {
        cuid = new TPSBuffer(theCuid);
    }

    public TPSBuffer getCUID() {
        return cuid;
    }

    public void setMSN(TPSBuffer theMsn) {
        msn = new TPSBuffer(theMsn);
    }

    public TPSBuffer getMSN() {
        return msn;
    }

    public String getCUIDhexString(){
        if(cuid != null) {
            return cuid.toHexString();
        }

        return null;
    }

    /*
     * getCUIDhexString2 returns hex string without the '%'
     */
    public String getCUIDhexStringPlain() {
        if(cuid != null) {
            return cuid.toHexStringPlain();
        }

        return null;
    }

    public String getMSNString() {
        if(msn != null) {
            return msn.toHexString();
        }
        return null;
    }

    public byte getMajorVersion() {
        return majorVersion;
    }

    public byte getMinorVersion() {
        return minorVersion;
    }

    public byte getAppMinorVersion() {
        return appMinorVersion;
    }

    public byte getAppMajorVersion() {
        return appMajorVersion;
    }

    public static void main(String[] args) {

    }

    public void setTotalMem(int total_mem) {
        totalMem = total_mem;

    }

    public int getTotalMem() {
        return totalMem;
    }

    public void setFreeMem(int free_mem) {
        freeMem = free_mem;
    }

    public int getFreeMem() {
        return freeMem;
    }

    public TPSBuffer getAid() {
        return aid;
    }

    public void setAid(TPSBuffer aid) {
        this.aid = aid;
    }

}