Methods
The constructor
__construct()
inherited
__toString() magic method
__toString(): string
inherited
Bit String to Integer
bits2int(string $in): \phpseclib3\Math\BigInteger
inherited
Bit String to Octet String
bits2octets(string $in): string
inherited
Arguments
Response
string
Compute the pseudorandom k for signature generation,
using the process specified for deterministic DSA.
computek(string $h1): string
inherited
Arguments
Response
string
Create public / private key pair.
createKey(string $curve): \phpseclib3\Crypt\EC\PrivateKey
inheritedstatic
Returns the signature format currently being used
getContext()
inherited
Returns the curve
getCurve(): string|array
inherited
Returns a string if it's a named curve, an array if not
Response
string|array
Returns the public key coordinates as a string
getEncodedCoordinates(): string
inherited
Returns the current engine being used
getEngine(): string
inherited
see
|
self::useInternalEngine()self::useBestEngine() |
|
|
Response
string
Returns the hash algorithm currently being used
getHash()
inherited
Returns the key size
getLength(): integer
inherited
Quoting https://tools.ietf.org/html/rfc5656#section-2,
"The size of a set of elliptic curve domain parameters on a prime
curve is defined as the number of bits in the binary representation
of the field order, commonly denoted by p. Size on a
characteristic-2 curve is defined as the number of bits in the binary
representation of the field, commonly denoted by m. A set of
elliptic curve domain parameters defines a group of order n generated
by a base point P"
Response
integer
Returns the parameters
getParameters(string $type = 'PKCS1'): mixed
inherited
Returns the public key
getPublicKey(): mixed
see
|
self::getPrivateKey() |
|
|
Response
mixed
Initialize static variables
initialize_static_variables()
inheritedstatic
Integer to Octet String
int2octets(\phpseclib3\Math\BigInteger $v): string
inherited
Arguments
Response
string
Load the key
load(string $key,string $password = false): \phpseclib3\Crypt\Common\AsymmetricKey
inheritedstatic
Loads parameters
loadParameters(string|array $key): \phpseclib3\Crypt\Common\AsymmetricKey
inheritedstatic
Load Plugins
loadPlugins(string $format)
inheritedstatic
Loads a private key
loadPrivateKey(string|array $key,string $password = ''): \phpseclib3\Crypt\Common\PrivateKey
inheritedstatic
Loads a public key
loadPublicKey(string|array $key): \phpseclib3\Crypt\Common\PublicKey
inheritedstatic
Multiplies an encoded point by the private key
multiply(string $coordinates): string
Arguments
Response
string
OnLoad Handler
onLoad(array $components): boolean
inheritedstatic
Arguments
Response
boolean
Create a signature
sign(string $message): mixed
toString
toString(string $type,array $options = array()): string
inheritedabstract
Arguments
Response
string
Tests engine validity
useBestEngine()
inheritedstatic
Flag to use internal engine only (useful for unit testing)
useInternalEngine()
inheritedstatic
Validate Plugin
validatePlugin(string $format,string $type,string $method = null): mixed
inheritedstatic
Sets the context
withContext(string $context = null)
inherited
see
|
self::sign()self::verify() |
|
|
Arguments
Determines which hashing function should be used
withHash(string $hash)
inherited
Sets the password
withPassword(string|boolean $password = false)
inherited
Private keys can be encrypted with a password. To unset the password, pass in the empty string or false.
Or rather, pass in $password such that empty($password) && !is_string($password) is true.
see
|
self::createKey()self::load() |
|
|
Arguments
Constants
Algorithm Name
ALGORITHM
inherited
Properties
Private Key dA
dA :object
sign() converts this to a BigInteger so one might wonder why this is a FiniteFieldInteger instead of
a BigInteger. That's because a FiniteFieldInteger, when converted to a byte string, is null padded by
a certain amount whereas a BigInteger isn't.
Type(s)
object
Password
password :string|boolean
inherited
Public Key QA
QA :array<mixed,object>
inherited
Type(s)
array<mixed,object>
Curve
curve :\phpseclib3\Crypt\EC\BaseCurves\Base
inherited
Curve Name
curveName :string
inherited
Curve Order
q :\phpseclib3\Math\BigInteger
inherited
Alias for the private key
x :\phpseclib3\Math\BigInteger
inherited
Used for deterministic ECDSA. AsymmetricKey expects $x. I don't like x because
with x you have x the base point yielding an (x, y)-coordinate that is the
public key. But the x is different depending on which side of the equal sign
you're on. It's less ambiguous if you do dA base point = (x, y)-coordinate.
Type(s)
\phpseclib3\Math\BigInteger
Context
context :string
inherited
Precomputed Zero
zero :\phpseclib3\Math\BigInteger
inheritedstatic
Precomputed One
one :\phpseclib3\Math\BigInteger
inheritedstatic
Hash function
hash :\phpseclib3\Crypt\Hash
inherited
HMAC function
hmac :\phpseclib3\Crypt\Hash
inherited
Supported plugins (lower case)
plugins :array
inheritedstatic
Invisible plugins
invisiblePlugins :array
inheritedstatic
Available Engines
engines :array<mixed,boolean>
inheritedstatic
Type(s)
array<mixed,boolean>
Key Comment
Type(s)
null|string