001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2006-2008 Sun Microsystems, Inc. 025 * Portions copyright 2013-2014 ForgeRock AS. 026 */ 027package org.opends.server.extensions; 028 029 030 031/** 032 * This class defines a number of constants that may be used by Directory Server 033 * extensions. 034 */ 035public class ExtensionsConstants 036{ 037 /** 038 * The authentication password scheme name for use with passwords encoded in a 039 * salted MD5 representation. 040 */ 041 public static final String AUTH_PASSWORD_SCHEME_NAME_SALTED_MD5 = "MD5"; 042 043 044 045 /** 046 * The authentication password scheme name for use with passwords encoded in a 047 * salted SHA-1 representation. 048 */ 049 public static final String AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_1 = "SHA1"; 050 051 052 053 /** 054 * The authentication password scheme name for use with passwords encoded in a 055 * salted SHA-256 representation. 056 */ 057 public static final String AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_256 = 058 "SHA256"; 059 060 061 062 /** 063 * The authentication password scheme name for use with passwords encoded in a 064 * salted SHA-384 representation. 065 */ 066 public static final String AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_384 = 067 "SHA384"; 068 069 070 071 /** 072 * The authentication password scheme name for use with passwords encoded in a 073 * salted SHA-512 representation. 074 */ 075 public static final String AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_512 = 076 "SHA512"; 077 078 079 080 /** 081 * The authentication password scheme name for use with passwords encoded in a 082 * PBKDF2 representation. 083 */ 084 public static final String AUTH_PASSWORD_SCHEME_NAME_PBKDF2 = "PBKDF2"; 085 086 087 /** 088 * The authentication password scheme name for use with passwords encoded in a 089 * PKCS5S2 representation. 090 */ 091 public static final String AUTH_PASSWORD_SCHEME_NAME_PKCS5S2 = "PKCS5S2"; 092 093 094 /** 095 * The name of the message digest algorithm that should be used to generate 096 * MD5 hashes. 097 */ 098 public static final String MESSAGE_DIGEST_ALGORITHM_MD5 = "MD5"; 099 100 101 102 /** 103 * The name of the message digest algorithm that should be used to generate 104 * SHA-1 hashes. 105 */ 106 public static final String MESSAGE_DIGEST_ALGORITHM_SHA_1 = "SHA-1"; 107 108 109 110 /** 111 * The name of the message digest algorithm that should be used to generate 112 * 256-bit SHA-2 hashes. 113 */ 114 public static final String MESSAGE_DIGEST_ALGORITHM_SHA_256 = "SHA-256"; 115 116 117 118 /** 119 * The name of the message digest algorithm that should be used to generate 120 * 384-bit SHA-2 hashes. 121 */ 122 public static final String MESSAGE_DIGEST_ALGORITHM_SHA_384 = "SHA-384"; 123 124 125 126 /** 127 * The name of the message digest algorithm that should be used to generate 128 * 512-bit SHA-2 hashes. 129 */ 130 public static final String MESSAGE_DIGEST_ALGORITHM_SHA_512 = "SHA-512"; 131 132 133 134 /** 135 * The name of the message digest algorithm that should be used to generate 136 * PBKDF2 hashes. 137 */ 138 public static final String MESSAGE_DIGEST_ALGORITHM_PBKDF2 = 139 "PBKDF2WithHmacSHA1"; 140 141 142 143 /** 144 * The name of the pseudo-random number generator using SHA-1. 145 */ 146 public static final String SECURE_PRNG_SHA1 = "SHA1PRNG"; 147 148 149 150 /** 151 * The cipher transformation that should be used when performing 3DES 152 * encryption/decription. 153 */ 154 public static final String CIPHER_TRANSFORMATION_3DES = 155 "DESede/CFB/NoPadding"; 156 157 158 159 /** 160 * The cipher transformation that should be used when performing AES 161 * encryption/decription. 162 */ 163 public static final String CIPHER_TRANSFORMATION_AES = "AES/CFB/NoPadding"; 164 165 166 167 /** 168 * The cipher transformation that should be used when performing blowfish 169 * encryption/decription. 170 */ 171 public static final String CIPHER_TRANSFORMATION_BLOWFISH = 172 "Blowfish/CFB/NoPadding"; 173 174 175 176 /** 177 * The cipher transformation that should be used when performing RC4 178 * encryption/decription. 179 * 180 * TODO: https://opends.dev.java.net/issues/show_bug.cgi?id=2471 181 */ 182 public static final String CIPHER_TRANSFORMATION_RC4 = "RC4/NONE/NoPadding"; 183 184 185 186 /** 187 * The key size (in bits) that should be used for the encryption key when 188 * using the 3DES cipher. 189 */ 190 public static final int KEY_SIZE_3DES = 168; 191 192 193 194 /** 195 * The key size (in bits) that should be used for the encryption key when 196 * using the AES cipher. 197 * TODO: https://opends.dev.java.net/issues/show_bug.cgi?id=2475 198 */ 199 public static final int KEY_SIZE_AES = 128; 200 201 202 203 /** 204 * The key size (in bits) that should be used for the encryption key when 205 * using the Blowfish cipher. 206 * TODO: https://opends.dev.java.net/issues/show_bug.cgi?id=2475 207 */ 208 public static final int KEY_SIZE_BLOWFISH = 128; 209 210 211 212 /** 213 * The key size (in bits) that should be used for the encryption key when 214 * using the RC4 cipher. 215 * TODO: https://opends.dev.java.net/issues/show_bug.cgi?id=2475 216 */ 217 public static final int KEY_SIZE_RC4 = 128; 218 219 220 221 /** 222 * The password storage scheme name that will be used for passwords that are 223 * stored in 3DES-encrypted form. 224 */ 225 public static final String STORAGE_SCHEME_NAME_3DES = "3DES"; 226 227 228 229 /** 230 * The password storage scheme name that will be used for passwords that are 231 * stored in AES-encrypted form. 232 */ 233 public static final String STORAGE_SCHEME_NAME_AES = "AES"; 234 235 236 237 /** 238 * The password storage scheme name that will be used for passwords that are 239 * stored in base64-encoded form (virtually no protection, but the value is 240 * reversible). 241 */ 242 public static final String STORAGE_SCHEME_NAME_BASE64 = "BASE64"; 243 244 245 246 /** 247 * The password storage scheme name that will be used for passwords that are 248 * stored in Blowfish-encrypted form. 249 */ 250 public static final String STORAGE_SCHEME_NAME_BLOWFISH = "BLOWFISH"; 251 252 253 254 /** 255 * The password storage scheme name that will be used for passwords that are 256 * not encoded or obscured in any way. 257 */ 258 public static final String STORAGE_SCHEME_NAME_CLEAR = "CLEAR"; 259 260 261 262 /** 263 * The password storage scheme name that will be used for passwords stored in 264 * an MD5 representation. 265 */ 266 public static final String STORAGE_SCHEME_NAME_MD5 = "MD5"; 267 268 269 270 /** 271 * The password storage scheme name that will be used for passwords that are 272 * stored in RC4-encrypted form. 273 */ 274 public static final String STORAGE_SCHEME_NAME_RC4 = "RC4"; 275 276 277 278 /** 279 * The password storage scheme name that will be used for passwords stored in 280 * a salted MD5 representation. 281 */ 282 public static final String STORAGE_SCHEME_NAME_SALTED_MD5 = "SMD5"; 283 284 285 286 /** 287 * The password storage scheme name that will be used for passwords stored in 288 * a SHA-1 representation. 289 */ 290 public static final String STORAGE_SCHEME_NAME_SHA_1 = "SHA"; 291 292 293 294 /** 295 * The password storage scheme name that will be used for passwords stored in 296 * a salted SHA-1 representation. 297 */ 298 public static final String STORAGE_SCHEME_NAME_SALTED_SHA_1 = "SSHA"; 299 300 301 302 /** 303 * The password storage scheme name that will be used for passwords stored in 304 * a salted SHA-256 representation. 305 */ 306 public static final String STORAGE_SCHEME_NAME_SALTED_SHA_256 = "SSHA256"; 307 308 309 310 /** 311 * The password storage scheme name that will be used for passwords stored in 312 * a salted SHA-384 representation. 313 */ 314 public static final String STORAGE_SCHEME_NAME_SALTED_SHA_384 = "SSHA384"; 315 316 317 318 /** 319 * The password storage scheme name that will be used for passwords stored in 320 * a salted SHA-512 representation. 321 */ 322 public static final String STORAGE_SCHEME_NAME_SALTED_SHA_512 = "SSHA512"; 323 324 325 326 /** 327 * The password storage scheme name that will be used for passwords stored in 328 * a PBKDF2 representation. 329 */ 330 public static final String STORAGE_SCHEME_NAME_PBKDF2 = "PBKDF2"; 331 332 333 /** 334 * The password storage scheme name that will be used for passwords stored in 335 * a PKCS5S2 representation. 336 */ 337 public static final String STORAGE_SCHEME_NAME_PKCS5S2 = "PKCS5S2"; 338 339 340 341 /** 342 * The password storage scheme name that will be used for passwords stored in 343 * a UNIX crypt representation. 344 */ 345 public static final String STORAGE_SCHEME_NAME_CRYPT = "CRYPT"; 346 347 348 349 /** 350 * The string that will appear before the name of the password storage scheme 351 * in an encoded password. 352 */ 353 public static final String STORAGE_SCHEME_PREFIX = "{"; 354 355 356 357 /** 358 * The string that will appear after the name of the password storage scheme 359 * in an encoded password. 360 */ 361 public static final String STORAGE_SCHEME_SUFFIX = "}"; 362 363 364 365 /** 366 * The ASN.1 element type that will be used to encode the userIdentity 367 * component in a password modify extended request. 368 */ 369 public static final byte TYPE_PASSWORD_MODIFY_USER_ID = (byte) 0x80; 370 371 372 373 /** 374 * The ASN.1 element type that will be used to encode the oldPasswd component 375 * in a password modify extended request. 376 */ 377 public static final byte TYPE_PASSWORD_MODIFY_OLD_PASSWORD = (byte) 0x81; 378 379 380 381 /** 382 * The ASN.1 element type that will be used to encode the newPasswd component 383 * in a password modify extended request. 384 */ 385 public static final byte TYPE_PASSWORD_MODIFY_NEW_PASSWORD = (byte) 0x82; 386 387 388 389 /** 390 * The ASN.1 element type that will be used to encode the genPasswd component 391 * in a password modify extended response. 392 */ 393 public static final byte TYPE_PASSWORD_MODIFY_GENERATED_PASSWORD = 394 (byte) 0x80; 395} 396