OpenSSL public/private key generation tools.
| author | Barry O'Donovan | 
|---|---|
| author | The Skilled Team of PHP Developers at Open Solutions | 
| category | OSS | 
| package | OSS_Crypt | 
| copyright | Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland | 
| license | New BSD License | 
exportCert() : string
Converts self signed certificate to string, and returns it.
| \OSS_Crypt_Exception | if $_cert is not generated. | 
|---|
stringexportKeyPair(\boo $encrypt) : resource
Exports key pair which is actually private key which store public key information. If encrypt is set to true then export resource will be encrypted with $_passphrase else it will return the actual key without encryption. By default $encrypt is true.
\booThe encrypt flag to encrypt or not the returning resource.
| \OSS_Crypt_Exception | if $_keypair is not generated, or if encryption required and $_passphrase is not unset. | 
|---|
resourceof key pairexportPublicKey() : resource
Exports public key from $_keypair.
| \OSS_Crypt_Exception | if $_keypair is not generated. | 
|---|
resourceof public keygenCertificate(array $dn, $options) : resource
| oaram | array|null $options Options for creating certificate | 
|---|
arrayCertificate information
resourcegenKeyPair(array $options) : resource
Generates public and private key pair for encryption / decryption.
arrayThe generator options.
resourceof key pairgenSelfSignedCert(array $dn, int $days, array | null $options, int $serial) : resource
arrayCertificate information
intDays until certificate expires
arraynullOptions for creating certificate
intSerial number by default is 0
resourceof certificate.genSignedCert(array $dn, int $days, string $cacert, string $cakey, array | null $options, int $serial) : resource
arrayCertificate information
intDays until certificate expires
stringEncrypted issuer certifcate
stringEncrypted issuer private key
arraynullOptions for creating certificate
intSerial number by default is 0
resourceof certificate.parseCertificate(string $cert) : array
stringEncrypted certificate
arraysetKeyPair(string $keypair) : resource
Sets key pair from key pair file content
stringThe key pair file content
resourceof key pairsetPassphrase(string $passphrase) : void
Sets passphrase which will be used for key pair encryption.
stringThe passphrase for key pair encryption
$_cert : resource
$_keypair : resource
$_passphrase : string