EC Public Key
author | Jim Wigginton terrafrost@php.net |
---|---|
package | Default |
__construct()
__toString(): string
string
addFileFormat(string $fullname): boolean
The plugin needs to either already be loaded or be auto-loadable. Loading a plugin whose shortname overwrite an existing shortname will overwrite the old plugin.
see | \phpseclib3\Crypt\Common\AsymmetricKey::load() |
---|
string
boolean
bits2int(string $in): \phpseclib3\Math\BigInteger
bits2octets(string $in): string
string
string
computek(string $h1): string
string
string
createKey(string $curve): \phpseclib3\Crypt\EC\PrivateKey
getComment(): null|string
Not all key formats support comments. If you want to set a comment use toString()
null|string
getContext()
getCurve(): string|array
Returns a string if it's a named curve, an array if not
string|array
getEncodedCoordinates(): string
Used by ECDH
string
getEngine(): string
see | self::useInternalEngine()self::useBestEngine() |
---|---|
string
getFingerprint(string $algorithm = 'md5'): mixed
The public key's fingerprint is returned, which is equivalent to running ssh-keygen -lf rsa.pub
. If there is
no public key currently loaded, false is returned.
Example output (md5): "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" (as specified by RFC 4716)
string
The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned for invalid values.
mixed
getHash()
getLength(): integer
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"
integer
getLoadedFormat(): mixed
If the key that was loaded wasn't in a valid or if the key was auto-generated with RSA::createKey() then this will throw an exception.
see | \phpseclib3\Crypt\Common\AsymmetricKey::load() |
---|---|
mixed
getParameters(string $type = 'PKCS1'): mixed
see | self::getPublicKey() |
---|
string
optional
mixed
getSignatureFormat()
getSupportedKeyFormats(): array
array
initialize_static_variables()
int2octets(\phpseclib3\Math\BigInteger $v): string
load(string $key,string $password = false): \phpseclib3\Crypt\Common\AsymmetricKey
loadFormat(string $type,string $key,string $password = false): static
string
string
string
optional
static
loadParameters(string|array $key): \phpseclib3\Crypt\Common\AsymmetricKey
loadParametersFormat(string $type,string|array $key): \phpseclib3\Crypt\Common\AsymmetricKey
loadPlugins(string $format)
string
loadPrivateKey(string|array $key,string $password = ''): \phpseclib3\Crypt\Common\PrivateKey
loadPrivateKeyFormat(string $type,string $key,string $password = false): \phpseclib3\Crypt\Common\PrivateKey
string
string
string
optional
\phpseclib3\Crypt\Common\PrivateKey
loadPublicKey(string|array $key): \phpseclib3\Crypt\Common\PublicKey
loadPublicKeyFormat(string $type,string $key): \phpseclib3\Crypt\Common\PublicKey
onLoad(array $components): boolean
array
boolean
toString(string $type,array $options = array()): string
string
array
string
useBestEngine()
useInternalEngine()
validatePlugin(string $format,string $type,string $method = null): mixed
string
string
string
optional
mixed
verify(string $message,string $signature): mixed
see | \phpseclib3\Crypt\EC\PublicKey::verify() |
---|
string
string
mixed
withContext(string $context = null)
Used by Ed25519 / Ed448.
see | self::sign()self::verify() |
---|---|
string
optional
withHash(string $hash)
string
withSignatureFormat(string $format)
Valid values are: ASN1, SSH2, Raw
string
ALGORITHM
var |
---|
QA :array<mixed,object>
var |
---|
array<mixed,object>
curve :\phpseclib3\Crypt\EC\BaseCurves\Base
format :string
var |
---|
string
shortFormat :string
var |
---|
string
curveName :string
var |
---|
string
q :\phpseclib3\Math\BigInteger
x :\phpseclib3\Math\BigInteger
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.
var |
---|
\phpseclib3\Math\BigInteger
context :string
var |
---|
string
sigFormat :string
var |
---|
string
zero :\phpseclib3\Math\BigInteger
one :\phpseclib3\Math\BigInteger
plugins :array
see | |
---|---|
var |
array
invisiblePlugins :array
see | |
---|---|
var |
array
engines :array<mixed,boolean>
var |
---|
array<mixed,boolean>
Key Comment
Type(s)
null|string