1<?php
2/*
3 * Copyright 2008-2010 GuardTime AS
4 *
5 * This file is part of the GuardTime PHP SDK.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *     http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20/**
21 * This is the master file you should include in your project.
22 *
23 * @package intro
24 */
25
26// util
27require_once('util/GTException.php');
28require_once('util/GTUtil.php');
29require_once('util/GTBaseX.php');
30require_once('util/GTBase16.php');
31require_once('util/GTBase32.php');
32require_once('util/GTBase64.php');
33require_once('util/GTBigInteger.php');
34
35// asn1
36require_once('asn1/ASN1DERDecodable.php');
37require_once('asn1/ASN1DEREncodable.php');
38require_once('asn1/ASN1DER.php');
39require_once('asn1/ASN1Constants.php');
40require_once('asn1/ASN1Object.php');
41require_once('asn1/ASN1String.php');
42require_once('asn1/ASN1Tag.php');
43require_once('asn1/ASN1Boolean.php');
44require_once('asn1/ASN1Integer.php');
45require_once('asn1/ASN1BitString.php');
46require_once('asn1/ASN1OctetString.php');
47require_once('asn1/ASN1Null.php');
48require_once('asn1/ASN1ObjectId.php');
49require_once('asn1/ASN1Sequence.php');
50require_once('asn1/ASN1Set.php');
51require_once('asn1/ASN1PrintableString.php');
52require_once('asn1/ASN1T61String.php');
53require_once('asn1/ASN1IA5String.php');
54require_once('asn1/ASN1UTCTime.php');
55require_once('asn1/ASN1GeneralizedTime.php');
56require_once('asn1/ASN1BMPString.php');
57require_once('asn1/ASN1UTF8String.php');
58
59// asn1/cmp
60// RFC 2510 Certificate Management Protocol
61// http://www.ietf.org/rfc/rfc2510.txt
62require_once('asn1/cmp/PKIStatusInfo.php');
63
64// asn1/cms
65// RFC 2630 Cryptographic Message Syntax
66// http://www.ietf.org/rfc/rfc2630.txt
67require_once('asn1/cms/CMSAttribute.php');
68require_once('asn1/cms/CMSContentInfo.php');
69require_once('asn1/cms/CMSSignedData.php');
70require_once('asn1/cms/CMSEncapsulatedContentInfo.php');
71require_once('asn1/cms/CMSSignerInfo.php');
72require_once('asn1/cms/CMSIssuerAndSerialNumber.php');
73require_once('asn1/cms/CMSSignerIdentifier.php');
74
75// asn1/gt
76// GuardTime defined structures
77require_once('asn1/gt/GTTimeSignature.php');
78require_once('asn1/gt/GTSignatureInfo.php');
79require_once('asn1/gt/GTPublishedData.php');
80require_once('asn1/gt/GTCertToken.php');
81require_once('asn1/gt/GTCertTokenRequest.php');
82require_once('asn1/gt/GTCertTokenResponse.php');
83require_once('asn1/gt/GTVerificationRequest.php');
84
85// asn1/x509
86require_once('asn1/x509/X509AlgorithmIdentifier.php');
87require_once('asn1/x509/X509GeneralName.php');
88require_once('asn1/x509/X509Certificate.php');
89require_once('asn1/x509/X509Extension.php');
90
91// asn1/tsp
92// RFC 3161 Time-Stamp Protocol
93// http://www.ietf.org/rfc/rfc3161.txt
94require_once('asn1/tsp/TSPAccuracy.php');
95require_once('asn1/tsp/TSPMessageImprint.php');
96require_once('asn1/tsp/TSPTimeStampReq.php');
97require_once('asn1/tsp/TSPTimeStampResp.php');
98require_once('asn1/tsp/TSPTSTInfo.php');
99
100// tsp
101require_once('tsp/GTHashAlgorithm.php');
102require_once('tsp/GTDataHash.php');
103require_once('tsp/GTHashEntry.php');
104require_once('tsp/GTHashChain.php');
105require_once('tsp/GTTimestamp.php');
106require_once('tsp/GTPublicationsFile.php');
107require_once('tsp/GTVerificationResultBase.php');
108require_once('tsp/GTVerificationResult.php');
109require_once('tsp/GTVerificationResultHttp.php');
110require_once('tsp/GTVerifier.php');
111
112// http
113require_once('http/GTHttpClient.php');
114
115if (!extension_loaded('bcmath')) {
116    throw new GTException("BCMath extension is required by GuardTime PHP SDK");
117}
118
119if (!extension_loaded('curl')) {
120    throw new GTException("CURL extension is required by GuardTime PHP SDK");
121}
122
123if (version_compare(PHP_VERSION, '5.3.0', '<')) {
124    throw new GTException("PHP version 5.3.0 or greater is required by GuardTime PHP SDK");
125}
126
127if (!extension_loaded('hash')) {
128    throw new GTException("Hash extension is required by GuardTime PHP SDK");
129}
130
131if (!extension_loaded('openssl')) {
132    throw new GTException("OpenSSL extension is required by GuardTime PHP SDK");
133}
134
135if (version_compare(GTUtil::getOpensslVersion(), '0.9.8', '<')) {
136    throw new GTException("OpenSSL version 0.9.8 or later is reqquired by GuardTime PHP SDK, current: " . OPENSSL_VERSION_TEXT);
137}
138
139?>
140