md.update( ownerPassword.getBytes("ISO-8859-1") );
md.update( userPassword.getBytes("ISO-8859-1") );
md.update( document.getDocument().toString().getBytes() );
byte[] id = md.digest( this.toString().getBytes("ISO-8859-1") );
COSString idString = new COSString();
idString.append( id );
idArray = new COSArray();
idArray.add( idString );
idArray.add( idString );
document.getDocument().setDocumentID( idArray );
}
COSString id = (COSString)idArray.getObject( 0 );
byte[] ownerBytes = computeOwnerPassword(
ownerPassword.getBytes("ISO-8859-1"),
userPassword.getBytes("ISO-8859-1"), revision, length);
byte[] userBytes = computeUserPassword(
userPassword.getBytes("ISO-8859-1"),
ownerBytes, permissionInt, id.getBytes(), revision, length, true);
encryptionKey = computeEncryptedKey(userPassword.getBytes("ISO-8859-1"), ownerBytes,
null, null, null, permissionInt, id.getBytes(), revision, length, true, false);
encryptionDictionary.setOwnerKey(ownerBytes);
encryptionDictionary.setUserKey(userBytes);
}