PdfEncryptor.java

1
/*
2
/*
3
 * Copyright 2002 Paulo Soares
4
 *
5
 * The contents of this file are subject to the Mozilla Public License Version 1.1
6
 * (the "License"); you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
8
 *
9
 * Software distributed under the License is distributed on an "AS IS" basis,
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
 * for the specific language governing rights and limitations under the License.
12
 *
13
 * The Original Code is 'iText, a free JAVA-PDF library'.
14
 *
15
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
16
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
17
 * All Rights Reserved.
18
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
19
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
20
 *
21
 * Contributor(s): all the names of the contributors are added in the source code
22
 * where applicable.
23
 *
24
 * Alternatively, the contents of this file may be used under the terms of the
25
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
26
 * provisions of LGPL are applicable instead of those above.  If you wish to
27
 * allow use of your version of this file only under the terms of the LGPL
28
 * License and not to allow others to use your version of this file under
29
 * the MPL, indicate your decision by deleting the provisions above and
30
 * replace them with the notice and other provisions required by the LGPL.
31
 * If you do not delete the provisions above, a recipient may use your version
32
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
33
 *
34
 * This library is free software; you can redistribute it and/or modify it
35
 * under the terms of the MPL as stated above or under the terms of the GNU
36
 * Library General Public License as published by the Free Software Foundation;
37
 * either version 2 of the License, or any later version.
38
 *
39
 * This library is distributed in the hope that it will be useful, but WITHOUT
40
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
41
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
42
 * details.
43
 *
44
 * If you didn't download this code from the following link, you should check if
45
 * you aren't using an obsolete version:
46
 * http://www.lowagie.com/iText/
47
 */
48
49
package com.lowagie.text.pdf;
50
51
import java.io.IOException;
52
import java.io.OutputStream;
53
import java.util.Map;
54
55
import com.lowagie.text.DocumentException;
56
57
/** This class takes any PDF and returns exactly the same but
58
 * encrypted. All the content, links, outlines, etc, are kept.
59
 * It is also possible to change the info dictionary.
60
 */
