Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography Library 1.84
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.bouncycastle.asn1.x9
Class X9IntegerConverter

    java.lang.Object
      org.bouncycastle.asn1.x9.X9IntegerConverter

public class X9IntegerConverter
extends java.lang.Object

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
`X9IntegerConverter()`

Method Summary
`int` | `getByteLength(ECCurve c)` Return the curve's field size in bytes.
`int` | `getByteLength(ECFieldElement fe)` Return the field element's field size in bytes.
`byte[]` | `integerToBytes(java.math.BigInteger s, int qLength)` Convert an integer to a byte array, ensuring it is exactly qLength long.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### X9IntegerConverter

    public X9IntegerConverter()

Method Detail

### getByteLength

    public int getByteLength(ECCurve c)

  Return the curve's field size in bytes.

  Parameters:
    `c` - the curve of interest.
  Returns:
    the field size in bytes (rounded up).

### getByteLength

    public int getByteLength(ECFieldElement fe)

  Return the field element's field size in bytes.

  Parameters:
    `fe` - the field element of interest.
  Returns:
    the field size in bytes (rounded up).

### integerToBytes

    public byte[] integerToBytes(java.math.BigInteger s,
                                 int qLength)

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

  Parameters:
    `s` - the integer to be converted.
    `qLength` - the length
  Returns:
    the resulting byte array.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography Library 1.84
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD