trait Common (View source)

Generic EC Key Parsing Helper functions

Properties

static protected bool $childOIDsLoaded Child OIDs loaded

Methods

static 
setImplicitCurve(Base $curve)

Explicitly set the curve

static Base|false
loadCurveByParam(array $params)

Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based on the curve parameters

static object[]
extractPoint(string $str, Base $curve)

Extract points from a string

static 
useSpecifiedCurve()

Use Specified Curve

static 
useNamedCurve()

Use Named Curve

Details

static setImplicitCurve(Base $curve)

Explicitly set the curve

If the key contains an implicit curve phpseclib needs the curve to be explicitly provided

Parameters

Base $curve

static protected Base|false loadCurveByParam(array $params)

Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based on the curve parameters

Parameters

array $params

Return Value

Base|false

static object[] extractPoint(string $str, Base $curve)

Extract points from a string

Supports both compressed and uncompressed points

Parameters

string $str
Base $curve

Return Value

object[]

static useSpecifiedCurve()

Use Specified Curve

A specified curve has all the coefficients, the base points, etc, explicitely included. A specified curve is a more verbose way of representing a curve

static useNamedCurve()

Use Named Curve

A named curve does not include any parameters. It is up to the EC parameters to know what the coefficients, the base points, etc, are from the name of the curve. A named curve is a more concise way of representing a curve