PHP Class Bitpay\PrivateKey

See also: https://en.bitcoin.it/wiki/List_of_address_prefixes
Inheritance: extends bitpay\Key
Afficher le fichier Open project: bitpay/php-client Class Usage Examples

Méthodes publiques

Свойство Type Description
$pemDecoded array
$pemEncoded string

Protected Properties

Свойство Type Description
$publicKey PublicKey

Méthodes publiques

Méthode Description
__toString ( ) : string
generate ( ) : PrivateKey Generates an EC private key
getPublicKey ( ) : PublicKey
hasValidDec ( ) : boolean
hasValidHex ( ) : boolean
isValid ( ) : boolean Checks to see if the private key value is not empty and the hex form only contains hexits and the decimal form only contains devimal digits.
pemDecode ( string $pem_data ) : array Decodes PEM data to retrieve the keypair.
pemEncode ( array $keypair ) : string Encodes keypair data to PEM format.
serializeSig ( $r, $s ) : string ASN.1 DER encodes the signature based on the form: 0x30 + size(all) + 0x02 + size(r) + r + 0x02 + size(s) + s http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf
setHex ( $hex ) * Use this method if you have a hex-encoded private key and you want to initialize your private key.
sign ( $data ) : string Creates an ECDSA signature of $message

Method Details

__toString() public méthode

public __toString ( ) : string
Résultat string

generate() public méthode

Generates an EC private key
public generate ( ) : PrivateKey
Résultat PrivateKey

getPublicKey() public méthode

public getPublicKey ( ) : PublicKey
Résultat PublicKey

hasValidDec() public méthode

public hasValidDec ( ) : boolean
Résultat boolean

hasValidHex() public méthode

public hasValidHex ( ) : boolean
Résultat boolean

isValid() public méthode

Checks to see if the private key value is not empty and the hex form only contains hexits and the decimal form only contains devimal digits.
public isValid ( ) : boolean
Résultat boolean

pemDecode() public méthode

Decodes PEM data to retrieve the keypair.
public pemDecode ( string $pem_data ) : array
$pem_data string The data to decode.
Résultat array The keypair info.

pemEncode() public méthode

Encodes keypair data to PEM format.
public pemEncode ( array $keypair ) : string
$keypair array The keypair info.
Résultat string The data to decode.

serializeSig() public static méthode

ASN.1 DER encodes the signature based on the form: 0x30 + size(all) + 0x02 + size(r) + r + 0x02 + size(s) + s http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf
public static serializeSig ( $r, $s ) : string
Résultat string

setHex() public méthode

If you have a private key, you can derive your public key and also your sin.
public setHex ( $hex )

sign() public méthode

Creates an ECDSA signature of $message
public sign ( $data ) : string
Résultat string

Property Details

$pemDecoded public_oe property

public array $pemDecoded
Résultat array

$pemEncoded public_oe property

public string $pemEncoded
Résultat string

$publicKey protected_oe property

protected PublicKey,bitpay $publicKey
Résultat PublicKey