01: package org.bouncycastle.bcpg.sig;
02:
03: import org.bouncycastle.bcpg.SignatureSubpacket;
04: import org.bouncycastle.bcpg.SignatureSubpacketTags;
05:
06: /**
07: * Packet holding the key flag values.
08: */
09: public class KeyFlags extends SignatureSubpacket {
10: private static final byte[] intToByteArray(int v) {
11: byte[] data = new byte[1];
12:
13: data[0] = (byte) v;
14:
15: return data;
16: }
17:
18: public KeyFlags(boolean critical, byte[] data) {
19: super (SignatureSubpacketTags.KEY_FLAGS, critical, data);
20: }
21:
22: public KeyFlags(boolean critical, int flags) {
23: super (SignatureSubpacketTags.KEY_FLAGS, critical,
24: intToByteArray(flags));
25: }
26:
27: public int getFlags() {
28: return data[0] & 0xff;
29: }
30: }
|