| Modifier and Type | Class and Description |
|---|---|
| private static interface | |
| protected static class | |
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | |
| private static final String | |
| pack-priv static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static AEADBlockCipher | |
| private static AEADBlockCipher | |
| pack-priv static PGPDataDecryptor | Returns: decryptor for AEAD encrypted data packetsAEAD encrypted data packet aeadEncDataPacket, PGPSessionKey session key retrieved from a version 5 symmetric-key encrypted session key packet
or version 3 public-key encrypted session key packet. sessionKey)Create a decryptor for OpenPGP v5 AED (AEAD Encrypted Data) packets. |
| pack-priv static PGPDataDecryptor | Returns: decryptorversion 2 symmetrically encrypted integrity-protected data packet seipd, PGPSessionKey session key as retrieved from a version 6 symmetric- or public-key-encrypted session key packet. sessionKey)Create a data decryptor for SEIPD v2 packets used in OpenPGP v6. |
| pack-priv static byte[][] | Returns: message key and separate IVAEAD algorithm aeadAlgo, int symmetric cipher algorithm cipherAlgo, byte[] session key sessionKey, byte[] salt salt, byte[] HKDF info hkdfInfo)Derive a message key and IV from the given session key. |
| pack-priv static byte[] | |
| protected static long | Returns: decoded lengthencoded chunk size chunkSize)Calculate an actual chunk length from the encoded chunk size. |
| protected static byte[] | Returns: nonceinitialization vector iv, long chunk index chunkIndex)Generate a nonce by xor-ing the given iv with the chunk index. |
| pack-priv static byte[] | processAEADData(boolean forEncryption, int encAlgorithm, int aeadAlgorithm, byte[] key, byte[] iv, byte[] aad, byte[] msg, int off, int len, String errorMessage)
|
| pack-priv static byte[] | processAEADData(boolean forEncryption, AEADBlockCipher cipher, KeyParameter key, byte[] iv, byte[] aad, byte[] msg, int off, int msgLen)
|
| pack-priv static byte[] | processAeadKeyData(boolean forEncryption, int encAlgorithm, int aeadAlgorithm, byte[] s2kKey, byte[] iv, int packetTag, int keyVersion, byte[] keyData, int keyOff, int keyLen, byte[] pubkeyData)
|
| protected static void | xorChunkId(byte[]
byte array nonce, long chunk index chunkIndex)XOR the byte array with the chunk index in-place. |
| GetEskAndTagErrorMessage | back to summary |
|---|---|
| pack-priv static final String GetEskAndTagErrorMessage | |
| ProcessAeadKeyDataErrorMessage | back to summary |
|---|---|
| private static final String ProcessAeadKeyDataErrorMessage | |
| RecoverAEADEncryptedSessionDataErrorMessage | back to summary |
|---|---|
| pack-priv static final String RecoverAEADEncryptedSessionDataErrorMessage | |
| BcAEADUtil | back to summary |
|---|---|
| public BcAEADUtil() | |
| createAEADCipher | back to summary |
|---|---|
| public static AEADBlockCipher createAEADCipher(int encAlgorithm, int aeadAlgorithm) throws PGPException | |
| createAEADCipher | back to summary |
|---|---|
| private static AEADBlockCipher createAEADCipher(int aeadAlgorithm, BcAEADUtil. | |
| createOpenPgpV5DataDecryptor | back to summary |
|---|---|
| pack-priv static PGPDataDecryptor createOpenPgpV5DataDecryptor(AEADEncDataPacket aeadEncDataPacket, PGPSessionKey sessionKey) throws PGPException Create a decryptor for OpenPGP v5 AED (AEAD Encrypted Data) packets.
This is type of packet is used by GnuPG.
For version 2 SEIPD packets used in OpenPGP v6, see
| |
| createOpenPgpV6DataDecryptor | back to summary |
|---|---|
| pack-priv static PGPDataDecryptor createOpenPgpV6DataDecryptor(SymmetricEncIntegrityPacket seipd, PGPSessionKey sessionKey) throws PGPException Create a data decryptor for SEIPD v2 packets used in OpenPGP v6. Those are symmetrically encrypted integrity protected data packets that make use of AEAD.
| |
| deriveMessageKeyAndIv | back to summary |
|---|---|
| pack-priv static byte[][] deriveMessageKeyAndIv(int aeadAlgo, int cipherAlgo, byte[] sessionKey, byte[] salt, byte[] hkdfInfo) Derive a message key and IV from the given session key. The result is two byte arrays containing the key bytes and the IV.
| |
| generateHKDFBytes | back to summary |
|---|---|
| pack-priv static byte[] generateHKDFBytes(byte[] sessionKey, byte[] salt, byte[] hkdfInfo, int len) | |
| getChunkLength | back to summary |
|---|---|
| protected static long getChunkLength(int chunkSize) Calculate an actual chunk length from the encoded chunk size.
| |
| getNonce | back to summary |
|---|---|
| protected static byte[] getNonce(byte[] iv, long chunkIndex) Generate a nonce by xor-ing the given iv with the chunk index.
| |
| processAEADData | back to summary |
|---|---|
| pack-priv static byte[] processAEADData(boolean forEncryption, int encAlgorithm, int aeadAlgorithm, byte[] key, byte[] iv, byte[] aad, byte[] msg, int off, int len, String errorMessage) throws PGPException | |
| processAEADData | back to summary |
|---|---|
| pack-priv static byte[] processAEADData(boolean forEncryption, AEADBlockCipher cipher, KeyParameter key, byte[] iv, byte[] aad, byte[] msg, int off, int msgLen) throws InvalidCipherTextException | |
| processAeadKeyData | back to summary |
|---|---|
| pack-priv static byte[] processAeadKeyData(boolean forEncryption, int encAlgorithm, int aeadAlgorithm, byte[] s2kKey, byte[] iv, int packetTag, int keyVersion, byte[] keyData, int keyOff, int keyLen, byte[] pubkeyData) throws PGPException | |
| xorChunkId | back to summary |
|---|---|
| protected static void xorChunkId(byte[] nonce, long chunkIndex) XOR the byte array with the chunk index in-place.
| |
| Modifier and Type | Method and Description |
|---|---|
| public BlockCipher |
| newInstance | back to summary |
|---|---|
| public BlockCipher newInstance() | |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final byte[] | |
| private final AEADBlockCipher | |
| private long | |
| private final int | |
| private byte[] | |
| private int | |
| private final InputStream | |
| private final boolean | |
| private final byte[] | |
| private final KeyParameter | |
| private final int | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | PGPAeadInputStream(boolean
flavour of AEAD (OpenPGP v5 or v6) isV5StyleAEAD, InputStream underlying InputStream in, AEADBlockCipher decryption cipher c, KeyParameter decryption key secretKey, byte[] initialization vector iv, int symmetric cipher algorithm encAlgorithm, int AEAD algorithm aeadAlgorithm, int chunk size of the AEAD encryption chunkSize, byte[] associated data aaData)InputStream for decrypting AEAD encrypted data. |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Overrides java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected. |
| private static byte[] | |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| private byte[] | |
| public long | skip(long
the number of bytes to be skipped. n)Overrides java. Skips over and discards |
| aaData | back to summary |
|---|---|
| private final byte[] aaData | |
| buf | back to summary |
|---|---|
| private final byte[] buf | |
| c | back to summary |
|---|---|
| private final AEADBlockCipher c | |
| chunkIndex | back to summary |
|---|---|
| private long chunkIndex | |
| chunkLength | back to summary |
|---|---|
| private final int chunkLength | |
| data | back to summary |
|---|---|
| private byte[] data | |
| dataOff | back to summary |
|---|---|
| private int dataOff | |
| in | back to summary |
|---|---|
| private final InputStream in | |
| isV5StyleAEAD | back to summary |
|---|---|
| private final boolean isV5StyleAEAD | |
| iv | back to summary |
|---|---|
| private final byte[] iv | |
| secretKey | back to summary |
|---|---|
| private final KeyParameter secretKey | |
| tagLen | back to summary |
|---|---|
| private final int tagLen | |
| totalBytes | back to summary |
|---|---|
| private long totalBytes | |
| PGPAeadInputStream | back to summary |
|---|---|
| public PGPAeadInputStream(boolean isV5StyleAEAD, InputStream in, AEADBlockCipher c, KeyParameter secretKey, byte[] iv, int encAlgorithm, int aeadAlgorithm, int chunkSize, byte[] aaData) throws IOException InputStream for decrypting AEAD encrypted data.
| |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Doc from java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected. The read might be on the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes. Note that while some implementations of A subclass's implementation of this method may choose to throw an
| |
| getAdata | back to summary |
|---|---|
| private static byte[] getAdata(boolean isV5StyleAEAD, byte[] aaData, long chunkIndex, long totalBytes) | |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| readBlock | back to summary |
|---|---|
| private byte[] readBlock() throws IOException | |
| skip | back to summary |
|---|---|
| public long skip(long n) throws IOException Overrides java. Doc from java. Skips over and discards
| |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final AEADBlockCipher | |
| private long | |
| private final int | |
| private final byte[] | |
| private int | |
| private final boolean | |
| private final byte[] | |
| private final OutputStream | |
| private final KeyParameter | |
| private final int | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | PGPAeadOutputStream(boolean
flavour of AEAD (OpenPGP v5 or v6) isV5StyleAEAD, OutputStream underlying OutputStream out, AEADBlockCipher AEAD cipher c, KeyParameter secret key secretKey, byte[] initialization vector iv, int encryption algorithm encAlgorithm, int aead algorithm aeadAlgorithm, int chunk size of the AEAD encryption chunkSize)OutputStream for AEAD encryption. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| private byte[] | |
| private void | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
| private void |
| aaData | back to summary |
|---|---|
| private final byte[] aaData | |
| c | back to summary |
|---|---|
| private final AEADBlockCipher c | |
| chunkIndex | back to summary |
|---|---|
| private long chunkIndex | |
| chunkLength | back to summary |
|---|---|
| private final int chunkLength | |
| data | back to summary |
|---|---|
| private final byte[] data | |
| dataOff | back to summary |
|---|---|
| private int dataOff | |
| isV5StyleAEAD | back to summary |
|---|---|
| private final boolean isV5StyleAEAD | |
| iv | back to summary |
|---|---|
| private final byte[] iv | |
| out | back to summary |
|---|---|
| private final OutputStream out | |
| secretKey | back to summary |
|---|---|
| private final KeyParameter secretKey | |
| tagLen | back to summary |
|---|---|
| private final int tagLen | |
| totalBytes | back to summary |
|---|---|
| private long totalBytes | |
| PGPAeadOutputStream | back to summary |
|---|---|
| public PGPAeadOutputStream(boolean isV5StyleAEAD, OutputStream out, AEADBlockCipher c, KeyParameter secretKey, byte[] iv, int encAlgorithm, int aeadAlgorithm, int chunkSize) OutputStream for AEAD encryption.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| createAAD | back to summary |
|---|---|
| private byte[] createAAD(boolean isV5StyleAEAD, int encAlgorithm, int aeadAlgorithm, int chunkSize) | |
| finish | back to summary |
|---|---|
| private void finish() throws IOException | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| writeBlock | back to summary |
|---|---|
| private void writeBlock() throws IOException | |