JWK

Extends\phpseclib3\Crypt\Common\Formats\Keys\JWK

JWK Formatted EC Handler

author

Jim Wigginton terrafrost@php.net

package

Default

Methods

Encode Parameters

encodeParameters(\phpseclib3\Crypt\EC\BaseCurves\Base $curve,boolean $returnArray = false,array $options = array()): string|false
inheritedstatic
todo

Maybe at some point this could be moved to __toString() for each of the curves?

Arguments

$returnArray

boolean

optional

$options

array

optional

Response

string|false

Extract points from a string

extractPoint(string $str,\phpseclib3\Crypt\EC\BaseCurves\Base $curve): array<mixed,object>
inheritedstatic

Supports both compressed and uncompressed points

Arguments

$str

string

Response

array<mixed,object>

Returns the alias that corresponds to a curve

getAlias(\phpseclib3\Crypt\EC\BaseCurves\Base $curve): string
static

Arguments

Response

string

Initialize static variables

initialize_static_variables()
inheritedstatic

Break a public or private key down into its constituent components

load(string $key,string $password = ''): array
static

Arguments

$key

string

$password

string

Response

array

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

loadCurveByParam(array $params): \phpseclib3\Crypt\EC\BaseCurves\Base|false
inheritedstatic

Arguments

$params

array

Response

\phpseclib3\Crypt\EC\BaseCurves\Base|false

Convert a private key to the appropriate format.

savePrivateKey(\phpseclib3\Math\BigInteger $privateKey,\phpseclib3\Crypt\EC\Curves\Ed25519 $curve,array<mixed,\phpseclib3\Math\Common\FiniteField\Integer> $publicKey,string $secret = null,string $password = '',array $options = array()): string
static

Arguments

$secret

string

optional

$password

string

optional

$options

array

optional

Response

string

Convert an EC public key to the appropriate format

savePublicKey(\phpseclib3\Crypt\EC\BaseCurves\Base $curve,array<mixed,\phpseclib3\Math\Common\FiniteField\Integer> $publicKey,array $options = array()): string
static

Arguments

$options

array

optional

Response

string

Return the array superstructure for an EC public key

savePublicKeyHelper(\phpseclib3\Crypt\EC\BaseCurves\Base $curve,array<mixed,\phpseclib3\Math\Common\FiniteField\Integer> $publicKey): array
static

Arguments

Response

array

Explicitly set the curve

setImplicitCurve(\phpseclib3\Crypt\EC\BaseCurves\Base $curve)
inheritedstatic

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

Arguments

Use Named Curve

useNamedCurve()
inheritedstatic

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

Use Specified Curve

useSpecifiedCurve()
inheritedstatic

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

Wrap a key appropriately

wrapKey(array $key,array $options): string
static

Arguments

$key

array

$options

array

Response

string

Properties

Curve OIDs

curveOIDs :array
inheritedstatic
var

Type(s)

array

Child OIDs loaded

childOIDsLoaded :boolean
inheritedstatic
var

Type(s)

boolean

Use Named Curves

useNamedCurves :boolean
inheritedstatic
var

Type(s)

boolean