Skip to content

Commit

Permalink
Support contracts are available
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jan 3, 2019
1 parent e212e5a commit 62011bd
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,32 @@ EasyRSA is MIT licensed and brought to you by the secure PHP development team at
You can generate 2048-bit keys (or larger) using EasyRSA. The default size is 2048.

```php
use \ParagonIE\EasyRSA\KeyPair;
<?php
use ParagonIE\EasyRSA\KeyPair;

$keyPair = KeyPair::generateKeyPair(4096);

$secretKey = $keyPair->getPrivateKey();
$publicKey = $keyPair->getPublicKey();
```

#### Getting the Raw Key

```php
<?php
/** @var \ParagonIE\EasyRSA\PublicKey $publicKey */
var_dump($publicKey->getKey());
```

### Encrypting/Decrypting a Message

```php
use \ParagonIE\EasyRSA\EasyRSA;
<?php
use ParagonIE\EasyRSA\EasyRSA;

$message = "test";
/** @var \ParagonIE\EasyRSA\PublicKey $publicKey */
/** @var \ParagonIE\EasyRSA\PrivateKey $secretKey */

$ciphertext = EasyRSA::encrypt($message, $publicKey);

Expand All @@ -53,7 +66,12 @@ $plaintext = EasyRSA::decrypt($ciphertext, $secretKey);
### Signing/Verifying a Message

```php
use \ParagonIE\EasyRSA\EasyRSA;
<?php
use ParagonIE\EasyRSA\EasyRSA;

$message = "test";
/** @var \ParagonIE\EasyRSA\PublicKey $publicKey */
/** @var \ParagonIE\EasyRSA\PrivateKey $secretKey */

$signature = EasyRSA::sign($message, $secretKey);

Expand All @@ -75,3 +93,8 @@ if (EasyRSA::verify($message, $signature, $publicKey)) {
* Calculates a checksum of both encrypted values (and a version tag)
* Authentication
* Signs a message using PHPSecLib (RSASS-PSS + MGF1-SHA256)

## Support Contracts

If your company uses this library in their products or services, you may be
interested in [purchasing a support contract from Paragon Initiative Enterprises](https://paragonie.com/enterprise).

0 comments on commit 62011bd

Please sign in to comment.