Sign class
Framework\Crypto\Sign
Class Sign.
Defined in libraries/crypto/src/Sign.php
Methods #
- makeKeyPair()
- Makes a keypair.
- makePublicKey()
- Makes the public key from a keypair.
- makeSecretKey()
- Makes the secret key from a keypair.
- signature()
- Gets the digital signature (detached) from a message with a secret key.
- verify()
- Verifies if a message has a valid signature.
makeKeyPair()
public static function makeKeyPair(): string
Makes a keypair.
Returns
string
makePublicKey()
public static function makePublicKey(string $keyPair): string
Makes the public key from a keypair.
Parameters
- string $keyPair
Returns
string
makeSecretKey()
public static function makeSecretKey(string $keyPair): string
Makes the secret key from a keypair.
Parameters
- string $keyPair
Returns
string
signature()
public static function signature(string $message, string $secretKey): string
Gets the digital signature (detached) from a message with a secret key.
Parameters
- string $message
- string $secretKey
Returns
string
verify()
public static function verify(string $message, string $signature, string $publicKey): bool
Verifies if a message has a valid signature.
Parameters
- string $message
- string $signature
- string $publicKey
Returns
bool