| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final OperatorHelper |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Cipher | |
| pack-priv PGPDataDecryptor | Returns: decryptorAEAD encrypted data packet aeadEncDataPacket, PGPSessionKey session key to decrypt the data sessionKey)Create a |
| pack-priv PGPDataDecryptor | Returns: decryptorversion 2 SEIPD packet seipd, PGPSessionKey session key to decrypt the data sessionKey)Create a |
| 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[] | processAeadKeyData(JceAEADUtil aeadUtil, int mode, 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. |
| helper | back to summary |
|---|---|
| private final OperatorHelper helper | |
| JceAEADUtil | back to summary |
|---|---|
| public JceAEADUtil(OperatorHelper helper) | |
| createAEADCipher | back to summary |
|---|---|
| pack-priv Cipher createAEADCipher(int encAlgorithm, int aeadAlgorithm) throws PGPException | |
| createOpenPgpV5DataDecryptor | back to summary |
|---|---|
| pack-priv PGPDataDecryptor createOpenPgpV5DataDecryptor(AEADEncDataPacket aeadEncDataPacket, PGPSessionKey sessionKey) throws PGPException Create a
| |
| createOpenPgpV6DataDecryptor | back to summary |
|---|---|
| pack-priv PGPDataDecryptor createOpenPgpV6DataDecryptor(SymmetricEncIntegrityPacket seipd, PGPSessionKey sessionKey) throws PGPException Create a
| |
| deriveMessageKeyAndIv | back to summary |
|---|---|
| pack-priv static byte[][] deriveMessageKeyAndIv(int aeadAlgo, int cipherAlgo, byte[] sessionKey, byte[] salt, byte[] hkdfInfo) throws PGPException 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.
| |
| processAeadKeyData | back to summary |
|---|---|
| pack-priv static byte[] processAeadKeyData(JceAEADUtil aeadUtil, int mode, 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 | Field and Description |
|---|---|
| private final byte[] | |
| private final int | |
| private final byte[] | |
| private final Cipher | |
| private long | |
| private final int | |
| private byte[] | |
| private int | |
| private final InputStream | |
| private final byte[] | |
| private final SecretKey | |
| private long | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | PGPAeadInputStream(boolean
AEAD flavour (OpenPGP v5 or v6) isV5AEAD, InputStream underlying input stream in, Cipher AEAD cipher c, SecretKey secret key secretKey, byte[] initialization vector iv, int encryption 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. |
| 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 | |
| aeadTagLength | back to summary |
|---|---|
| private final int aeadTagLength | |
| buf | back to summary |
|---|---|
| private final byte[] buf | |
| c | back to summary |
|---|---|
| private final Cipher 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 | |
| iv | back to summary |
|---|---|
| private final byte[] iv | |
| secretKey | back to summary |
|---|---|
| private final SecretKey secretKey | |
| totalBytes | back to summary |
|---|---|
| private long totalBytes | |
| v5StyleAEAD | back to summary |
|---|---|
| private boolean v5StyleAEAD | |
| PGPAeadInputStream | back to summary |
|---|---|
| public PGPAeadInputStream(boolean isV5AEAD, InputStream in, Cipher c, SecretKey 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
| |
| 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 Cipher | |
| private long | |
| private final int | |
| private final byte[] | |
| private int | |
| private final boolean | |
| private final byte[] | |
| private final OutputStream | |
| private final SecretKey | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | PGPAeadOutputStream(boolean
isV5AEAD of AEAD (OpenPGP v5 or v6) isV5AEAD, OutputStream underlying OutputStream out, Cipher AEAD cipher c, SecretKey secret key secretKey, byte[] initialization vector iv, int encryption algorithm encAlgorithm, int AEAD algorithm aeadAlgorithm, int chunk size of the AEAD algorithm 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[] | Returns: associated datatrue if flavour of AEAD OpenPGP v5 isV5AEAD, int symmetric encryption algorithm encAlgorithm, int AEAD algorithm aeadAlgorithm, int chunk size chunkSize)Create the associated data for the AEAD encryption. |
| private void | |
| private static byte[] | |
| 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 Cipher 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 | |
| isV5AEAD | back to summary |
|---|---|
| private final boolean isV5AEAD | |
| iv | back to summary |
|---|---|
| private final byte[] iv | |
| out | back to summary |
|---|---|
| private final OutputStream out | |
| secretKey | back to summary |
|---|---|
| private final SecretKey secretKey | |
| totalBytes | back to summary |
|---|---|
| private long totalBytes | |
| PGPAeadOutputStream | back to summary |
|---|---|
| public PGPAeadOutputStream(boolean isV5AEAD, OutputStream out, Cipher c, SecretKey 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 isV5AEAD, int encAlgorithm, int aeadAlgorithm, int chunkSize) Create the associated data for the AEAD encryption. Since the associated data array differs between OpenPGP v5 and v6, we need to know the flavour.
| |
| finish | back to summary |
|---|---|
| private void finish() throws IOException | |
| getAdata | back to summary |
|---|---|
| private static byte[] getAdata(boolean isV5AEAD, byte[] aaData, long chunkIndex, long totalBytes) | |
| 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 | |