Interface CryptoHandler
- All Known Subinterfaces:
- MessageCryptoHandler
- All Known Implementing Classes:
- DecryptionHandler,- EncryptionHandler,- LazyMessageCryptoHandler
The implementations of this interface provided in this package currently process bytes in a single block mode (where all input data is processed in entirety, or in a framing mode (where data is processed incrementally in chunks).
- 
Method SummaryModifier and TypeMethodDescriptionintdoFinal(byte[] out, int outOff)Finish processing of the bytes.intReturn the size of the output buffer required for a call todoFinal(byte[], int).intestimateOutputSize(int inLen)Return the size of the output buffer required for aprocessBytes(byte[], int, int, byte[], int)plus adoFinal(byte[], int)call with an input ofinLenbytes.intestimatePartialOutputSize(int inLen)Return the size of the output buffer required for a call toprocessBytes(byte[], int, int, byte[], int).booleanFor decrypt and parsing flows returnstruewhen this has handled as many bytes as it can.processBytes(byte[] in, int inOff, int inLen, byte[] out, int outOff)Process a block of bytes frominputting the result intoout.
- 
Method Details- 
processBytesProcess a block of bytes frominputting the result intoout.- Parameters:
- in- the input byte array.
- inOff- the offset into the- inarray where the data to be processed starts.
- inLen- the number of bytes to be processed.
- out- the output buffer the processed bytes go into.
- outOff- the offset into the output byte array the processed data starts at.
- Returns:
- the number of bytes written to outand the number of bytes parsed.
 
- 
doFinalint doFinal(byte[] out, int outOff)Finish processing of the bytes.- Parameters:
- out- the output buffer for copying any remaining output data.
- outOff- offset into- outto start copying the output data.
- Returns:
- number of bytes written into out.
 
- 
estimateOutputSizeint estimateOutputSize(int inLen)Return the size of the output buffer required for aprocessBytes(byte[], int, int, byte[], int)plus adoFinal(byte[], int)call with an input ofinLenbytes.Note this method is allowed to return an estimation of the output size that is greater than the actual size of the output. Returning an estimate that is lesser than the actual size of the output will result in underflow exceptions. - Parameters:
- inLen- the length of the input.
- Returns:
- the space required to accommodate a call to processBytes and doFinal(byte[], int)with an input of sizeinLenbytes.
 
- 
estimatePartialOutputSizeint estimatePartialOutputSize(int inLen)Return the size of the output buffer required for a call toprocessBytes(byte[], int, int, byte[], int).Note this method is allowed to return an estimation of the output size that is greater than the actual size of the output. Returning an estimate that is lesser than the actual size of the output will result in underflow exceptions. - Parameters:
- inLen- the length of the input.
- Returns:
- the space required to accommodate a call to processBytes(byte[], int, int, byte[], int)with an input of sizeinLenbytes.
 
- 
estimateFinalOutputSizeint estimateFinalOutputSize()Return the size of the output buffer required for a call todoFinal(byte[], int).Note this method is allowed to return an estimation of the output size that is greater than the actual size of the output. Returning an estimate that is lesser than the actual size of the output will result in underflow exceptions. - Returns:
- the space required to accomodate a call to doFinal(byte[], int)
 
- 
isCompleteboolean isComplete()For decrypt and parsing flows returnstruewhen this has handled as many bytes as it can. This usually means that it has reached the end of an object, file, or other delimited stream.
 
-