Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.util

public final Class ByteMacData

extends Object
Class Inheritance
Imports
org.bouncycastle.asn1.DERTaggedObject, org.bouncycastle.util.Arrays, .Strings

Builder and holder class for preparing SP 800-56A/56B compliant MacData. Elements in the data are copied in directly as byte arrays,

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ByteMacData.Builder

Builder to create OtherInfo

public static enum
ByteMacData.Type

Standard type strings for the headers of KAS/KTS MAC calculations.

Field Summary

Modifier and TypeField and Description
private final byte[]

Constructor Summary

AccessConstructor and Description
private
ByteMacData(byte[] macData)

Method Summary

Modifier and TypeMethod and Description
public byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

macDataback to summary
private final byte[] macData

Constructor Detail

ByteMacDataback to summary
private ByteMacData(byte[] macData)

Method Detail

getMacDataback to summary
public byte[] getMacData()
org.bouncycastle.crypto.util back to summary

public final Class ByteMacData.Builder

extends Object
Class Inheritance

Builder to create OtherInfo

Field Summary

Modifier and TypeField and Description
private byte[]
private byte[]
private byte[]
private byte[]
private byte[]
private final ByteMacData.Type

Constructor Summary

AccessConstructor and Description
public
Builder(ByteMacData.Type
the MAC header
type
,
byte[]
sender party ID.
idU
,
byte[]
receiver party ID.
idV
,
byte[]
ephemeral data from sender.
ephemDataU
,
byte[]
ephemeral data from receiver.
ephemDataV
)

Create a basic builder with just the compulsory fields.

Method Summary

Modifier and TypeMethod and Description
public ByteMacData
private byte[]
concatenate(byte[] header, byte[] id1, byte[] id2, byte[] ed1, byte[] ed2, byte[] text)

public ByteMacData.Builder

Returns:

the current builder instance.
withText
(byte[]
optional agreed text to add to the MAC.
text
)

Add optional text.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ephemDataUback to summary
private byte[] ephemDataU
ephemDataVback to summary
private byte[] ephemDataV
idUback to summary
private byte[] idU
idVback to summary
private byte[] idV
textback to summary
private byte[] text
typeback to summary
private final ByteMacData.Type type

Constructor Detail

Builderback to summary
public Builder(ByteMacData.Type type, byte[] idU, byte[] idV, byte[] ephemDataU, byte[] ephemDataV)

Create a basic builder with just the compulsory fields.

Parameters
type:ByteMacData.Type

the MAC header

idU:byte[]

sender party ID.

idV:byte[]

receiver party ID.

ephemDataU:byte[]

ephemeral data from sender.

ephemDataV:byte[]

ephemeral data from receiver.

Method Detail

buildback to summary
public ByteMacData build()
concatenateback to summary
private byte[] concatenate(byte[] header, byte[] id1, byte[] id2, byte[] ed1, byte[] ed2, byte[] text)
withTextback to summary
public ByteMacData.Builder withText(byte[] text)

Add optional text.

Parameters
text:byte[]

optional agreed text to add to the MAC.

Returns:ByteMacData.Builder

the current builder instance.

org.bouncycastle.crypto.util back to summary

public final Enum ByteMacData.Type

extends Enum<ByteMacData.Type>
Class Inheritance

Standard type strings for the headers of KAS/KTS MAC calculations.

Field Summary

Modifier and TypeField and Description
public static final ByteMacData.Type
public static final ByteMacData.Type
private final String
public static final ByteMacData.Type
public static final ByteMacData.Type

Constructor Summary

AccessConstructor and Description
private
Type(String enc)

Method Summary

Modifier and TypeMethod and Description
public byte[]
public static ByteMacData.Type
public static ByteMacData.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BILATERALUback to summary
public static final ByteMacData.Type BILATERALU
BILATERALVback to summary
public static final ByteMacData.Type BILATERALV
encback to summary
private final String enc
UNILATERALUback to summary
public static final ByteMacData.Type UNILATERALU
UNILATERALVback to summary
public static final ByteMacData.Type UNILATERALV

Constructor Detail

Typeback to summary
private Type(String enc)

Method Detail

getHeaderback to summary
public byte[] getHeader()
valueOfback to summary
public static ByteMacData.Type valueOf(String name)
valuesback to summary
public static ByteMacData.Type[] values()