Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PGPDataEncryptor.java « operator « openpgp « bouncycastle « org « java « main « src « pg - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fbd994a002e160d8a164e5c29a4d88adfe7fc52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.bouncycastle.openpgp.operator;

import java.io.OutputStream;

/**
 * A data encryptor, combining a cipher instance and an optional integrity check calculator.
 * <p/>
 * {@link PGPDataEncryptor} instances are generally not constructed directly, but obtained from a
 * {@link PGPDataEncryptorBuilder}.
 */
public interface PGPDataEncryptor
{
    /**
     * Constructs an encrypting output stream that encrypts data using the underlying cipher of this
     * encryptor.
     * <p/>
     * The cipher instance in this encryptor is used for all output streams obtained from this
     * method, so it should only be invoked once.
     *
     * @param out the stream to wrap and write encrypted data to.
     * @return a cipher output stream appropriate to the type of this data encryptor.
     */
    OutputStream getOutputStream(OutputStream out);

    /**
     * Obtains the integrity check calculator configured for this encryptor instance.
     *
     * @return the integrity check calculator, or <code>null</code> if no integrity checking was
     *         configured.
     */
    PGPDigestCalculator getIntegrityCalculator();

    /**
     * Gets the block size of the underlying cipher used by this encryptor.
     *
     * @return the block size in bytes.
     */
    int getBlockSize();
}