| 1 |
package org.globus.gsi.util; |
| 2 |
|
| 3 |
/** |
| 4 |
* Common OID values. |
| 5 |
* |
| 6 |
* Adapted from BouncyCastle BCStyle class. |
| 7 |
* |
| 8 |
* Copyright (c) 2000 - 2012 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) |
| 9 |
* |
| 10 |
* Permission is hereby granted, free of charge, to any person |
| 11 |
* obtaining a copy of this software and associated documentation |
| 12 |
* files (the "Software"), to deal in the Software without |
| 13 |
* restriction, including without limitation the rights to use, copy, |
| 14 |
* modify, merge, publish, distribute, sublicense, and/or sell copies |
| 15 |
* of the Software, and to permit persons to whom the Software is |
| 16 |
* furnished to do so, subject to the following conditions: |
| 17 |
* |
| 18 |
* The above copyright notice and this permission notice shall be |
| 19 |
* included in all copies or substantial portions of the Software. |
| 20 |
* |
| 21 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 22 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 23 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 24 |
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 25 |
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 26 |
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 27 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 28 |
* SOFTWARE. |
| 29 |
*/ |
| 30 |
public enum Oid |
| 31 |
{ |
| 32 |
/** |
| 33 |
* country code - StringType(SIZE(2)) |
| 34 |
*/ |
| 35 |
C("2.5.4.6"), |
| 36 |
|
| 37 |
/** |
| 38 |
* organization - StringType(SIZE(1..64)) |
| 39 |
*/ |
| 40 |
O("2.5.4.10"), |
| 41 |
|
| 42 |
/** |
| 43 |
* organizational unit name - StringType(SIZE(1..64)) |
| 44 |
*/ |
| 45 |
OU("2.5.4.11"), |
| 46 |
|
| 47 |
/** |
| 48 |
* Title |
| 49 |
*/ |
| 50 |
T("2.5.4.12"), |
| 51 |
|
| 52 |
/** |
| 53 |
* common name - StringType(SIZE(1..64)) |
| 54 |
*/ |
| 55 |
CN("2.5.4.3"), |
| 56 |
|
| 57 |
/** |
| 58 |
* device serial number name - StringType(SIZE(1..64)) |
| 59 |
*/ |
| 60 |
SERIALNUMBER("2.5.4.5"), |
| 61 |
|
| 62 |
/** |
| 63 |
* locality name - StringType(SIZE(1..64)) |
| 64 |
*/ |
| 65 |
L("2.5.4.7"), |
| 66 |
|
| 67 |
/** |
| 68 |
* state, or province name - StringType(SIZE(1..64)) |
| 69 |
*/ |
| 70 |
ST("2.5.4.8"), |
| 71 |
|
| 72 |
/** |
| 73 |
* street - StringType(SIZE(1..64)) |
| 74 |
*/ |
| 75 |
STREET("2.5.4.9"), |
| 76 |
|
| 77 |
/** |
| 78 |
* Naming attributes of type X520name |
| 79 |
*/ |
| 80 |
SURNAME("2.5.4.4"), |
| 81 |
GIVENNAME("2.5.4.42"), |
| 82 |
INITIALS("2.5.4.43"), |
| 83 |
GENERATION("2.5.4.44"), |
| 84 |
UNIQUE_IDENTIFIER("2.5.4.45"), |
| 85 |
|
| 86 |
/** |
| 87 |
* businessCategory - DirectoryString(SIZE(1..128) |
| 88 |
*/ |
| 89 |
BUSINESS_CATEGORY("2.5.4.15"), |
| 90 |
|
| 91 |
/** |
| 92 |
* postalCode - DirectoryString(SIZE(1..40) |
| 93 |
*/ |
| 94 |
POSTAL_CODE("2.5.4.17"), |
| 95 |
|
| 96 |
/** |
| 97 |
* dnQualifier - DirectoryString(SIZE(1..64) |
| 98 |
*/ |
| 99 |
DN_QUALIFIER("2.5.4.46"), |
| 100 |
|
| 101 |
/** |
| 102 |
* RFC 3039 Pseudonym - DirectoryString(SIZE(1..64) |
| 103 |
*/ |
| 104 |
PSEUDONYM("2.5.4.65"), |
| 105 |
|
| 106 |
|
| 107 |
/** |
| 108 |
* RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z |
| 109 |
*/ |
| 110 |
DATE_OF_BIRTH("1.3.6.1.5.5.7.9.1"), |
| 111 |
|
| 112 |
/** |
| 113 |
* RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128) |
| 114 |
*/ |
| 115 |
PLACE_OF_BIRTH("1.3.6.1.5.5.7.9.2"), |
| 116 |
|
| 117 |
/** |
| 118 |
* RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f" |
| 119 |
*/ |
| 120 |
GENDER("1.3.6.1.5.5.7.9.3"), |
| 121 |
|
| 122 |
/** |
| 123 |
* RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 |
| 124 |
* codes only |
| 125 |
*/ |
| 126 |
COUNTRY_OF_CITIZENSHIP("1.3.6.1.5.5.7.9.4"), |
| 127 |
|
| 128 |
/** |
| 129 |
* RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 |
| 130 |
* codes only |
| 131 |
*/ |
| 132 |
COUNTRY_OF_RESIDENCE("1.3.6.1.5.5.7.9.5"), |
| 133 |
|
| 134 |
|
| 135 |
/** |
| 136 |
* ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64) |
| 137 |
*/ |
| 138 |
NAME_AT_BIRTH("1.3.36.8.3.14"), |
| 139 |
|
| 140 |
/** |
| 141 |
* RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF |
| 142 |
* DirectoryString(SIZE(1..30)) |
| 143 |
*/ |
| 144 |
POSTAL_ADDRESS("2.5.4.16"), |
| 145 |
|
| 146 |
/** |
| 147 |
* RFC 2256 dmdName |
| 148 |
*/ |
| 149 |
DMD_NAME("2.5.4.54"), |
| 150 |
|
| 151 |
/** |
| 152 |
* id-at-telephoneNumber |
| 153 |
*/ |
| 154 |
TELEPHONE_NUMBER("2.5.4.20"), |
| 155 |
|
| 156 |
/** |
| 157 |
* id-at-name |
| 158 |
*/ |
| 159 |
NAME("2.5.4.41"), |
| 160 |
|
| 161 |
/** |
| 162 |
* Email address (RSA PKCS#9 extension) - IA5String. |
| 163 |
* <p>Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here. |
| 164 |
*/ |
| 165 |
EmailAddress("1.2.840.113549.1.9.1"), |
| 166 |
|
| 167 |
/** |
| 168 |
* more from PKCS#9 |
| 169 |
*/ |
| 170 |
UnstructuredName("1.2.840.113549.1.9.2"), |
| 171 |
UnstructuredAddress("1.2.840.113549.1.9.8"), |
| 172 |
|
| 173 |
/* |
| 174 |
* others... |
| 175 |
*/ |
| 176 |
DC("0.9.2342.19200300.100.1.25"), |
| 177 |
|
| 178 |
/** |
| 179 |
* LDAP User id. |
| 180 |
*/ |
| 181 |
UID("0.9.2342.19200300.100.1.1"), |
| 182 |
|
| 183 |
IP("1.3.6.1.4.1.42.2.11.2.1"); |
| 184 |
|
| 185 |
public final String oid; |
| 186 |
|
| 187 |
private Oid(String value) |
| 188 |
{ |
| 189 |
this.oid = value; |
| 190 |
} |
| 191 |
|
| 192 |
@Override |
| 193 |
public String toString() |
| 194 |
{ |
| 195 |
return oid; |
| 196 |
} |
| 197 |
} |