/** * Returns a Base64Binary instance representing the specified String value * * @param stringValue * a String value * @return return a Base64Binary instance representing stringValue * @throws NumberFormatException If the parameter is not a valid Base64Binary. */ public static Base64Binary valueOf(String stringValue) throws NumberFormatException { if (stringValue == null) { throw new NumberFormatException( "parameter can not be null for Base64Binary"); } return new Base64Binary(Base64.decode(stringValue)); }
String ivStr = algorithmElement.getInitialisationVectorAttribute(); String checksum = encryptionDataElement.getChecksumAttribute(); byte[] salt = Base64Binary.valueOf(saltStr).getBytes(); byte[] iv = Base64Binary.valueOf(ivStr).getBytes(); byte[] passBytes = mOldPwd.getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] checksumBytes = new byte[20]; md.digest(checksumBytes, 0, 20); String newChecksum = new Base64Binary(checksumBytes).toString(); if (newChecksum.equals(checksum)) {
String checksum = new Base64Binary(checksumBytes).toString(); FileEntryElement fileEntryElement = fileEntry.getOdfElement(); EncryptionDataElement encryptionDataElement = OdfElement.findFirstChildNode(EncryptionDataElement.class, fileEntryElement); String initialisationVector = new Base64Binary(iv).toString(); AlgorithmElement algorithmElement = OdfElement.findFirstChildNode(AlgorithmElement.class, encryptionDataElement); if (algorithmElement != null) { String saltStr = new Base64Binary(salt).toString(); KeyDerivationElement keyDerivationElement = OdfElement.findFirstChildNode(KeyDerivationElement.class, encryptionDataElement); if (keyDerivationElement != null) {
String ivStr = algorithmElement.getInitialisationVectorAttribute(); String checksum = encryptionDataElement.getChecksumAttribute(); byte[] salt = Base64Binary.valueOf(saltStr).getBytes(); byte[] iv = Base64Binary.valueOf(ivStr).getBytes(); byte[] passBytes = mOldPwd.getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] checksumBytes = new byte[20]; md.digest(checksumBytes, 0, 20); String newChecksum = new Base64Binary(checksumBytes).toString(); if (newChecksum.equals(checksum)) {
String checksum = new Base64Binary(checksumBytes).toString(); FileEntryElement fileEntryElement = fileEntry.getOdfElement(); EncryptionDataElement encryptionDataElement = OdfElement.findFirstChildNode(EncryptionDataElement.class, fileEntryElement); String initialisationVector = new Base64Binary(iv).toString(); AlgorithmElement algorithmElement = OdfElement.findFirstChildNode(AlgorithmElement.class, encryptionDataElement); if (algorithmElement != null) { String saltStr = new Base64Binary(salt).toString(); KeyDerivationElement keyDerivationElement = OdfElement.findFirstChildNode(KeyDerivationElement.class, encryptionDataElement); if (keyDerivationElement != null) {
/** * Returns a Base64Binary instance representing the specified String value * * @param stringValue * a String value * @return return a Base64Binary instance representing stringValue * @throws NumberFormatException If the parameter is not a valid Base64Binary. */ public static Base64Binary valueOf(String stringValue) throws NumberFormatException { if (stringValue == null) { throw new NumberFormatException( "parameter can not be null for Base64Binary"); } return new Base64Binary(Base64.decode(stringValue)); }
/** * Returns a Base64Binary instance representing the specified String value * * @param stringValue * a String value * @return return a Base64Binary instance representing stringValue * @throws NumberFormatException If the parameter is not a valid Base64Binary. */ public static Base64Binary valueOf(String stringValue) throws NumberFormatException { if (stringValue == null) { throw new NumberFormatException( "parameter can not be null for Base64Binary"); } return new Base64Binary(Base64.decode(stringValue)); }