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 010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE 011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2006-2008 Sun Microsystems, Inc. 026 */ 027 package org.opends.server.extensions; 028 029 030 /** 031 * This class defines a data structure that will hold state information for use 032 * in the DIGEST-MD5 authentication process. This information will support both 033 * the two-stage initial authentication as well as subsequent authentication. 034 */ 035 public class DigestMD5StateInfo 036 { 037 038 039 040 // The nonce generated by the server for this authentication session. 041 private String nonce; 042 043 // The hex string representation of the nonce count used by the last 044 // successful authentication. 045 private String nonceCount; 046 047 048 049 /** 050 * Creates a new instance of this DIGEST-MD5 state info structure. 051 * 052 * @param nonce The nonce generated by the server for this 053 * authentication session. 054 * @param nonceCount The hex string representation of the nonce count used 055 * by the last successful authentication. 056 */ 057 public DigestMD5StateInfo(String nonce, String nonceCount) 058 { 059 this.nonce = nonce; 060 this.nonceCount = nonceCount; 061 } 062 063 064 065 /** 066 * Retrieves the nonce generated by the server for this authentication 067 * session. 068 * 069 * @return The nonce generated by the server for this authentication session. 070 */ 071 public String getNonce() 072 { 073 return nonce; 074 } 075 076 077 078 /** 079 * Retrieves the hex string representation of the nonce count used by the last 080 * successful authentication. 081 * 082 * @return The hex string representation of the nonce count used by the last 083 * successful authentication. 084 */ 085 public String getNonceCount() 086 { 087 return nonceCount; 088 } 089 090 091 092 /** 093 * Specifies the hex string representation of the nonce count used by the last 094 * successful authentication. 095 * 096 * @param nonceCount The hex string representation of the nonce count used 097 * by the last successful authentication. 098 */ 099 public void setNonceCount(String nonceCount) 100 { 101 this.nonceCount = nonceCount; 102 } 103 } 104