/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: Utils.java,v 1.2 2008/09/04 22:26:12 kevinserwin Exp $
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* Run the hash with the pass in MessageDigest and InputStream
*
* @param md The MessageDigest to be used.
* @param in The InputStream of the data to be hashed.
* @return The MessageDigest object after doing the hashing.
*/
try {
synchronized(buf){
}
} catch (IOException ex) {
}
return md;
}
/**
* Calculate and return the hash value with byte array.
*
* @param algorithm The string to indicate the hashing algorithm to be used.
* @param in The InputStream of the data to be hashed.
* @return The hash value in byte array.
*/
try {
} catch (NoSuchAlgorithmException ex) {
}
return null;
}
/**
* Translate the byte array into Hex String.
*
* @param hash The byte array of hash value.
* @return The string of the hash value in Hex.
*/
}
return hashBuffer.toString();
}
/**
* Check whether the string matches the pattern.
*
* @param actualString The string to be checked.
* @param patterns A list of patterns to check for.
* @param wildCard A character which is used as wild card in the pattern.
* @return Whether the string matches one of the patterns in the list.
*/
char wildCard){
boolean matched = false;
matched = true;
break;
}
}
return matched;
}
/**
* Check whether the string matches the pattern.
*
* @param actualString The string to be checked.
* @param pattern A pattern to check for.
* @param wildCard A character which is used as wild card in the pattern.
* @return Whether the string matches one of the patterns in the list.
*/
char wildCard){
int matchOffset = 0;
boolean matched = true;
}
if (matchedIndex >= matchOffset) {
} else {
length() !=
matched = false;
break;
}
}
}
} else {
matched = false;
break;
}
buffer = new StringBuffer();
}
}
}
return matched;
}
}