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. |
---|
string
exportKeyPair(\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.
\boo
The 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. |
---|
resource
of key pairexportPublicKey() : resource
Exports public key from $_keypair.
\OSS_Crypt_Exception |
if $_keypair is not generated. |
---|
resource
of public keygenCertificate(array $dn, $options) : resource
oaram | array|null $options Options for creating certificate |
---|
array
Certificate information
resource
genKeyPair(array $options) : resource
Generates public and private key pair for encryption / decryption.
array
The generator options.
resource
of key pairgenSelfSignedCert(array $dn, int $days, array | null $options, int $serial) : resource
array
Certificate information
int
Days until certificate expires
array
null
Options for creating certificate
int
Serial number by default is 0
resource
of certificate.genSignedCert(array $dn, int $days, string $cacert, string $cakey, array | null $options, int $serial) : resource
array
Certificate information
int
Days until certificate expires
string
Encrypted issuer certifcate
string
Encrypted issuer private key
array
null
Options for creating certificate
int
Serial number by default is 0
resource
of certificate.parseCertificate(string $cert) : array
string
Encrypted certificate
array
setKeyPair(string $keypair) : resource
Sets key pair from key pair file content
string
The key pair file content
resource
of key pairsetPassphrase(string $passphrase) : void
Sets passphrase which will be used for key pair encryption.
string
The passphrase for key pair encryption
$_cert : resource
$_keypair : resource
$_passphrase : string