61
public final class PdfEncryptor {
62
    
63
    private PdfEncryptor(){
64
    }
65
    
66
    /** Entry point to encrypt a PDF document. The encryption parameters are the same as in
67
     * <code>PdfWriter</code>. The userPassword and the
68
     *  ownerPassword can be null or have zero length. In this case the ownerPassword
69
     *  is replaced by a random string. The open permissions for the document can be
70
     *  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
71
     *  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
72
     *  The permissions can be combined by ORing them.
73
     * @param reader the read PDF
74
     * @param os the output destination
75
     * @param userPassword the user password. Can be null or empty
76
     * @param ownerPassword the owner password. Can be null or empty
77
     * @param permissions the user permissions
78
     * @param strength128Bits <code>true</code> for 128 bit key length, <code>false</code> for 40 bit key length
79
     * @throws DocumentException on error
80
     * @throws IOException on error */
81
    public static void encrypt(PdfReader reader, OutputStream os, byte[] userPassword, byte[] ownerPassword, int permissions, boolean strength128Bits) throws DocumentException, IOException {
82
        PdfStamper stamper = new PdfStamper(reader, os);
83 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE
        stamper.setEncryption(userPassword, ownerPassword, permissions, strength128Bits);
84 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE
        stamper.close();
85
    }
86
    
87
    /** Entry point to encrypt a PDF document. The encryption parameters are the same as in
88
     * <code>PdfWriter</code>. The userPassword and the
89
     *  ownerPassword can be null or have zero length. In this case the ownerPassword
90
     *  is replaced by a random string. The open permissions for the document can be
91
     *  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
92
     *  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
93
     *  The permissions can be combined by ORing them.
94
     * @param reader the read PDF
95
     * @param os the output destination
96
     * @param userPassword the user password. Can be null or empty
97
     * @param ownerPassword the owner password. Can be null or empty
98
     * @param permissions the user permissions
99
     * @param strength128Bits <code>true</code> for 128 bit key length, <code>false</code> for 40 bit key length
100
     * @param newInfo an optional <CODE>String</CODE> map to add or change
101
     * the info dictionary. Entries with <CODE>null</CODE>
102
     * values delete the key in the original info dictionary
103
     * @throws DocumentException on error
104
     * @throws IOException on error
105
     */
106
    public static void encrypt(PdfReader reader, OutputStream os, byte[] userPassword, byte[] ownerPassword, int permissions, boolean strength128Bits, Map<String, String> newInfo) throws DocumentException, IOException {
107
        PdfStamper stamper = new PdfStamper(reader, os);
108 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE
        stamper.setEncryption(userPassword, ownerPassword, permissions, strength128Bits);
109 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setMoreInfo → NO_COVERAGE
        stamper.setMoreInfo(newInfo);
110 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE
        stamper.close();
111
    }
112
    
113
    /** Entry point to encrypt a PDF document. The encryption parameters are the same as in
114
     * <code>PdfWriter</code>. The userPassword and the
115
     *  ownerPassword can be null or have zero length. In this case the ownerPassword
116
     *  is replaced by a random string. The open permissions for the document can be
117
     *  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
118
     *  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
119
     *  The permissions can be combined by ORing them.
120
     * @param reader the read PDF
121
     * @param os the output destination
122
     * @param strength <code>true</code> for 128 bit key length, <code>false</code> for 40 bit key length
123
     * @param userPassword the user password. Can be null or empty
124
     * @param ownerPassword the owner password. Can be null or empty
125
     * @param permissions the user permissions
126
     * @throws DocumentException on error
127
     * @throws IOException on error */
128
    public static void encrypt(PdfReader reader, OutputStream os, boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException, IOException {
129
        PdfStamper stamper = new PdfStamper(reader, os);
130 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE
        stamper.setEncryption(strength, userPassword, ownerPassword, permissions);
131 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE
        stamper.close();
132
    }
133
    
134
    /** Entry point to encrypt a PDF document. The encryption parameters are the same as in
135
     * <code>PdfWriter</code>. The userPassword and the
136
     *  ownerPassword can be null or have zero length. In this case the ownerPassword
137
     *  is replaced by a random string. The open permissions for the document can be
138
     *  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
139
     *  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
140
     *  The permissions can be combined by ORing them.
141
     * @param reader the read PDF
142
     * @param os the output destination
143
     * @param strength <code>true</code> for 128 bit key length, <code>false</code> for 40 bit key length
144
     * @param userPassword the user password. Can be null or empty
145
     * @param ownerPassword the owner password. Can be null or empty
146
     * @param permissions the user permissions
147
     * @param newInfo an optional <CODE>String</CODE> map to add or change
148
     * the info dictionary. Entries with <CODE>null</CODE>
149
     * values delete the key in the original info dictionary
150
     * @throws DocumentException on error
151
     * @throws IOException on error
152
     */
153
    public static void encrypt(PdfReader reader, OutputStream os, boolean strength, String userPassword, String ownerPassword, int permissions, Map<String, String> newInfo) throws DocumentException, IOException {
154
        PdfStamper stamper = new PdfStamper(reader, os);
155 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE
        stamper.setEncryption(strength, userPassword, ownerPassword, permissions);
156 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setMoreInfo → NO_COVERAGE
        stamper.setMoreInfo(newInfo);
157 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE
        stamper.close();
158
    }
159
160
    
161
    /** Entry point to encrypt a PDF document. The encryption parameters are the same as in
162
     * <code>PdfWriter</code>. The userPassword and the
163
     *  ownerPassword can be null or have zero length. In this case the ownerPassword
164
     *  is replaced by a random string. The open permissions for the document can be
165
     *  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
166
     *  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
167
     *  The permissions can be combined by ORing them.
168
     * @param reader the read PDF
169
     * @param os the output destination
170
     * @param type the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
171
     * Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
172
     * @param userPassword the user password. Can be null or empty
173
     * @param ownerPassword the owner password. Can be null or empty
174
     * @param permissions the user permissions
175
     * @param newInfo an optional <CODE>String</CODE> map to add or change
176
     * the info dictionary. Entries with <CODE>null</CODE>
177
     * values delete the key in the original info dictionary
178
     * @throws DocumentException on error
179
     * @throws IOException on error
180
     */
181
    public static void encrypt(PdfReader reader, OutputStream os, int type, String userPassword, String ownerPassword, int permissions, Map<String, String> newInfo) throws DocumentException, IOException {
182
        PdfStamper stamper = new PdfStamper(reader, os);
183 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE
        stamper.setEncryption(type, userPassword, ownerPassword, permissions);
184 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setMoreInfo → NO_COVERAGE
        stamper.setMoreInfo(newInfo);
185 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE
        stamper.close();
186
    }
187
    
188
    /** Entry point to encrypt a PDF document. The encryption parameters are the same as in
189
     * <code>PdfWriter</code>. The userPassword and the
190
     *  ownerPassword can be null or have zero length. In this case the ownerPassword
191
     *  is replaced by a random string. The open permissions for the document can be
192
     *  AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
193
     *  AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
194
     *  The permissions can be combined by ORing them.
195
     * @param reader the read PDF
196
     * @param os the output destination
197
     * @param type the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
198
     * Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
199
     * @param userPassword the user password. Can be null or empty
200
     * @param ownerPassword the owner password. Can be null or empty
201
     * @param permissions the user permissions
202
     * values delete the key in the original info dictionary
203
     * @throws DocumentException on error
204
     * @throws IOException on error
205
     */
206
    public static void encrypt(PdfReader reader, OutputStream os, int type, String userPassword, String ownerPassword, int permissions) throws DocumentException, IOException {
207
        PdfStamper stamper = new PdfStamper(reader, os);
208 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE
        stamper.setEncryption(type, userPassword, ownerPassword, permissions);
209 1 1. encrypt : removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE
        stamper.close();
210
    }
211
    
212
    /**
213
     * Give you a verbose analysis of the permissions.
214
     * @param permissions the permissions value of a PDF file
215
     * @return a String that explains the meaning of the permissions value
216
     */
217
    public static String getPermissionsVerbose(int permissions) {
218
        StringBuilder buf = new StringBuilder("Allowed:");
219 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_PRINTING & permissions) == PdfWriter.ALLOW_PRINTING) buf.append(" Printing");
220 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_MODIFY_CONTENTS & permissions) == PdfWriter.ALLOW_MODIFY_CONTENTS) buf.append(" Modify contents");
221 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_COPY & permissions) == PdfWriter.ALLOW_COPY) buf.append(" Copy");
222 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_MODIFY_ANNOTATIONS & permissions) == PdfWriter.ALLOW_MODIFY_ANNOTATIONS) buf.append(" Modify annotations");
223 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_FILL_IN & permissions) == PdfWriter.ALLOW_FILL_IN) buf.append(" Fill in");
224 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_SCREENREADERS & permissions) == PdfWriter.ALLOW_SCREENREADERS) buf.append(" Screen readers");
225 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_ASSEMBLY & permissions) == PdfWriter.ALLOW_ASSEMBLY) buf.append(" Assembly");
226 2 1. getPermissionsVerbose : Replaced bitwise AND with OR → NO_COVERAGE
2. getPermissionsVerbose : negated conditional → NO_COVERAGE
        if ((PdfWriter.ALLOW_DEGRADED_PRINTING & permissions) == PdfWriter.ALLOW_DEGRADED_PRINTING) buf.append(" Degraded printing");
