Documentation

XML
in package
uses Common

AbstractYes

XML Formatted EC Key Handler

Tags
author

Jim Wigginton terrafrost@php.net

access

public

Table of Contents

Properties

$childOIDsLoaded  : bool
Child OIDs loaded
$curveOIDs  : array<string|int, mixed>
Curve OIDs
$namespace  : string
Default namespace
$rfc4050  : bool
Flag for using RFC4050 syntax
$useNamedCurves  : bool
Use Named Curves

Methods

disableRFC4050Syntax()  : mixed
Uses the XML syntax specified in https://www.w3.org/TR/xmldsig-core/#sec-ECParameters
enableRFC4050Syntax()  : mixed
Uses the XML syntax specified in https://tools.ietf.org/html/rfc4050
extractPoint()  : array<string|int, object>
Extract points from a string
load()  : array<string|int, mixed>
Break a public or private key down into its constituent components
savePublicKey()  : string
Convert a public key to the appropriate format
setImplicitCurve()  : mixed
Explicitly set the curve
setNamespace()  : mixed
Sets the namespace. dsig11 is the most common one.
useNamedCurve()  : mixed
Use Named Curve
useSpecifiedCurve()  : mixed
Use Specified Curve
decodeValue()  : mixed
Decodes the value
encodeParameters()  : string|false
Encode Parameters
encodeXMLParameters()  : string|false
Encode Parameters
extractPointRFC4050()  : array<string|int, object>
Extract points from an XML document
initialize_static_variables()  : mixed
Initialize static variables
isolateNamespace()  : mixed
Finds the first element in the relevant namespace, strips the namespacing and returns the XML for that element.
loadCurveByParam()  : Base|false
Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based on the curve parameters
loadCurveByParamRFC4050()  : Base|false
Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based on the curve parameters
query()  : DOMNodeList
Case-insensitive xpath query

Properties

$childOIDsLoaded

Child OIDs loaded

protected static bool $childOIDsLoaded = false

$curveOIDs

Curve OIDs

private static array<string|int, mixed> $curveOIDs = []

$namespace

Default namespace

private static string $namespace

$rfc4050

Flag for using RFC4050 syntax

private static bool $rfc4050 = false

$useNamedCurves

Use Named Curves

private static bool $useNamedCurves = true

Methods

disableRFC4050Syntax()

Uses the XML syntax specified in https://www.w3.org/TR/xmldsig-core/#sec-ECParameters

public static disableRFC4050Syntax() : mixed

enableRFC4050Syntax()

Uses the XML syntax specified in https://tools.ietf.org/html/rfc4050

public static enableRFC4050Syntax() : mixed

extractPoint()

Extract points from a string

public static extractPoint(string $str, Base $curve) : array<string|int, object>

Supports both compressed and uncompressed points

Parameters
$str : string
$curve : Base
Return values
array<string|int, object>

load()

Break a public or private key down into its constituent components

public static load(string $key[, string $password = '' ]) : array<string|int, mixed>
Parameters
$key : string
$password : string = ''

optional

Tags
access

public

Return values
array<string|int, mixed>

savePublicKey()

Convert a public key to the appropriate format

public static savePublicKey(Base $curve, array<string|int, Integer$publicKey[, array<string|int, mixed> $options = [] ]) : string
Parameters
$curve : Base
$publicKey : array<string|int, Integer>
$options : array<string|int, mixed> = []

optional

Return values
string

setImplicitCurve()

Explicitly set the curve

public static setImplicitCurve(Base $curve) : mixed

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

Parameters
$curve : Base

setNamespace()

Sets the namespace. dsig11 is the most common one.

public static setNamespace(string $namespace) : mixed

Set to null to unset. Used only for creating public keys.

Parameters
$namespace : string

useNamedCurve()

Use Named Curve

public static useNamedCurve() : mixed

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

useSpecifiedCurve()

Use Specified Curve

public static useSpecifiedCurve() : mixed

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

decodeValue()

Decodes the value

private static decodeValue(string $value) : mixed
Parameters
$value : string

encodeParameters()

Encode Parameters

private static encodeParameters(Base $curve[, bool $returnArray = false ][, array<string|int, mixed> $options = [] ]) : string|false
Parameters
$curve : Base
$returnArray : bool = false

optional

$options : array<string|int, mixed> = []

optional

Tags
todo

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

Return values
string|false

encodeXMLParameters()

Encode Parameters

private static encodeXMLParameters(Base $curve, string $pre[, array<string|int, mixed> $options = [] ]) : string|false
Parameters
$curve : Base
$pre : string
$options : array<string|int, mixed> = []

optional

Return values
string|false

extractPointRFC4050()

Extract points from an XML document

private static extractPointRFC4050(DOMXPath $xpath, Base $curve) : array<string|int, object>
Parameters
$xpath : DOMXPath
$curve : Base
Return values
array<string|int, object>

initialize_static_variables()

Initialize static variables

private static initialize_static_variables() : mixed

isolateNamespace()

Finds the first element in the relevant namespace, strips the namespacing and returns the XML for that element.

private static isolateNamespace(string $xml, string $ns) : mixed
Parameters
$xml : string
$ns : string

loadCurveByParam()

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

private static loadCurveByParam(DomXPath $xpath) : Base|false
Parameters
$xpath : DomXPath
Return values
Base|false

loadCurveByParamRFC4050()

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

private static loadCurveByParamRFC4050(DomXPath $xpath) : Base|false
Parameters
$xpath : DomXPath
Return values
Base|false

query()

Case-insensitive xpath query

private static query(DOMXPath $xpath, string $name[, string $error = null ][, bool $decode = true ]) : DOMNodeList
Parameters
$xpath : DOMXPath
$name : string
$error : string = null

optional

$decode : bool = true

optional

Return values
DOMNodeList

        
On this page

Search results