-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Convertir Pfx a otros formatos | ||
|
||
## Convert to .PEM | ||
El archivo resultante se utiliza para firmar los comprobantes electrónicos. | ||
```php | ||
use Greenter\XMLSecLibs\Tool\PfxConverter; | ||
|
||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
$pfx = file_get_contents('your-cert.pfx'); | ||
$password = 'YOUR-PASSWORD'; | ||
|
||
$converter = new PfxConverter($pfx, $password); | ||
$pem = $converter | ||
->toPem() | ||
->getResult(); | ||
|
||
file_put_contents('certificate.pem', $pem); | ||
``` | ||
|
||
### Convert a .CER | ||
El archivo resultante se utiliza para subirlo a SUNAT. | ||
```php | ||
use Greenter\XMLSecLibs\Tool\PfxConverter; | ||
|
||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
$pfx = file_get_contents('your-cert.pfx'); | ||
$password = 'YOUR-PASSWORD'; | ||
|
||
$converter = new PfxConverter($pfx, $password); | ||
$pem = $converter | ||
->toCer() | ||
->getResult(); | ||
|
||
file_put_contents('certificate.cer', $pem); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters