Now 129321 iCalcreator
users worldwide!!

Services

kigkonsult offer professional services for software support, design and new/re-development, customizations and adaptations of PHP/MySQL solutions with focus on software lifecycle management, including long term utility, reliability and maintainability.

If you need any custom modules, modification or amendment based on iCalcreator to suit your needs or professional support, don't hesitate to contact us.

iCalcreator used in.. .

  • AgenDAV
  • albaven
  • All-in-One Event Calendar
  • Bugscope
  • Date iCal
  • Dokeos
  • event_connect
  • ESS Feed
  • Exponent CMS
  • EQDKP Plus
  • GCalendar
  • GLPI
  • Gumbo Millennium
  • Hypecal
  • iCal
  • JCal Pro
  • kitEvent
  • luryevents
  • MarkupiCalendar
  • One Big SYSTem
  • Open Atrium
  • Repository based CMS
  • sfiCalCreatorPlugin
  • Telaen
  • terncal
  • twical
  • Virtual Loup-De-Mer
  • "Weather Forecast"
  •  
  • And many more.. .
  •  

Tell us

what iCalcreator is missing,
use the contact page

Support us

Link to our site from yours!    kigkonsult.se - iCal PHP software 

We will create a link to your site in our list of featured users!

Credits & Licenses plus

iCalcreator and the related PHP software was conceived and written by Kjell-Inge Gustafsson.

Many people have contributed, through providing questions, issues, reporting bugs and sending patches.

iCalcreator (standard) and the related PHP software are released under the LGPL  /  GPL  /  CC licences.

This site uses:
cssmenumaker 
FotoramaMIT
jQueryMIT/GPL
jQuery UIMIT/GPL
jQuery TimepickerMIT/GPL
PHPMailerLGPL
prototypeCC BY-SA
reCAPTCHA 

OpenSSLToolbox

OpenSSLToolbox
provides object-oriented, secure and extended access to PHP OpenSSL functions
OpenSSLPkeyFactory class
assembles the OpenSSL pkey functions
OpenSSLCsrFactory class
assembles the OpenSSL CSR functions
OpenSSLX509Factory class
assembles the OpenSSL x509 functions
OpenSSLPkcs7Factory class
assembles the OpenSSL pkcs7 functions
OpenSSLPkcs12Factory class
assembles the OpenSSL pkcs12 functions
OpenSSLSpkiFactory class
assembles the OpenSSL spki functions
OpenSSLFactory class
assembles remaining OpenSSL functions
HashFactory and HmacHashFactory class
provide supplementary methods for message digest / hmac digest support
Assert and Convert classes
provide asserts and convenient salt, base64, hex, pack utility etc methods
Click to get OpenSSLToolbox
from github - at packagist
All class methods has
argument validation and throws InvalidArgumentException on error
errorHandler protection and result error evaluation, throws RuntimeException on error
Method names originates from OpenSSL function names
Ex 'openssl_pkey_export' is encapsulated in method OpenSSLPkeyFactory::export()
Most methods has also more convenient and describable named method alias
Ex OpenSSLPkeyFactory::getPrivateKeyAsPemString() for 'openssl_pkey_export'
The OO-classes has
'factory' methods, support 'one-liners'
inherit usefull constants defind in the OpenSSLInterface
chainable methods (ex setters, ie return 'static')

USAGE

<?php
namespace Kigkonsult\OpenSSLToolbox;

$config = [
    OpenSSLPkeyFactory::DIGESTALGO     => OPENSSL_ALGO_SHA512,
    OpenSSLPkeyFactory::PRIVATEKEYBITS => 4096,
    OpenSSLPkeyFactory::PRIVATEKEYTYPE => OPENSSL_KEYTYPE_RSA,
];

$pKeyFactory      = new OpenSSLPkeyFactory( $config );

// Generate a private key
$privateKeyString = $pKeyFactory->getPrivateKeyAsPemString();
// Generate a public key
$publicKeyString  = $pKeyFactory->getPublicKeyAsPemString();
/* 
// or 
list( $privateKeyString, $publicKeyString ) =
    $pKeyFactory->getPrivatePublicKeyPairAsPemStrings();
// or one-liner, all-in-one
list( $privateKeyString, $publicKeyString ) =
    OpenSSLPkeyFactory::factory( $config )
                      ->getPrivatePublicKeyPairAsPemStrings();
// or to files
OpenSSLPkeyFactory::factory( $config )
                  ->savePrivatePublicKeyPairIntoPemFiles( 'priv.pem', 'pub.pem' )
*/

// Distinguished Name or subject fields to be used in the certificate
$DN = [
    OpenSSLCsrFactory::COUNTRYNAME          => "GB",
    OpenSSLCsrFactory::STATEORPROVINCENAME  => "Somerset",
    OpenSSLCsrFactory::LOCALITYNAME         => "Glastonbury",
    OpenSSLCsrFactory::ORGANIZATIONNAME     => "The Brain Room Limited",
    OpenSSLCsrFactory::ORGANIZATIONUNITNAME => "PHP Documentation Team",
    OpenSSLCsrFactory::COMMONNAME           => "Wez Furlong",
    OpenSSLCsrFactory::EMAILADDRESS         => "wez@example.com"
];
// Generate a certificate signing request
$csrFactory       = OpenSSLCsrFactory::factory( $DN, $privateKeyString, $config );
$csrCertString    = $csrFactory->getCSRasPemString();

// Generate a self-signed cert
$x509CertResource = $csrFactory->getX509CertResource( null, $privateKeyString );
$x509Factory      = OpenSSLX509Factory::factory()
                                      ->setX509Resource( $x509CertResource );
$x509CertString   = $x509Factory->getX509CertAsPemString();

/*
// or shorter
$x509CertString   = OpenSSLX509Factory::csrFactory( null, $DN, $privateKeyString, $config )
                                      ->getX509CertAsPemString();
// or save to pem/der-file
OpenSSLX509Factory::csrFactory( null, $DN, $privateKeyString, $config )
                  ->saveX509CertIntoPemFile( 'cert.pem' );
//                ->saveX509CertIntoDerFile( 'cert.der' )
*/

Seal/open

<?php
...
// Seal data using public key(s)
$data        = implode( array_fill( 0, 100, 'Testing OpenSSL seal/open, !"#¤%&/()=?. '));
$recipientId = 'The Recipient';
$publicKeys  = [ $recipientId => $publicKeyString ];
list( $sealed, $envelopeKeys ) = OpenSSLFactory::getSealedString( $data, $publicKeys );

// Open (decrypted) data using private key
$decrypted   = OpenSSLFactory::getOpenedSealedString(
     $sealed, $envelopeKeys[$recipientId], $privateKeyString
);

Encrypt/decrypt

<?php
...
$data       = implode( array_fill( 0, 100, 'Testing OpenSSL encrypt/decrypt, !"#¤%&/()=?. '));
$cipher     = 'AES-256-ECB';
$passPhrase = Workshop::getSalt();
// encrypt string
$encrypted  = OpenSSLFactory::getEncryptedString( $data, $cipher, $passPhrase );
// decrypt string
$decrypted  = OpenSSLFactory::getDecryptedString( $encrypted, $cipher, $passPhrase );

More encrypt/decrypt

<?php
...
$data      = 'Testing OpenSSL public/private encrypt/decrypt, !"#¤%&/()=?. ';
// Encrypt the data using the PUBLIC key
$encrypted = OpenSSLFactory::getpublicKeyEncryptedString( $data, $publicKeyString );
// Decrypt the data using the PRIVATE key
$decrypted = OpenSSLFactory::getprivateKeyDecryptedString( $encrypted, $privateKeyString );

// Encrypt the data using the PRIVATE key
$encrypted = OpenSSLFactory::getprivateKeyEncryptedString( $data, $privateKeyString );
// Decrypt the data using the PUBLIC key
$decrypted = OpenSSLFactory::getpublicKeyDecryptedString( $encrypted, $publicKeyString );

The PHP software was conceived
and written by Kjell-Inge Gustafsson.
Many people have contributed,
hrough providing questions, issues,
reporting bugs and sending patches.
The PHP software are released under the LGPL  /  GPL  /  CC licences. Terms and Conditions
Privacy & Cookies Policy
Linking Policy
GitHub contact
Copyright © 2008-2024 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
Product names mentioned herein are or may be trademarks or registered trademarks of their respective owners.