227 1 1. getPermissionsVerbose : mutated return of Object value for com/lowagie/text/pdf/PdfEncryptor::getPermissionsVerbose to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return buf.toString();
228
    }
229
    
230
    /**
231
     * Tells you if printing is allowed.
232
     * @param permissions the permissions value of a PDF file
233
     * @return    true if printing is allowed
234
     *
235
     * @since 2.0.7
236
     */
237
    public static boolean isPrintingAllowed(int permissions) {
238 3 1. isPrintingAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isPrintingAllowed : negated conditional → NO_COVERAGE
3. isPrintingAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_PRINTING & permissions) == PdfWriter.ALLOW_PRINTING;
239
    }
240
    
241
    /**
242
     * Tells you if modifying content is allowed.
243
     * @param permissions the permissions value of a PDF file
244
     * @return    true if modifying content is allowed
245
     *
246
     * @since 2.0.7
247
     */
248
    public static boolean isModifyContentsAllowed(int permissions) {
249 3 1. isModifyContentsAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isModifyContentsAllowed : negated conditional → NO_COVERAGE
3. isModifyContentsAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_MODIFY_CONTENTS & permissions) == PdfWriter.ALLOW_MODIFY_CONTENTS;
250
    } 
251
    
252
    /**
253
     * Tells you if copying is allowed.
254
     * @param permissions the permissions value of a PDF file
255
     * @return    true if copying is allowed
256
     *
257
     * @since 2.0.7
258
     */
259
    public static boolean isCopyAllowed(int permissions) {
260 3 1. isCopyAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isCopyAllowed : negated conditional → NO_COVERAGE
3. isCopyAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_COPY & permissions) == PdfWriter.ALLOW_COPY;
261
    }
