AS2Secure
[ class tree: AS2Secure ] [ index: AS2Secure ] [ all elements ]

Class: AS2Adapter

Source Location: /AS2Adapter.php

Class Overview


AS2Secure - PHP Lib for AS2 message encoding / decoding


Author(s):

Version:

  • 0.9.0

Copyright:

  • Copyright (c) 2010, Sebastien MALOT

    Last release at : http://www.as2secure.com

    This file is part of AS2Secure Project.

    AS2Secure is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

    AS2Secure is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with AS2Secure.

Variables

Methods



Class Details

[line 32]
AS2Secure - PHP Lib for AS2 message encoding / decoding



Tags:

author:  Sebastien MALOT <contact@as2secure.com>
version:  0.9.0
copyright:  

Copyright (c) 2010, Sebastien MALOT

Last release at : http://www.as2secure.com

This file is part of AS2Secure Project.

AS2Secure is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

AS2Secure is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with AS2Secure.

license:  GNU General Public License


[ Top ]


Class Variables

static $javapath =  'java'

[line 39]



Tags:

access:  public

Type:   mixed


[ Top ]

static $ssl_adapter =  'AS2Secure.jar'

[line 37]

Allow to specify full path to main applications

for overriding PATH usage




Tags:

access:  public

Type:   mixed


[ Top ]

static $ssl_openssl =  'openssl'

[line 38]



Tags:

access:  public

Type:   mixed


[ Top ]

static $tmp_files =  null

[line 47]

Array to store temporary files created and scheduled to unlink



Tags:

access:  protected

Type:   mixed


[ Top ]

$partner_from =  null

[line 41]



Tags:

access:  protected

Type:   mixed


[ Top ]

$partner_to =  null

[line 42]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method addTempFileForDelete [line 503]

static void addTempFileForDelete( $file)

Schedule file for deletion



Tags:

access:  public


Parameters:

   $file  

[ Top ]

static method calculateMicChecksum [line 384]

static string calculateMicChecksum( string $input, [string $algo = 'sha1'])

Calculate the message integrity check (MIC) using SHA1 or MD5 algo



Tags:

return:  The hash calculated
access:  public


Parameters:

string   $input   The file to use
string   $algo   The algo to use

[ Top ]

static method detectMimeType [line 593]

static string detectMimeType( string $file)

Determine the mimetype of a file (also called 'Content-Type')



Tags:

return:  The mimetype
access:  public


Parameters:

string   $file   The file to analyse

[ Top ]

static method detectOS [line 687]

static string detectOS( )

Determinate the Server OS



Tags:

return:  The OS : WIN | UNIX | OTHER
access:  public


[ Top ]

static method exec [line 530]

static string exec( string $command, [boolean $return_output = false])

Execute a command line and throw Exception if an error appends



Tags:

return:  The error code or the content from standard output
access:  public


Parameters:

string   $command   The command line to execute
boolean   $return_output   True to return all data from standard output False to return only the error code

[ Top ]

static method getCAFromPKCS12 [line 447]

static string getCAFromPKCS12( string $input, [string $password = ''])

Extract CA from a PKCS12 Certificate



Tags:

return:  The file which contains the CA
access:  public


Parameters:

string   $input   The PKCS12 Certificate
string   $password   The PKCS12 Certificate's password

[ Top ]

static method getDataFromPKCS12 [line 460]

static string getDataFromPKCS12( string $input, string $token, [string $password = ''])

Extract Part from a PKCS12 Certificate



Tags:

return:  The file which contains the Part
access:  protected


Parameters:

string   $input   The PKCS12 Certificate
string   $token   The Part to extract
string   $password   The PKCS12 Certificate's password

[ Top ]

static method getMicChecksum [line 398]

static string getMicChecksum( string $input)

Extract the message integrity check (MIC) from the digital signature



Tags:

return:  The hash extracted
access:  public


Parameters:

string   $input   The file containing the signed message

[ Top ]

static method getPrivateFromPKCS12 [line 423]

static string getPrivateFromPKCS12( string $input, [string $password = ''])

Extract Private Certificate from a PKCS12 Certificate



Tags:

return:  The file which contains the Private Certificate
access:  public


Parameters:

string   $input   The PKCS12 Certificate
string   $password   The PKCS12 Certificate's password

[ Top ]

static method getPublicFromPKCS12 [line 435]

static string getPublicFromPKCS12( string $input, [string $password = ''])

Extract Public certificate from a PKCS12 Certificate



Tags:

return:  The file which contains the Public Certificate
access:  public


Parameters:

string   $input   The PKCS12 Certificate
string   $password   The PKCS12 Certificate's password

[ Top ]

static method getTempFilename [line 487]

static string getTempFilename( )

Create a temporary file into temporary directory and add it to the garbage collector at shutdown



Tags:

return:  The temporary file generated
access:  public


[ Top ]

static method hex2bin [line 576]

static string hex2bin( string $str)

Convert a string from hexadecimal format to binary format



Tags:

return:  The string in binary format.
access:  public


Parameters:

string   $str   The string in hexadecimal format.

[ Top ]

static method _deleteTempFiles [line 516]

static void _deleteTempFiles( )

Garbage collector to delete temp files created with 'self::getTempFilename'

with shutdown function




Tags:

access:  public


[ Top ]

constructor __construct [line 49]

AS2Adapter __construct( $partner_from, $partner_to)



Tags:

access:  public


Parameters:

   $partner_from  
   $partner_to  

[ Top ]

method compose [line 72]

string compose( $files, array $input)

Generate a mime multipart file from files



Tags:

return:  The file generated
access:  public


Parameters:

array   $input   The list of extracted files (path / mimetype / filename)
   $files  

[ Top ]

method compress [line 151]

string compress( string $input)

Compress a file which contains mime headers



Tags:

return:  The content compressed
access:  public


Parameters:

string   $input   The file to compress

[ Top ]

method decompress [line 177]

string decompress( string $input)

Decompress a file which contains mime headers



Tags:

return:  The content decompressed
access:  public


Parameters:

string   $input   The file to compress

[ Top ]

method decrypt [line 337]

string decrypt( string $input)

Decrypt a message



Tags:

return:  The file decrypted
access:  public


Parameters:

string   $input   The file to decrypt

[ Top ]

method encrypt [line 278]

string encrypt( string $input, [string $cypher = 'des3'])

Encrypt a file



Tags:

return:  The message encrypted
access:  public


Parameters:

string   $input   The file to encrypt
string   $cypher   The Cypher to use for encryption

[ Top ]

method extract [line 108]

array extract( string $input)

Extract files from mime multipart file



Tags:

return:  The list of extracted files (path / mimetype / filename)
access:  public


Parameters:

string   $input   The file to extract

[ Top ]

method sign [line 205]

string sign( string $input, [boolean $use_zlib = false], [string $encoding = 'base64'])

Sign a file which contains mime headers



Tags:

return:  The content signed
access:  public


Parameters:

string   $input   The file to sign
boolean   $use_zlib   Use Zlib to compress main container
string   $encoding   Encoding to use for main container (base64 | binary)

[ Top ]

method verify [line 243]

string verify( string $input)

Verify a signed file



Tags:

return:  The content signed
access:  public


Parameters:

string   $input   The file to check

[ Top ]


Documentation generated on Wed, 03 Nov 2010 22:51:30 +0100 by phpDocumentor 1.4.3