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 Exportable extends SignatureSubpacket {
10: private static final byte[] booleanToByteArray(boolean value) {
11: byte[] data = new byte[1];
12:
13: if (value) {
14: data[0] = 1;
15: return data;
16: } else {
17: return data;
18: }
19: }
20:
21: public Exportable(boolean critical, byte[] data) {
22: super (SignatureSubpacketTags.EXPORTABLE, critical, data);
23: }
24:
25: public Exportable(boolean critical, boolean isExportable) {
26: super (SignatureSubpacketTags.EXPORTABLE, critical,
27: booleanToByteArray(isExportable));
28: }
29:
30: public boolean isExportable() {
31: return data[0] != 0;
32: }
33: }
|