01: package org.bouncycastle.bcpg.sig;
02:
03: import org.bouncycastle.bcpg.SignatureSubpacket;
04: import org.bouncycastle.bcpg.SignatureSubpacketTags;
05:
06: /**
07: * packet giving whether or not is revocable.
08: */
09: public class Revocable 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 Revocable(boolean critical, byte[] data) {
22: super (SignatureSubpacketTags.REVOCABLE, critical, data);
23: }
24:
25: public Revocable(boolean critical, boolean isRevocable) {
26: super (SignatureSubpacketTags.REVOCABLE, critical,
27: booleanToByteArray(isRevocable));
28: }
29:
30: public boolean isRevocable() {
31: return data[0] != 0;
32: }
33: }
|