Top Description Fields Constructors Methods
org.bouncycastle.tls.crypto.impl

public final Class TlsNullCipher

extends Object
implements TlsCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsCipher
Imports
java.io.IOException, org.bouncycastle.tls.AlertDescription, .ContentType, .ProtocolVersion, .SecurityParameters, .TlsFatalAlert, .TlsUtils, org.bouncycastle.tls.crypto.TlsCipher, .TlsCryptoParameters, .TlsDecodeResult, .TlsEncodeResult, .TlsHMAC

The NULL cipher.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final boolean
private final byte[]
private final boolean
private final TlsSuiteHMac
private final TlsSuiteHMac

Constructor Summary

AccessConstructor and Description
public
TlsNullCipher(TlsCryptoParameters cryptoParams, TlsHMAC clientMac, TlsHMAC serverMac)

Method Summary

Modifier and TypeMethod and Description
public TlsDecodeResult
decodeCiphertext(long
sequence number of the message represented by ciphertext.
seqNo
,
short
content type used in the record for this message.
recordType
,
ProtocolVersion
ProtocolVersion used for the record.
recordVersion
,
byte[]
array holding input ciphertext to the cipher.
ciphertext
,
int
offset into input array the ciphertext starts at.
offset
,
int
length of the ciphertext in the array.
len
)

Implements org.bouncycastle.tls.crypto.TlsCipher.decodeCiphertext.

Decode the passed in ciphertext using the current bulk cipher.
public TlsEncodeResult
encodePlaintext(long
sequence number of the message represented by plaintext.
seqNo
,
short
content type of the message represented by plaintext.
contentType
,
ProtocolVersion
ProtocolVersion used for the record.
recordVersion
,
int
extra bytes to allocate at start of returned byte array.
headerAllocation
,
byte[]
array holding input plaintext to the cipher.
plaintext
,
int
offset into input array the plaintext starts at.
offset
,
int
length of the plaintext in the array.
len
)

Implements org.bouncycastle.tls.crypto.TlsCipher.encodePlaintext.

Encode the passed in plaintext using the current bulk cipher.
public int
getCiphertextDecodeLimit(int
the maximum output size for the plaintext.
plaintextLimit
)

Implements org.bouncycastle.tls.crypto.TlsCipher.getCiphertextDecodeLimit.

Return the maximum input size for a ciphertext given a maximum output size for the plaintext of plaintextLimit bytes.
public int
getCiphertextEncodeLimit(int
the maximum input size for the plaintext.
plaintextLimit
)

Implements org.bouncycastle.tls.crypto.TlsCipher.getCiphertextEncodeLimit.

Return the maximum output size for a ciphertext given a maximum input size for the plaintext of plaintextLimit bytes.
public int
getPlaintextDecodeLimit(int
the maximum input size for the ciphertext.
ciphertextLimit
)

Implements org.bouncycastle.tls.crypto.TlsCipher.getPlaintextDecodeLimit.

Return the maximum output size for the plaintext given a maximum input size for the ciphertext of ciphertextLimit bytes.
public int
getPlaintextEncodeLimit(int
the maximum output size for the ciphertext.
ciphertextLimit
)

Implements org.bouncycastle.tls.crypto.TlsCipher.getPlaintextEncodeLimit.

Return the maximum input size for the plaintext given a maximum output size for the ciphertext of ciphertextLimit bytes.
public void
public void
public boolean
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

decryptConnectionIDback to summary
private final byte[] decryptConnectionID
decryptUseInnerPlaintextback to summary
private final boolean decryptUseInnerPlaintext
encryptConnectionIDback to summary
private final byte[] encryptConnectionID
encryptUseInnerPlaintextback to summary
private final boolean encryptUseInnerPlaintext
readMacback to summary
private final TlsSuiteHMac readMac
writeMacback to summary
private final TlsSuiteHMac writeMac

Constructor Detail

TlsNullCipherback to summary
public TlsNullCipher(TlsCryptoParameters cryptoParams, TlsHMAC clientMac, TlsHMAC serverMac) throws IOException

Method Detail

decodeCiphertextback to summary
public TlsDecodeResult decodeCiphertext(long seqNo, short recordType, ProtocolVersion recordVersion, byte[] ciphertext, int offset, int len) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCipher.decodeCiphertext.

Doc from org.bouncycastle.tls.crypto.TlsCipher.decodeCiphertext.

Decode the passed in ciphertext using the current bulk cipher.

Parameters
seqNo:long

