01: package org.bouncycastle.bcpg.sig;
02:
03: import org.bouncycastle.bcpg.SignatureSubpacket;
04: import org.bouncycastle.bcpg.SignatureSubpacketTags;
05:
06: /**
07: * packet giving signature creation time.
08: */
09: public class TrustSignature extends SignatureSubpacket {
10: private static final byte[] intToByteArray(int v1, int v2) {
11: byte[] data = new byte[2];
12:
13: data[0] = (byte) v1;
14: data[1] = (byte) v2;
15:
16: return data;
17: }
18:
19: public TrustSignature(boolean critical, byte[] data) {
20: super (SignatureSubpacketTags.TRUST_SIG, critical, data);
21: }
22:
23: public TrustSignature(boolean critical, int depth, int trustAmount) {
24: super (SignatureSubpacketTags.TRUST_SIG, critical,
25: intToByteArray(depth, trustAmount));
26: }
27:
28: public int getDepth() {
29: return data[0] & 0xff;
30: }
31:
32: public int getTrustAmount() {
33: return data[1] & 0xff;
34: }
35: }
|