Top Inners Fields Constructors Methods
org.apache.sshd.common.cipher

public Class BaseGCMCipher

extends BaseCipher
Class Inheritance
Imports
javax.crypto.Cipher, .SecretKey, javax.crypto.spec.GCMParameterSpec, .SecretKeySpec, org.apache.sshd.common.util.buffer.BufferUtils, org.apache.sshd.common.util.security.SecurityUtils

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
BaseGCMCipher.CounterGCMParameterSpec

Algorithm parameters for AES/GCM that assumes the IV uses an 8-byte counter field as its least significant bytes.

Field Summary

Modifier and TypeField and Description
protected boolean
protected Cipher.Mode
protected BaseGCMCipher.CounterGCMParameterSpec
protected SecretKey
Inherited from org.apache.sshd.common.cipher.BaseCipher:
alwaysReInitfactory

Constructor Summary

AccessConstructor and Description
public
BaseGCMCipher(int ivsize, int authSize, int kdfSize, String algorithm, int keySize, String transformation, int blkSize)

Method Summary

Modifier and TypeMethod and Description
protected Cipher
protected Cipher
public void
update(byte[]
The input/output bytes
input
,
int
The offset of the data in the data buffer
inputOffset
,
int
The number of bytes to update, starting at the given offset; must be a multiple of the cipher's block size
inputLen
)

Overrides org.apache.sshd.common.cipher.BaseCipher.update.

Implements org.apache.sshd.common.cipher.Cipher.update.

Performs in-place encryption or decryption on the given data.

public void
updateAAD(byte[]
The additional data to authenticate
data
,
int
The offset of the additional data in the buffer
offset
,
int
The number of bytes in the buffer to use for authentication
length
)

Overrides org.apache.sshd.common.cipher.BaseCipher.updateAAD.

Implements org.apache.sshd.common.cipher.Cipher.updateAAD.

Adds the provided input data as additional authenticated data during encryption or decryption.

Inherited from org.apache.sshd.common.cipher.BaseCipher:
determineNewParametersgetAlgorithmgetAuthenticationTagSizegetCipherBlockSizegetCipherInstancegetIVSizegetKdfSizegetKeySizegetTransformationinitinitializeIVDatainitializeKeyDatareInitresizetoString

Field Detail

initializedback to summary
protected boolean initialized
modeback to summary
protected Cipher.Mode mode

Hides org.apache.sshd.common.cipher.BaseCipher.mode.

parametersback to summary
protected BaseGCMCipher.CounterGCMParameterSpec parameters
secretKeyback to summary
protected SecretKey secretKey

Hides org.apache.sshd.common.cipher.BaseCipher.secretKey.

Constructor Detail

BaseGCMCipherback to summary
public BaseGCMCipher(int ivsize, int authSize, int kdfSize, String algorithm, int keySize, String transformation, int blkSize)

Method Detail

createCipherInstanceback to summary
protected Cipher createCipherInstance(Cipher.Mode mode, byte[] key, byte[] iv) throws Exception

Overrides org.apache.sshd.common.cipher.BaseCipher.createCipherInstance.

Annotations
@Override
getInitializedCipherInstanceback to summary
protected Cipher getInitializedCipherInstance() throws Exception
updateback to summary
public void update(byte[] input, int inputOffset, int inputLen) throws Exception

Overrides org.apache.sshd.common.cipher.BaseCipher.update.

Implements org.apache.sshd.common.cipher.Cipher.update.

Doc from org.apache.sshd.common.cipher.Cipher.update.

Performs in-place encryption or decryption on the given data.

Parameters
input:byte[]

The input/output bytes

inputOffset:int

The offset of the data in the data buffer

inputLen:int

The number of bytes to update, starting at the given offset; must be a multiple of the cipher's block size

Annotations
@Override
Exceptions
Exception:
If failed to execute
updateAADback to summary
public void updateAAD(byte[] data, int offset, int length) throws Exception

Overrides org.apache.sshd.common.cipher.BaseCipher.updateAAD.

Implements org.apache.sshd.common.cipher.Cipher.updateAAD.

Doc from org.apache.sshd.common.cipher.Cipher.updateAAD.

Adds the provided input data as additional authenticated data during encryption or decryption.

Parameters
data:byte[]

The additional data to authenticate

offset:int

The offset of the additional data in the buffer

length:int

The number of bytes in the buffer to use for authentication

Annotations
@Override
Exceptions
Exception:
If failed to execute
org.apache.sshd.common.cipher back to summary

protected Class BaseGCMCipher.CounterGCMParameterSpec

extends GCMParameterSpec
Class Inheritance

Algorithm parameters for AES/GCM that assumes the IV uses an 8-byte counter field as its least significant bytes.

Field Summary

Modifier and TypeField and Description
protected final long
protected final byte[]

Constructor Summary

AccessConstructor and Description
protected
CounterGCMParameterSpec(int tLen, byte[] src)

Method Summary

Modifier and TypeMethod and Description
public byte[]
getIV()

Overrides javax.crypto.spec.GCMParameterSpec.getIV.

Returns the Initialization Vector (IV).

protected void
Inherited from javax.crypto.spec.GCMParameterSpec:
getTLen

Field Detail

initialCounterback to summary
protected final long initialCounter
ivback to summary
protected final byte[] iv

Hides javax.crypto.spec.GCMParameterSpec.iv.

Constructor Detail

CounterGCMParameterSpecback to summary
protected CounterGCMParameterSpec(int tLen, byte[] src)

Method Detail

getIVback to summary
public byte[] getIV()

Overrides javax.crypto.spec.GCMParameterSpec.getIV.

Doc from javax.crypto.spec.GCMParameterSpec.getIV.

Returns the Initialization Vector (IV).

Returns:byte[]

the IV. Creates a new array each time this method is called.

Annotations
@Override
incrementCounterback to summary
protected void incrementCounter()