PHP Classes

File: src/KeyPair.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Halite   src/KeyPair.php   Download  
File: src/KeyPair.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Halite
Perform cryptography operations with libsodium
Author: By
Last change: For version 2, let's use strict types!
Date: 8 years ago
Size: 966 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);
namespace
ParagonIE\Halite;

use \
ParagonIE\Halite\Asymmetric\{
   
EncryptionPublicKey,
   
EncryptionSecretKey,
   
SignaturePublicKey,
   
SignatureSecretKey
};
use \
ParagonIE\Halite\Alerts as CryptoException;

/**
 * Describes a pair of secret and public keys
 */
class KeyPair
{
    protected
$secret_key;
    protected
$public_key;

   
/**
     * Hide this from var_dump(), etc.
     *
     * @return array
     */
   
public function __debugInfo()
    {
        return [
           
'privateKey' => '**protected**',
           
'publicKey' => '**protected**'
       
];
    }
       
   
/**
     * Get a Key object for the public key
     *
     * @return Key
     */
   
public function getPublicKey()
    {
       return
$this->public_key;
    }
   
   
/**
     * Get a Key object for the secret key
     *
     * @return Key
     */
   
public function getSecretKey()
    {
       return
$this->secret_key;
    }
}