01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Vladimir N. Molotkov
20: * @version $Revision$
21: */package org.apache.harmony.security.asn1;
22:
23: /**
24: * ASN.1 and some other constants holder interface
25: *
26: * @see http://asn1.elibel.tm.fr/en/standards/index.htm
27: */
28: public interface ASN1Constants {
29: /**
30: * Tag classes
31: */
32: int CLASS_UNIVERSAL = 0;
33: int CLASS_APPLICATION = 64;
34: int CLASS_CONTEXTSPECIFIC = 128;
35: int CLASS_PRIVATE = 192;
36:
37: /**
38: * Tag Primitive/Constructed (P/C) flag
39: */
40: int PC_PRIMITIVE = 0;
41: int PC_CONSTRUCTED = 32;
42:
43: /**
44: * Universal class tag assignments
45: */
46: int TAG_BOOLEAN = 1;
47: int TAG_INTEGER = 2;
48: int TAG_BITSTRING = 3;
49: int TAG_OCTETSTRING = 4;
50: int TAG_NULL = 5;
51: int TAG_OID = 6;
52: int TAG_OBJDESCRIPTOR = 7;
53: int TAG_EXTERNAL = 8;
54: int TAG_INSTANCEOF = TAG_EXTERNAL;
55: int TAG_REAL = 9;
56: int TAG_ENUM = 10;
57: int TAG_EMBEDDEDPDV = 11;
58: int TAG_UTF8STRING = 12;
59: int TAG_RELATIVEOID = 13;
60: int TAG_SEQUENCE = 16;
61: int TAG_SEQUENCEOF = TAG_SEQUENCE;
62: int TAG_SET = 17;
63: int TAG_SETOF = TAG_SET;
64: int TAG_NUMERICSTRING = 18;
65: int TAG_PRINTABLESTRING = 19;
66: int TAG_TELETEXSTRING = 20;
67: int TAG_T61STRING = TAG_TELETEXSTRING;
68: int TAG_VIDEOTEXSTRING = 21;
69: int TAG_IA5STRING = 22;
70: int TAG_UTCTIME = 23;
71: int TAG_GENERALIZEDTIME = 24;
72: int TAG_GRAPHICSTRING = 25;
73: int TAG_VISIBLESTRING = 26;
74: int TAG_ISO646STRING = TAG_VISIBLESTRING;
75: int TAG_GENERALSTRING = 27;
76: int TAG_UNIVERSALSTRING = 28;
77: int TAG_BMPSTRING = 30;
78:
79: int TAG_C_BITSTRING = TAG_BITSTRING | PC_CONSTRUCTED;
80: int TAG_C_OCTETSTRING = TAG_OCTETSTRING | PC_CONSTRUCTED;
81: int TAG_C_UTF8STRING = TAG_UTF8STRING | PC_CONSTRUCTED;
82: int TAG_C_SEQUENCE = TAG_SEQUENCE | PC_CONSTRUCTED;
83: int TAG_C_SEQUENCEOF = TAG_SEQUENCEOF | PC_CONSTRUCTED;
84: int TAG_C_SET = TAG_SET | PC_CONSTRUCTED;
85: int TAG_C_SETOF = TAG_SETOF | PC_CONSTRUCTED;
86: int TAG_C_UTCTIME = TAG_UTCTIME | PC_CONSTRUCTED;
87: int TAG_C_GENERALIZEDTIME = TAG_GENERALIZEDTIME | PC_CONSTRUCTED;
88:
89: /**
90: * Not from the ASN.1 specs. For implementation purposes.
91: */
92: int TAG_ANY = 0;
93: int TAG_CHOICE = TAG_ANY;
94: }
|