Top Inners Constructors Methods
org.bouncycastle.crypto.general

pack-priv abstract Class GuardedAEADOperatorFactory<T extends Parameters>

extends Object
implements AEADOperatorFactory<T extends Parameters>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AEADOperatorFactory
Known Direct Subclasses
org.bouncycastle.crypto.general.RC2.AEADOperatorFactory, org.bouncycastle.crypto.general.SEED.AEADOperatorFactory, org.bouncycastle.crypto.general.Serpent.AEADOperatorFactory, org.bouncycastle.crypto.general.SHACAL2.AEADOperatorFactory, org.bouncycastle.crypto.general.IDEA.AEADOperatorFactory, org.bouncycastle.crypto.general.TripleDES.AEADOperatorFactory, org.bouncycastle.crypto.general.Twofish.AEADOperatorFactory, org.bouncycastle.crypto.general.GOST28147.AEADOperatorFactory, org.bouncycastle.crypto.general.AES.AEADOperatorFactory, org.bouncycastle.crypto.general.Blowfish.AEADOperatorFactory, org.bouncycastle.crypto.general.Camellia.AEADOperatorFactory, org.bouncycastle.crypto.general.CAST5.AEADOperatorFactory, org.bouncycastle.crypto.general.DES.AEADOperatorFactory
Imports
java.io.IOException, .InputStream, .OutputStream, org.bouncycastle.crypto.AEADOperatorFactory, .CipherOutputStream, .CryptoServicesRegistrar, .InputAEADDecryptor, .OutputAEADDecryptor, .OutputAEADEncryptor, .Parameters, .SymmetricKey, .UpdateOutputStream, org.bouncycastle.crypto.fips.FipsStatus, .FipsUnapprovedOperationError, org.bouncycastle.crypto.internal.io.CipherInputStream, .CipherOutputStreamImpl, org.bouncycastle.crypto.internal.modes.AEADBlockCipher

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected abstract AEADBlockCipher
createAEADCipher(boolean forEncryption, SymmetricKey key, T parameters)

public InputAEADDecryptor<T>
createInputAEADDecryptor(SymmetricKey
the key to use to set up the decryptor.
key
,
final T
any additional parameters required to set up the decryptor.
parameters
)

Implements org.bouncycastle.crypto.AEADOperatorFactory.createInputAEADDecryptor.

Create an object for decrypting input and handling AAD data.
public OutputAEADDecryptor<T>
createOutputAEADDecryptor(SymmetricKey
the key to use to set up the decryptor.
key
,
final T
any additional parameters required to set up the decryptor.
parameters
)

Implements org.bouncycastle.crypto.AEADOperatorFactory.createOutputAEADDecryptor.

Create an object for decrypting output and handling AAD data.
public OutputAEADEncryptor<T>
createOutputAEADEncryptor(SymmetricKey
the key to use to set up the encryptor.
key
,
final T
any additional parameters required to set up the encryptor.
parameters
)

Implements org.bouncycastle.crypto.AEADOperatorFactory.createOutputAEADEncryptor.

Create an object for encrypting output and handling AAD data.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

GuardedAEADOperatorFactoryback to summary
pack-priv GuardedAEADOperatorFactory()

Method Detail

createAEADCipherback to summary
protected abstract AEADBlockCipher createAEADCipher(boolean forEncryption, SymmetricKey key, T parameters)
createInputAEADDecryptorback to summary
public InputAEADDecryptor<T> createInputAEADDecryptor(SymmetricKey key, final T parameters)

Implements org.bouncycastle.crypto.AEADOperatorFactory.createInputAEADDecryptor.

Doc from org.bouncycastle.crypto.AEADOperatorFactory.createInputAEADDecryptor.

Create an object for decrypting input and handling AAD data.

Parameters
key:SymmetricKey

the key to use to set up the decryptor.

parameters:T

any additional parameters required to set up the decryptor.

Returns:InputAEADDecryptor<T>

an AEAD decryptor which can be used wrap an input stream.

createOutputAEADDecryptorback to summary
public OutputAEADDecryptor<T> createOutputAEADDecryptor(SymmetricKey key, final T parameters)

Implements org.bouncycastle.crypto.AEADOperatorFactory.createOutputAEADDecryptor.

Doc from org.bouncycastle.crypto.AEADOperatorFactory.createOutputAEADDecryptor.

Create an object for decrypting output and handling AAD data.

Parameters
key:SymmetricKey

the key to use to set up the decryptor.

parameters:T

any additional parameters required to set up the decryptor.

Returns:OutputAEADDecryptor<T>

an AEAD decryptor which can be used wrap an output stream.

createOutputAEADEncryptorback to summary
public OutputAEADEncryptor<T> createOutputAEADEncryptor(SymmetricKey key, final T parameters)

Implements org.bouncycastle.crypto.AEADOperatorFactory.createOutputAEADEncryptor.

Doc from org.bouncycastle.crypto.AEADOperatorFactory.createOutputAEADEncryptor.

Create an object for encrypting output and handling AAD data.

Parameters
key:SymmetricKey

the key to use to set up the encryptor.

parameters:T

any additional parameters required to set up the encryptor.

Returns:OutputAEADEncryptor<T>

an AEAD encryptor which can be used wrap an output stream.

org.bouncycastle.crypto.general back to summary

private Class GuardedAEADOperatorFactory.AADStream

