PageRenderTime 35ms CodeModel.GetById 31ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/extern/spongycastle/pkix/src/main/java/org/spongycastle/operator/OutputEncryptor.java

https://gitlab.com/vizilo/fdroidclient
Java | 36 lines | 9 code | 5 blank | 22 comment | 0 complexity | 1d169cffc0e6d2d08cf87e5fb551817e MD5 | raw file
 1package org.spongycastle.operator;
 2
 3import java.io.OutputStream;
 4
 5import org.spongycastle.asn1.x509.AlgorithmIdentifier;
 6
 7/**
 8 * General interface for an operator that is able to produce
 9 * an OutputStream that will output encrypted data.
10 */
11public interface OutputEncryptor
12{
13    /**
14     * Return the algorithm identifier describing the encryption
15     * algorithm and parameters this encryptor uses.
16     *
17     * @return algorithm oid and parameters.
18     */
19    AlgorithmIdentifier getAlgorithmIdentifier();
20
21    /**
22     * Wrap the passed in output stream encOut, returning an output stream
23     * that encrypts anything passed in before sending on to encOut.
24     *
25     * @param encOut output stream for encrypted output.
26     * @return an encrypting OutputStream
27     */
28    OutputStream getOutputStream(OutputStream encOut);
29
30    /**
31     * Return the key used for encrypting the output.
32     *
33     * @return the encryption key.
34     */
35    GenericKey getKey();
36}