sequence number of the message represented by ciphertext.

recordType:short

content type used in the record for this message.

recordVersion:ProtocolVersion

ProtocolVersion used for the record.

ciphertext:byte[]

array holding input ciphertext to the cipher.

offset:int

offset into input array the ciphertext starts at.

len:int

length of the ciphertext in the array.

Returns:TlsDecodeResult

A TlsDecodeResult containing the result of decoding.

encodePlaintextback to summary
public TlsEncodeResult encodePlaintext(long seqNo, short contentType, ProtocolVersion recordVersion, int headerAllocation, byte[] plaintext, int offset, int len) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCipher.encodePlaintext.

Doc from org.bouncycastle.tls.crypto.TlsCipher.encodePlaintext.

Encode the passed in plaintext using the current bulk cipher.

Parameters
seqNo:long

sequence number of the message represented by plaintext.

contentType:short

content type of the message represented by plaintext.

recordVersion:ProtocolVersion

ProtocolVersion used for the record.

headerAllocation:int

extra bytes to allocate at start of returned byte array.

plaintext:byte[]

array holding input plaintext to the cipher.

offset:int

offset into input array the plaintext starts at.

len:int

length of the plaintext in the array.

Returns:TlsEncodeResult

A TlsEncodeResult containing the result of encoding (after 'headerAllocation' unused bytes).

getCiphertextDecodeLimitback to summary
public int getCiphertextDecodeLimit(int plaintextLimit)

Implements org.bouncycastle.tls.crypto.TlsCipher.getCiphertextDecodeLimit.

Doc from org.bouncycastle.tls.crypto.TlsCipher.getCiphertextDecodeLimit.

Return the maximum input size for a ciphertext given a maximum output size for the plaintext of plaintextLimit bytes.

Parameters
plaintextLimit:int

the maximum output size for the plaintext.

Returns:int

the maximum input size of the ciphertext for plaintextLimit bytes of output.

getCiphertextEncodeLimitback to summary
public int getCiphertextEncodeLimit(int plaintextLimit)

Implements org.bouncycastle.tls.crypto.TlsCipher.getCiphertextEncodeLimit.

Doc from org.bouncycastle.tls.crypto.TlsCipher.getCiphertextEncodeLimit.

Return the maximum output size for a ciphertext given a maximum input size for the plaintext of plaintextLimit bytes.

Parameters
plaintextLimit:int

the maximum input size for the plaintext.

Returns:int

the maximum output size of the ciphertext for plaintextLimit bytes of input.

getPlaintextDecodeLimitback to summary
public int getPlaintextDecodeLimit(int ciphertextLimit)

Implements org.bouncycastle.tls.crypto.TlsCipher.getPlaintextDecodeLimit.

Doc from org.bouncycastle.tls.crypto.TlsCipher.getPlaintextDecodeLimit.

Return the maximum output size for the plaintext given a maximum input size for the ciphertext of ciphertextLimit bytes.

Parameters
ciphertextLimit:int

the maximum input size for the ciphertext.

Returns:int

the maximum output size of the plaintext for ciphertextLimit bytes of input.

getPlaintextEncodeLimitback to summary
public int getPlaintextEncodeLimit(int ciphertextLimit)

Implements org.bouncycastle.tls.crypto.TlsCipher.getPlaintextEncodeLimit.

Doc from org.bouncycastle.tls.crypto.TlsCipher.getPlaintextEncodeLimit.

Return the maximum input size for the plaintext given a maximum output size for the ciphertext of ciphertextLimit bytes.

Parameters
ciphertextLimit:int

the maximum output size for the ciphertext.

Returns:int

the maximum input size of the plaintext for ciphertextLimit bytes of output.

rekeyDecoderback to summary
public void rekeyDecoder() throws IOException

Implements org.bouncycastle.tls.crypto.TlsCipher.rekeyDecoder.

rekeyEncoderback to summary
public void rekeyEncoder() throws IOException

Implements org.bouncycastle.tls.crypto.TlsCipher.rekeyEncoder.

usesOpaqueRecordTypeDecodeback to summary
public boolean usesOpaqueRecordTypeDecode()

Implements org.bouncycastle.tls.crypto.TlsCipher.usesOpaqueRecordTypeDecode.

usesOpaqueRecordTypeEncodeback to summary
public boolean usesOpaqueRecordTypeEncode()

Implements org.bouncycastle.tls.crypto.TlsCipher.usesOpaqueRecordTypeEncode.