extends UpdateOutputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private AEADBlockCipher

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
write(byte[]
the data.
buf
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.
public void
write(int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.
Inherited from org.bouncycastle.crypto.UpdateOutputStream:
updateupdateupdate

Field Detail

cipherback to summary
private AEADBlockCipher cipher

Constructor Detail

AADStreamback to summary
pack-priv AADStream(AEADBlockCipher cipher)

Method Detail

writeback to summary
public void write(byte[] buf, int off, int len) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Parameters
buf:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
org.bouncycastle.crypto.general back to summary

private Class GuardedAEADOperatorFactory.OutEncryptor

extends Object
implements OutputAEADEncryptor<T extends Parameters>
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.crypto.general.GuardedAEADOperatorFactory.OutEncryptor
All Implemented Interfaces
org.bouncycastle.crypto.OutputAEADEncryptor, org.bouncycastle.crypto.AADProcessor, org.bouncycastle.crypto.OutputEncryptor, org.bouncycastle.crypto.OutputCipher

Field Summary

Modifier and TypeField and Description
private final AEADBlockCipher
private final T

Constructor Summary

AccessConstructor and Description
pack-priv
OutEncryptor(SymmetricKey key, T parameters)

Method Summary

Modifier and TypeMethod and Description
public UpdateOutputStream
getAADStream()

Implements org.bouncycastle.crypto.AADProcessor.getAADStream.

Return a stream to write associated data to in order to have it incorporated into the AEAD cipher's MAC.
public CipherOutputStream
getEncryptingStream(final OutputStream
the output stream to collect the encrypted data in.
out
)

Implements org.bouncycastle.crypto.OutputEncryptor.getEncryptingStream.

Return a stream which will encrypt it's input writing the results to out.
public byte[]
getMAC()

Implements org.bouncycastle.crypto.AADProcessor.getMAC.

Return the final value of AEAD cipher's MAC.
public int
getMaxOutputSize(int
the length of the input.
inputLen
)

Implements org.bouncycastle.crypto.OutputCipher.getMaxOutputSize.

Return the size of the output buffer required for a write() plus a close() with the write() being passed inputLen bytes.
public T
getParameters()

Implements org.bouncycastle.crypto.OutputCipher.getParameters.

Return the parameters for this cipher.
public int
getUpdateOutputSize(int
the length of the input.
inputLen
)

Implements org.bouncycastle.crypto.OutputCipher.getUpdateOutputSize.

Return the size of the output buffer required for a write() with the write() being passed inputLen bytes and just updating the cipher output.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cipherback to summary
private final AEADBlockCipher cipher
parametersback to summary
private final T parameters

Constructor Detail

OutEncryptorback to summary
pack-priv OutEncryptor(SymmetricKey key, T parameters)

Method Detail

getAADStreamback to summary
public UpdateOutputStream getAADStream()

Implements org.bouncycastle.crypto.AADProcessor.getAADStream.

Doc from org.bouncycastle.crypto.AADProcessor.getAADStream.

Return a stream to write associated data to in order to have it incorporated into the AEAD cipher's MAC.

Returns:UpdateOutputStream

a stream for collecting associated data.

getEncryptingStreamback to summary
public CipherOutputStream getEncryptingStream(final OutputStream out)

Implements org.bouncycastle.crypto.OutputEncryptor.getEncryptingStream.

Doc from org.bouncycastle.crypto.OutputEncryptor.getEncryptingStream.

Return a stream which will encrypt it's input writing the results to out.

Parameters
out:OutputStream

the output stream to collect the encrypted data in.

Returns:CipherOutputStream

a stream for writing the original plain-text data.

getMACback to summary
public byte[] getMAC()

Implements org.bouncycastle.crypto.AADProcessor.getMAC.

Doc from org.bouncycastle.crypto.AADProcessor.getMAC.

Return the final value of AEAD cipher's MAC.

Returns:byte[]

MAC value for the AEAD cipher.

getMaxOutputSizeback to summary
public int getMaxOutputSize(int inputLen)

Implements org.bouncycastle.crypto.OutputCipher.getMaxOutputSize.

Doc from org.bouncycastle.crypto.OutputCipher.getMaxOutputSize.

Return the size of the output buffer required for a write() plus a close() with the write() being passed inputLen bytes.

The returned size may be dependent on the initialisation of this cipher and may not be accurate once subsequent input data is processed as the cipher may add, add or remove padding, as it sees fit.

Parameters
inputLen:int

the length of the input.

Returns:int

the space required to accommodate a call to processBytes and doFinal with inputLen bytes of input.

getParametersback to summary
public T getParameters()

Implements org.bouncycastle.crypto.OutputCipher.getParameters.

Doc from org.bouncycastle.crypto.OutputCipher.getParameters.

Return the parameters for this cipher.

Returns:T

the cipher's parameters.

getUpdateOutputSizeback to summary
public int getUpdateOutputSize(int inputLen)

Implements org.bouncycastle.crypto.OutputCipher.getUpdateOutputSize.

Doc from org.bouncycastle.crypto.OutputCipher.getUpdateOutputSize.

Return the size of the output buffer required for a write() with the write() being passed inputLen bytes and just updating the cipher output.

The returned size may be dependent on the state of this cipher.

Parameters
inputLen:int

the length of the input.

Returns:int

the space required to accommodate a call to processBytes with inputLen bytes of input.