KeyPair
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- generate() : array<string|int, mixed>
- sign() : string
- verify() : bool
- createHandler() : void
- encodeECPrivateKey() : string
- encodeECPublicKey() : string
- getString() : string
- Makes sure the data is a string
- initializeHandler() : void
Properties
$handler
private
mixed
$handler
$type
private
mixed
$type
Methods
__construct()
public
__construct([string $type = 'rsa' ][, string|null $pem = null ]) : mixed
Parameters
- $type : string = 'rsa'
- $pem : string|null = null
generate()
public
generate([int $bits = 2048 ]) : array<string|int, mixed>
APIYes
Parameters
- $bits : int = 2048
Return values
array<string|int, mixed>sign()
public
sign(mixed $rawData[, string $encoding = 'base64' ]) : string
Parameters
- $rawData : mixed
- $encoding : string = 'base64'
Return values
stringverify()
public
verify(string $data, string $signature[, string $encoding = 'base64' ]) : bool
APIYes
Parameters
- $data : string
- $signature : string
- $encoding : string = 'base64'
Return values
boolcreateHandler()
private
createHandler(string $prv[, string $pub = '' ]) : void
Parameters
- $prv : string
- $pub : string = ''
encodeECPrivateKey()
private
encodeECPrivateKey(string $key, string $pubKey) : string
Parameters
- $key : string
- $pubKey : string
Return values
stringencodeECPublicKey()
private
encodeECPublicKey(string $key) : string
Parameters
- $key : string
Return values
stringgetString()
Makes sure the data is a string
private
getString(mixed $data) : string
Parameters
- $data : mixed
Tags
Return values
stringinitializeHandler()
private
initializeHandler(string $pem) : void
Parameters
- $pem : string