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 

DsigSdk

PHP SDK of XML Digital Signature recomendation
based on the XSD schema.

and provide

dto's
with getters and setters, no other logic
XML parse into dto(s)
 
XML write of dto(s)
 
logic aid support
convenient salt, base64, hex, pack etc unility methods
message digest support
message hmac digest support
encryption/decryption support
Click to get DsigSdk
from github - at packagist

USAGE

Usage, parse XML

To parse an Dsig (Signature root) XML file (using XMLReader) :

<?php
namespace Kigkonsult\DsigSdk;
use Kigkonsult\DsigSdk\XMLParse\DsigParser;

$dsig = DsigParser::factory()->parse( 
    file_get_contents( 'DsigFile.xml' )
);

$signedInfo = $dsig->getsignedInfo();
...

The XML parser save the XMLreader node properties (baseURI, localName, name, namespaceURI, prefix) for each XML (Dto) element as 'XMLattributes' as well as XML attributes (xmlns, xmlns:*, schemaLocation), if set (more info below).

'any' [XSD] elements are accepted as 'Anytype' object instances (more info below, 'AnyType').

Usage, build up structure

To build up dsig structure:

<?php
namespace Kigkonsult\DsigSdk;
use Kigkonsult\DsigSdk\Dto\AnyType;
use Kigkonsult\DsigSdk\Dto\CanonicalizationMethodType;
use Kigkonsult\DsigSdk\Dto\KeyInfoType;
use Kigkonsult\DsigSdk\Dto\SignedInfoType;
use Kigkonsult\DsigSdk\Dto\SignatureType;
use Kigkonsult\DsigSdk\Dto\SignatureValueType;

$dsig = SignatureType::factory()
    ->setSignedInfo( 
        SignedInfoType::factory()
            ->setCanonicalizationMethod(
                CanonicalizationMethodType::factory()
                    ->setAlgorithm( SignatureType::MINICANONICAL )
                    ->setAny( [
                        AnyType::factory()
                            ->setElementName( 'nonSchemaElement1')
                            ->setAttributes( [
                                'id' => '12345' 
                                ] )
                             ->setContent( 'Lr1mKGxP7VAgMB...' ),
                        AnyType::factory()
                            ->setElementName( 'nonSchemaElement2')
                            ->setSubElements( [
                                AnyType::factory()
                                    ->setElementName( 'nonSchemaElement3')
                                    ->setContent( 'Lr1mKGxP7VAgMB...' ),
                            ] )
                        ]
                    )
            )
    )
    ->setSignatureValue(
        SignatureValueType::factory()
            ->setSignatureValueType( 'vgGZnRlm8...' )
    )
    ->setKeyInfo(
        KeyInfoType::factory()
            ->setKeyInfoType( [
                [                 // one set of elements
                    [             // element
                        SignatureType::X509DATA => 
                            X509DataType::factory()
                                ->setX509Certificate( ... )
                    ],
                ],
        ] )
    )
    ->setObject(
        ...
    )
    ...
XML attributes

You can set (single 'element') XMLattribute using

        $dsig->setXMLAttribut( ,  );
    

To set (ex. prefix) and 'propagate' down in hierarchy:

        $dsig->setXMLAttribut( SignatureType::PREFIX, , true );
    

You can remove (single 'element') XMLattribute using

        $dsig->unsetXMLAttribut(  );
    

To unset (ex. prefix) and 'propagate' down in hierarchy:

        $dsig->unsetXMLAttribut( SignatureType::PREFIX, true );
    

To fetch and iterate over XMLAttributes

        foreach( $dsig->getXMLAttributes() as $key => $value {
        ...
        }
    
Anytype

Anytype object instances are used for 'any' [XSD] elements.

The element name are stored and fetched with

        $anytype->setElementName(  );
    
        $anytypeName = $anytype->getElementName();
    

The 'any' [XSD] element attributes may include XML attributes.

The AnyType attributes are stored and fetched as array.

        $anytype->setAttributes( [  =>  ] );
    
        foreach( $anytype->getAttributes() as $key => $value {
        ...
        }
    

Note, an AnyType instance may have

content
type string,
AnyType::setContent()
AnyType::getContent()
 

or

sub-elements
type array [*AnyType]
AnyType::setSubElements()
AnyType::getSubElements()

but not both.

Usage, output as XML

DsigSdk uses XMLWriter creating output.

        $XMLstring = DsigWriter::factory()->write( $dsig );
    
The XMLwriter adds for each element
element name with prefix, if exists
XMLattribute xmlns, xmlns:* and schemaLocation, if exists.
Usage, output as DomNode
$domNode = DsigWriter::factory()->write( $dsig, true );
Info

For class structure and architecture

please review
the XSD
class design, docs/Dsig.png
the src/DtoLoader directory
You may find convenient constants in
src/DsigInterface.php
src/XMLAttributesInterface.php
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.