How to use this API

Published Thu 9 Sep, 15:35 by smalot in Tutorial

View part:


Part 3 - Create a partner setup

 

Before initializing communication, each partners must attribute themselves a "Partner ID".  Behind this "Partner ID" will be stored all mandatory informations to check / decrypt / encrypt / sign the message. It will hold too the information about the Message Delivery Notification (MDN) which can be asynchrone (ASYNC) or synchrone (SYNC), and so more ...

To store all these information you have to create a file named as it :

/<AS2Secure folder>/partners/<Partner ID>.conf

 

Local Partner example :

 

<?php

$data = array(
    // indicate if this partner is hosted in this server
    // only local partners are allowed to receive messages
    'is_local' => true,

    // the real name of the partner
    'name'     => 'mycompanyAS2',

    // the partner ID (the same as used for the filename)
    'id'       => 'mycompanyAS2',

    // the partner email
    'email'    => 'test@mycompanyAS2.com',

    // certificate files
    'sec_pkcs12'               => dirname(__FILE__).'/mycompanyAS2/key1.p12',
    'sec_pkcs12_password'      => 'test',

    // algorithms used to sign / encrypt / decrypt / check
    'sec_signature_algorithm'  => AS2Partner::SIGN_SHA1,
    'sec_encrypt_algorithm'    => AS2Partner::CRYPT_3DES,

    // notification process
    'mdn_request'              => AS2Partner::ACK_SYNC,
    'send_url'                 => 'http://192.168.0.101/as2/server.php',
);

 

Remote Partner example :

 

<?php

$data = array(
    // indicate if this partner is hosted in this server
    // only local partners are allowed to receive messages
    'is_local' => false,

    // the real name of the partner
    'name'     => 'mendelsontestAS2',

    // the partner ID (the same as used for the filename)
    'id'       => 'mendelsontestAS2',

    // the partner email
    'email'    => 'test@mendelsontestAS2.com',

    // certificate files
    'sec_certificate'          => dirname(__FILE__).'/mendelsontestAS2/key2.p12',

    // algorithms used to sign / encrypt / decrypt / check
    'sec_signature_algorithm'  => AS2Partner::SIGN_SHA1,
    'sec_encrypt_algorithm'    => AS2Partner::CRYPT_3DES,

    // notification process
    'mdn_request'              => AS2Partner::ACK_SYNC,
    'send_url'                 => 'http://as2.mendelson-e-c.com:8080/as2/HttpReceiver',
);

0 Comments for "How to use this API"

There are currently no comments.

Leave a comment