FileDocCategorySizeDatePackage
X9FieldElement.javaAPI DocAzureus 3.0.3.41604Mon Mar 20 04:56:46 GMT 2006org.bouncycastle.asn1.x9

X9FieldElement

public class X9FieldElement extends Object implements org.bouncycastle.asn1.DEREncodable
class for processing an FieldElement as a DER object.

Fields Summary
private org.bouncycastle.math.ec.ECFieldElement
f
Constructors Summary
public X9FieldElement(org.bouncycastle.math.ec.ECFieldElement f)

        this.f = f;
    
public X9FieldElement(boolean fP, BigInteger q, org.bouncycastle.asn1.ASN1OctetString s)

        if (fP)
        {
            this.f = new ECFieldElement.Fp(q, new BigInteger(1, s.getOctets()));
        }
        else
        {
            throw new RuntimeException("not implemented");
        }
    
Methods Summary
public org.bouncycastle.asn1.DERObjectgetDERObject()
Produce an object suitable for an ASN1OutputStream.
FieldElement ::= OCTET STRING

  1. if q is an odd prime then the field element is processed as an Integer and converted to an octet string according to x 9.62 4.3.1.
  2. if q is 2m then the bit string contained in the field element is converted into an octet string with the same ordering padded at the front if necessary.

        return new DEROctetString(f.toBigInteger().toByteArray());
    
public org.bouncycastle.math.ec.ECFieldElementgetValue()

        return f;