Top Description Constructors Methods
org.bouncycastle.asn1.x9

public Class X9IntegerConverter

extends Object
Class Inheritance
Imports
java.math.BigInteger, org.bouncycastle.math.ec.ECCurve, .ECFieldElement

A class which converts integers to byte arrays, allowing padding and calculations to be done according the the filed size of the curve or field element involved.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the field size in bytes (rounded up).
getByteLength
(ECCurve
the curve of interest.
c
)

Return the curve's field size in bytes.

public int

Returns:

the field size in bytes (rounded up).
getByteLength
(ECFieldElement
the field element of interest.
fe
)

Return the field element's field size in bytes.

public byte[]

Returns:

the resulting byte array.
integerToBytes
(BigInteger
the integer to be converted.
s
,
int
the length
qLength
)

Convert an integer to a byte array, ensuring it is exactly qLength long.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

X9IntegerConverterback to summary
public X9IntegerConverter()

Method Detail

getByteLengthback to summary
public int getByteLength(ECCurve c)

Return the curve's field size in bytes.

Parameters
c:ECCurve

the curve of interest.

Returns:int

the field size in bytes (rounded up).

getByteLengthback to summary
public int getByteLength(ECFieldElement fe)

Return the field element's field size in bytes.

Parameters
fe:ECFieldElement

the field element of interest.

Returns:int

the field size in bytes (rounded up).

integerToBytesback to summary
public byte[] integerToBytes(BigInteger s, int qLength)

Convert an integer to a byte array, ensuring it is exactly qLength long.

Parameters
s:BigInteger

the integer to be converted.

qLength:int

the length

Returns:byte[]

the resulting byte array.