-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support specify custom keyring details for Electronic Signature.
- Loading branch information
1 parent
49f23d9
commit 133a570
Showing
9 changed files
with
136 additions
and
12 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
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
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
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
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
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
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,65 @@ | ||
<?php | ||
|
||
namespace AndrewSvirin\Ebics\Models\X509; | ||
|
||
use AndrewSvirin\Ebics\Contracts\Crypt\RSAInterface; | ||
use AndrewSvirin\Ebics\Contracts\Crypt\X509Interface; | ||
use AndrewSvirin\Ebics\Contracts\X509GeneratorInterface; | ||
use AndrewSvirin\Ebics\Models\Crypt\X509; | ||
|
||
/** | ||
* Generator simulation for already created certificates and loaded from content. | ||
* | ||
* @license http://www.opensource.org/licenses/mit-license.html MIT License | ||
* @author Andrew Svirin | ||
*/ | ||
final class ContentX509Generator implements X509GeneratorInterface | ||
{ | ||
private string $aContent; | ||
|
||
private string $eContent; | ||
|
||
private string $xContent; | ||
|
||
public function setAContent(string $content): void | ||
{ | ||
$this->aContent = $content; | ||
} | ||
|
||
public function setEContent(string $content): void | ||
{ | ||
$this->eContent = $content; | ||
} | ||
|
||
public function setXContent(string $content): void | ||
{ | ||
$this->xContent = $content; | ||
} | ||
|
||
public function generateAX509(RSAInterface $privateKey, RSAInterface $publicKey): X509Interface | ||
{ | ||
$cert = new X509(); | ||
|
||
$cert->loadX509($this->aContent); | ||
|
||
return $cert; | ||
} | ||
|
||
public function generateEX509(RSAInterface $privateKey, RSAInterface $publicKey): X509Interface | ||
{ | ||
$cert = new X509(); | ||
|
||
$cert->loadX509($this->eContent); | ||
|
||
return $cert; | ||
} | ||
|
||
public function generateXX509(RSAInterface $privateKey, RSAInterface $publicKey): X509Interface | ||
{ | ||
$cert = new X509(); | ||
|
||
$cert->loadX509($this->xContent); | ||
|
||
return $cert; | ||
} | ||
} |
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
Binary file not shown.