All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bouncycastle.asn1.x9.X9ECPoint Maven / Gradle / Ivy

The newest version!
package com.bouncycastle.asn1.x9;

import com.bouncycastle.asn1.ASN1Encodable;
import com.bouncycastle.asn1.ASN1OctetString;
import com.bouncycastle.asn1.DERObject;
import com.bouncycastle.asn1.DEROctetString;
import com.bouncycastle.math.ec.ECCurve;
import com.bouncycastle.math.ec.ECPoint;

/**
 * class for describing an ECPoint as a DER object.
 */
public class X9ECPoint
    extends ASN1Encodable
{
    ECPoint p;

    public X9ECPoint(
        ECPoint p)
    {
        this.p = p;
    }

    public X9ECPoint(
        ECCurve c,
        ASN1OctetString s)
    {
        this.p = c.decodePoint(s.getOctets());
    }

    public ECPoint getPoint()
    {
        return p;
    }

    /**
     * Produce an object suitable for an ASN1OutputStream.
     * 
     *  ECPoint ::= OCTET STRING
     * 
*

* Octet string produced using ECPoint.getEncoded(). */ public DERObject toASN1Object() { return new DEROctetString(p.getEncoded()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy