Class XSSFPasswordHelper
java.lang.Object
org.apache.poi.xssf.usermodel.helpers.XSSFPasswordHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetPassword(org.apache.xmlbeans.XmlObject xobj, String password, HashAlgorithm hashAlgo, String prefix) Sets the XORed or hashed passwordstatic booleanvalidatePassword(org.apache.xmlbeans.XmlObject xobj, String password, String prefix) Validates the password, i.e.
-
Method Details
-
setPassword
public static void setPassword(org.apache.xmlbeans.XmlObject xobj, String password, HashAlgorithm hashAlgo, String prefix) Sets the XORed or hashed password- Parameters:
xobj- the xmlbeans object which contains the password attributespassword- the password, if null, the password attributes will be removedhashAlgo- the hash algorithm, if null the password will be XORedprefix- the prefix of the password attributes, may be null
-
validatePassword
public static boolean validatePassword(org.apache.xmlbeans.XmlObject xobj, String password, String prefix) Validates the password, i.e. calculates the hash of the given password and compares it against the stored hash- Parameters:
xobj- the xmlbeans object which contains the password attributespassword- the password, if null the method will always return false, even if there's no password setprefix- the prefix of the password attributes, may be null- Returns:
- true, if the hashes match
-