262
    
263
    /**
264
     * Tells you if modifying annotations is allowed.
265
     * @param permissions the permissions value of a PDF file
266
     * @return    true if modifying annotations is allowed
267
     *
268
     * @since 2.0.7
269
     */
270
    public static boolean isModifyAnnotationsAllowed(int permissions) {
271 3 1. isModifyAnnotationsAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isModifyAnnotationsAllowed : negated conditional → NO_COVERAGE
3. isModifyAnnotationsAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_MODIFY_ANNOTATIONS & permissions) == PdfWriter.ALLOW_MODIFY_ANNOTATIONS;
272
    }
273
    
274
    /**
275
     * Tells you if filling in fields is allowed.
276
     * @param permissions the permissions value of a PDF file
277
     * @return    true if filling in fields is allowed
278
     *
279
     * @since 2.0.7
280
     */
281
    public static boolean isFillInAllowed(int permissions) {
282 3 1. isFillInAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isFillInAllowed : negated conditional → NO_COVERAGE
3. isFillInAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_FILL_IN & permissions) == PdfWriter.ALLOW_FILL_IN;
283
    }
284
    
285
    /**
286
     * Tells you if repurposing for screenreaders is allowed.
287
     * @param permissions the permissions value of a PDF file
288
     * @return    true if repurposing for screenreaders is allowed
289
     *
290
     * @since 2.0.7
291
     */
292
    public static boolean isScreenReadersAllowed(int permissions) {
293 3 1. isScreenReadersAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isScreenReadersAllowed : negated conditional → NO_COVERAGE
3. isScreenReadersAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_SCREENREADERS & permissions) == PdfWriter.ALLOW_SCREENREADERS;
294
    }
295
    
296
    /**
297
     * Tells you if document assembly is allowed.
298
     * @param permissions the permissions value of a PDF file
299
     * @return    true if document assembly is allowed
300
     *
301
     * @since 2.0.7
302
     */
303
    public static boolean isAssemblyAllowed(int permissions) {
304 3 1. isAssemblyAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isAssemblyAllowed : negated conditional → NO_COVERAGE
3. isAssemblyAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_ASSEMBLY & permissions) == PdfWriter.ALLOW_ASSEMBLY;
305
    }
306
    
307
    /**
308
     * Tells you if degraded printing is allowed.
309
     * @param permissions the permissions value of a PDF file
310
     * @return    true if degraded printing is allowed
311
     *
312
     * @since 2.0.7
313
     */
314
    public static boolean isDegradedPrintingAllowed(int permissions) {
315 3 1. isDegradedPrintingAllowed : Replaced bitwise AND with OR → NO_COVERAGE
2. isDegradedPrintingAllowed : negated conditional → NO_COVERAGE
3. isDegradedPrintingAllowed : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (PdfWriter.ALLOW_DEGRADED_PRINTING & permissions) == PdfWriter.ALLOW_DEGRADED_PRINTING;
316
    }
317
}

Mutations

83

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE

84

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE

108

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE

109

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setMoreInfo → NO_COVERAGE

110

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE

130

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE

131

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE

155

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE

156

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setMoreInfo → NO_COVERAGE

157

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE

183

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE

184

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setMoreInfo → NO_COVERAGE

185

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE

208

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::setEncryption → NO_COVERAGE

209

1.1
Location : encrypt
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamper::close → NO_COVERAGE

219

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

220

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

221

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

222

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

223

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

224

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

225

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

226

1.1
Location : getPermissionsVerbose
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getPermissionsVerbose
Killed by : none
negated conditional → NO_COVERAGE

227

1.1
Location : getPermissionsVerbose
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/PdfEncryptor::getPermissionsVerbose to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

238

1.1
Location : isPrintingAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isPrintingAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isPrintingAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

249

1.1
Location : isModifyContentsAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isModifyContentsAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isModifyContentsAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

260

1.1
Location : isCopyAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isCopyAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isCopyAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

271

1.1
Location : isModifyAnnotationsAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isModifyAnnotationsAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isModifyAnnotationsAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

282

1.1
Location : isFillInAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isFillInAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isFillInAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

293

1.1
Location : isScreenReadersAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isScreenReadersAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isScreenReadersAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

304

1.1
Location : isAssemblyAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isAssemblyAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isAssemblyAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

315

1.1
Location : isDegradedPrintingAllowed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : isDegradedPrintingAllowed
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isDegradedPrintingAllowed
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2