Edit File by line
/home/barbar84/www/wp-conte.../plugins/worker/src/PHPSecLi.../File
File: X509.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Pure-PHP X.509 Parser
[3] Fix | Delete
*
[4] Fix | Delete
* PHP versions 4 and 5
[5] Fix | Delete
*
[6] Fix | Delete
* Encode and decode X.509 certificates.
[7] Fix | Delete
*
[8] Fix | Delete
* The extensions are from {@link http://tools.ietf.org/html/rfc5280 RFC5280} and
[9] Fix | Delete
* {@link http://web.archive.org/web/19961027104704/http://www3.netscape.com/eng/security/cert-exts.html Netscape Certificate Extensions}.
[10] Fix | Delete
*
[11] Fix | Delete
* Note that loading an X.509 certificate and resaving it may invalidate the signature. The reason being that the signature is based on a
[12] Fix | Delete
* portion of the certificate that contains optional parameters with default values. ie. if the parameter isn't there the default value is
[13] Fix | Delete
* used. Problem is, if the parameter is there and it just so happens to have the default value there are two ways that that parameter can
[14] Fix | Delete
* be encoded. It can be encoded explicitly or left out all together. This would effect the signature value and thus may invalidate the
[15] Fix | Delete
* the certificate all together unless the certificate is re-signed.
[16] Fix | Delete
*
[17] Fix | Delete
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy
[18] Fix | Delete
* of this software and associated documentation files (the "Software"), to deal
[19] Fix | Delete
* in the Software without restriction, including without limitation the rights
[20] Fix | Delete
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[21] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is
[22] Fix | Delete
* furnished to do so, subject to the following conditions:
[23] Fix | Delete
*
[24] Fix | Delete
* The above copyright notice and this permission notice shall be included in
[25] Fix | Delete
* all copies or substantial portions of the Software.
[26] Fix | Delete
*
[27] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[28] Fix | Delete
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[29] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[30] Fix | Delete
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[31] Fix | Delete
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
[32] Fix | Delete
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
[33] Fix | Delete
* THE SOFTWARE.
[34] Fix | Delete
*
[35] Fix | Delete
* @category File
[36] Fix | Delete
* @package File_X509
[37] Fix | Delete
* @author Jim Wigginton <terrafrost@php.net>
[38] Fix | Delete
* @copyright MMXII Jim Wigginton
[39] Fix | Delete
* @license http://www.opensource.org/licenses/mit-license.html MIT License
[40] Fix | Delete
* @link http://phpseclib.sourceforge.net
[41] Fix | Delete
*/
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Include File_ASN1
[45] Fix | Delete
*/
[46] Fix | Delete
if (!class_exists('File_ASN1')) {
[47] Fix | Delete
require_once dirname(__FILE__).'/ASN1.php';
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Flag to only accept signatures signed by certificate authorities
[52] Fix | Delete
*
[53] Fix | Delete
* Not really used anymore but retained all the same to suppress E_NOTICEs from old installs
[54] Fix | Delete
*
[55] Fix | Delete
* @access public
[56] Fix | Delete
*/
[57] Fix | Delete
define('FILE_X509_VALIDATE_SIGNATURE_BY_CA', 1);
[58] Fix | Delete
[59] Fix | Delete
/**#@+
[60] Fix | Delete
* @access public
[61] Fix | Delete
* @see File_X509::getDN()
[62] Fix | Delete
*/
[63] Fix | Delete
/**
[64] Fix | Delete
* Return internal array representation
[65] Fix | Delete
*/
[66] Fix | Delete
define('FILE_X509_DN_ARRAY', 0);
[67] Fix | Delete
/**
[68] Fix | Delete
* Return string
[69] Fix | Delete
*/
[70] Fix | Delete
define('FILE_X509_DN_STRING', 1);
[71] Fix | Delete
/**
[72] Fix | Delete
* Return ASN.1 name string
[73] Fix | Delete
*/
[74] Fix | Delete
define('FILE_X509_DN_ASN1', 2);
[75] Fix | Delete
/**
[76] Fix | Delete
* Return OpenSSL compatible array
[77] Fix | Delete
*/
[78] Fix | Delete
define('FILE_X509_DN_OPENSSL', 3);
[79] Fix | Delete
/**
[80] Fix | Delete
* Return canonical ASN.1 RDNs string
[81] Fix | Delete
*/
[82] Fix | Delete
define('FILE_X509_DN_CANON', 4);
[83] Fix | Delete
/**
[84] Fix | Delete
* Return name hash for file indexing
[85] Fix | Delete
*/
[86] Fix | Delete
define('FILE_X509_DN_HASH', 5);
[87] Fix | Delete
/**#@-*/
[88] Fix | Delete
[89] Fix | Delete
/**#@+
[90] Fix | Delete
* @access public
[91] Fix | Delete
* @see File_X509::saveX509()
[92] Fix | Delete
* @see File_X509::saveCSR()
[93] Fix | Delete
* @see File_X509::saveCRL()
[94] Fix | Delete
*/
[95] Fix | Delete
/**
[96] Fix | Delete
* Save as PEM
[97] Fix | Delete
*
[98] Fix | Delete
* ie. a base64-encoded PEM with a header and a footer
[99] Fix | Delete
*/
[100] Fix | Delete
define('FILE_X509_FORMAT_PEM', 0);
[101] Fix | Delete
/**
[102] Fix | Delete
* Save as DER
[103] Fix | Delete
*/
[104] Fix | Delete
define('FILE_X509_FORMAT_DER', 1);
[105] Fix | Delete
/**
[106] Fix | Delete
* Save as a SPKAC
[107] Fix | Delete
*
[108] Fix | Delete
* Only works on CSRs. Not currently supported.
[109] Fix | Delete
*/
[110] Fix | Delete
define('FILE_X509_FORMAT_SPKAC', 2);
[111] Fix | Delete
/**#@-*/
[112] Fix | Delete
[113] Fix | Delete
/**
[114] Fix | Delete
* Attribute value disposition.
[115] Fix | Delete
* If disposition is >= 0, this is the index of the target value.
[116] Fix | Delete
*/
[117] Fix | Delete
define('FILE_X509_ATTR_ALL', -1); // All attribute values (array).
[118] Fix | Delete
define('FILE_X509_ATTR_APPEND', -2); // Add a value.
[119] Fix | Delete
define('FILE_X509_ATTR_REPLACE', -3); // Clear first, then add a value.
[120] Fix | Delete
[121] Fix | Delete
/**
[122] Fix | Delete
* Pure-PHP X.509 Parser
[123] Fix | Delete
*
[124] Fix | Delete
* @package File_X509
[125] Fix | Delete
* @author Jim Wigginton <terrafrost@php.net>
[126] Fix | Delete
* @access public
[127] Fix | Delete
*/
[128] Fix | Delete
class File_X509
[129] Fix | Delete
{
[130] Fix | Delete
/**
[131] Fix | Delete
* ASN.1 syntax for X.509 certificates
[132] Fix | Delete
*
[133] Fix | Delete
* @var Array
[134] Fix | Delete
* @access private
[135] Fix | Delete
*/
[136] Fix | Delete
public $Certificate;
[137] Fix | Delete
[138] Fix | Delete
/**#@+
[139] Fix | Delete
* ASN.1 syntax for various extensions
[140] Fix | Delete
*
[141] Fix | Delete
* @access private
[142] Fix | Delete
*/
[143] Fix | Delete
public $DirectoryString;
[144] Fix | Delete
public $PKCS9String;
[145] Fix | Delete
public $AttributeValue;
[146] Fix | Delete
public $Extensions;
[147] Fix | Delete
public $KeyUsage;
[148] Fix | Delete
public $ExtKeyUsageSyntax;
[149] Fix | Delete
public $BasicConstraints;
[150] Fix | Delete
public $KeyIdentifier;
[151] Fix | Delete
public $CRLDistributionPoints;
[152] Fix | Delete
public $AuthorityKeyIdentifier;
[153] Fix | Delete
public $CertificatePolicies;
[154] Fix | Delete
public $AuthorityInfoAccessSyntax;
[155] Fix | Delete
public $SubjectAltName;
[156] Fix | Delete
public $PrivateKeyUsagePeriod;
[157] Fix | Delete
public $IssuerAltName;
[158] Fix | Delete
public $PolicyMappings;
[159] Fix | Delete
public $NameConstraints;
[160] Fix | Delete
[161] Fix | Delete
public $CPSuri;
[162] Fix | Delete
public $UserNotice;
[163] Fix | Delete
[164] Fix | Delete
public $netscape_cert_type;
[165] Fix | Delete
public $netscape_comment;
[166] Fix | Delete
public $netscape_ca_policy_url;
[167] Fix | Delete
[168] Fix | Delete
public $Name;
[169] Fix | Delete
public $RelativeDistinguishedName;
[170] Fix | Delete
public $CRLNumber;
[171] Fix | Delete
public $CRLReason;
[172] Fix | Delete
public $IssuingDistributionPoint;
[173] Fix | Delete
public $InvalidityDate;
[174] Fix | Delete
public $CertificateIssuer;
[175] Fix | Delete
public $HoldInstructionCode;
[176] Fix | Delete
public $SignedPublicKeyAndChallenge;
[177] Fix | Delete
/**#@-*/
[178] Fix | Delete
[179] Fix | Delete
/**
[180] Fix | Delete
* ASN.1 syntax for Certificate Signing Requests (RFC2986)
[181] Fix | Delete
*
[182] Fix | Delete
* @var Array
[183] Fix | Delete
* @access private
[184] Fix | Delete
*/
[185] Fix | Delete
public $CertificationRequest;
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* ASN.1 syntax for Certificate Revocation Lists (RFC5280)
[189] Fix | Delete
*
[190] Fix | Delete
* @var Array
[191] Fix | Delete
* @access private
[192] Fix | Delete
*/
[193] Fix | Delete
public $CertificateList;
[194] Fix | Delete
[195] Fix | Delete
/**
[196] Fix | Delete
* Distinguished Name
[197] Fix | Delete
*
[198] Fix | Delete
* @var Array
[199] Fix | Delete
* @access private
[200] Fix | Delete
*/
[201] Fix | Delete
public $dn;
[202] Fix | Delete
[203] Fix | Delete
/**
[204] Fix | Delete
* Public key
[205] Fix | Delete
*
[206] Fix | Delete
* @var String
[207] Fix | Delete
* @access private
[208] Fix | Delete
*/
[209] Fix | Delete
public $publicKey;
[210] Fix | Delete
[211] Fix | Delete
/**
[212] Fix | Delete
* Private key
[213] Fix | Delete
*
[214] Fix | Delete
* @var String
[215] Fix | Delete
* @access private
[216] Fix | Delete
*/
[217] Fix | Delete
public $privateKey;
[218] Fix | Delete
[219] Fix | Delete
/**
[220] Fix | Delete
* Object identifiers for X.509 certificates
[221] Fix | Delete
*
[222] Fix | Delete
* @var Array
[223] Fix | Delete
* @access private
[224] Fix | Delete
* @link http://en.wikipedia.org/wiki/Object_identifier
[225] Fix | Delete
*/
[226] Fix | Delete
public $oids;
[227] Fix | Delete
[228] Fix | Delete
/**
[229] Fix | Delete
* The certificate authorities
[230] Fix | Delete
*
[231] Fix | Delete
* @var Array
[232] Fix | Delete
* @access private
[233] Fix | Delete
*/
[234] Fix | Delete
public $CAs;
[235] Fix | Delete
[236] Fix | Delete
/**
[237] Fix | Delete
* The currently loaded certificate
[238] Fix | Delete
*
[239] Fix | Delete
* @var Array
[240] Fix | Delete
* @access private
[241] Fix | Delete
*/
[242] Fix | Delete
public $currentCert;
[243] Fix | Delete
[244] Fix | Delete
/**
[245] Fix | Delete
* The signature subject
[246] Fix | Delete
*
[247] Fix | Delete
* There's no guarantee File_X509 is going to reencode an X.509 cert in the same way it was originally
[248] Fix | Delete
* encoded so we take save the portion of the original cert that the signature would have made for.
[249] Fix | Delete
*
[250] Fix | Delete
* @var String
[251] Fix | Delete
* @access private
[252] Fix | Delete
*/
[253] Fix | Delete
public $signatureSubject;
[254] Fix | Delete
[255] Fix | Delete
/**
[256] Fix | Delete
* Certificate Start Date
[257] Fix | Delete
*
[258] Fix | Delete
* @var String
[259] Fix | Delete
* @access private
[260] Fix | Delete
*/
[261] Fix | Delete
public $startDate;
[262] Fix | Delete
[263] Fix | Delete
/**
[264] Fix | Delete
* Certificate End Date
[265] Fix | Delete
*
[266] Fix | Delete
* @var String
[267] Fix | Delete
* @access private
[268] Fix | Delete
*/
[269] Fix | Delete
public $endDate;
[270] Fix | Delete
[271] Fix | Delete
/**
[272] Fix | Delete
* Serial Number
[273] Fix | Delete
*
[274] Fix | Delete
* @var String
[275] Fix | Delete
* @access private
[276] Fix | Delete
*/
[277] Fix | Delete
public $serialNumber;
[278] Fix | Delete
[279] Fix | Delete
/**
[280] Fix | Delete
* Key Identifier
[281] Fix | Delete
*
[282] Fix | Delete
* See {@link http://tools.ietf.org/html/rfc5280#section-4.2.1.1 RFC5280#section-4.2.1.1} and
[283] Fix | Delete
* {@link http://tools.ietf.org/html/rfc5280#section-4.2.1.2 RFC5280#section-4.2.1.2}.
[284] Fix | Delete
*
[285] Fix | Delete
* @var String
[286] Fix | Delete
* @access private
[287] Fix | Delete
*/
[288] Fix | Delete
public $currentKeyIdentifier;
[289] Fix | Delete
[290] Fix | Delete
/**
[291] Fix | Delete
* CA Flag
[292] Fix | Delete
*
[293] Fix | Delete
* @var Boolean
[294] Fix | Delete
* @access private
[295] Fix | Delete
*/
[296] Fix | Delete
public $caFlag = false;
[297] Fix | Delete
[298] Fix | Delete
/**
[299] Fix | Delete
* SPKAC Challenge
[300] Fix | Delete
*
[301] Fix | Delete
* @var String
[302] Fix | Delete
* @access private
[303] Fix | Delete
*/
[304] Fix | Delete
public $challenge;
[305] Fix | Delete
[306] Fix | Delete
/**
[307] Fix | Delete
* Default Constructor.
[308] Fix | Delete
*
[309] Fix | Delete
* @return File_X509
[310] Fix | Delete
* @access public
[311] Fix | Delete
*/
[312] Fix | Delete
public function __construct()
[313] Fix | Delete
{
[314] Fix | Delete
if (!class_exists('Math_BigInteger')) {
[315] Fix | Delete
require_once dirname(__FILE__).'/../Math/BigInteger.php';
[316] Fix | Delete
}
[317] Fix | Delete
[318] Fix | Delete
// Explicitly Tagged Module, 1988 Syntax
[319] Fix | Delete
// http://tools.ietf.org/html/rfc5280#appendix-A.1
[320] Fix | Delete
[321] Fix | Delete
$this->DirectoryString = array(
[322] Fix | Delete
'type' => FILE_ASN1_TYPE_CHOICE,
[323] Fix | Delete
'children' => array(
[324] Fix | Delete
'teletexString' => array('type' => FILE_ASN1_TYPE_TELETEX_STRING),
[325] Fix | Delete
'printableString' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING),
[326] Fix | Delete
'universalString' => array('type' => FILE_ASN1_TYPE_UNIVERSAL_STRING),
[327] Fix | Delete
'utf8String' => array('type' => FILE_ASN1_TYPE_UTF8_STRING),
[328] Fix | Delete
'bmpString' => array('type' => FILE_ASN1_TYPE_BMP_STRING),
[329] Fix | Delete
),
[330] Fix | Delete
);
[331] Fix | Delete
[332] Fix | Delete
$this->PKCS9String = array(
[333] Fix | Delete
'type' => FILE_ASN1_TYPE_CHOICE,
[334] Fix | Delete
'children' => array(
[335] Fix | Delete
'ia5String' => array('type' => FILE_ASN1_TYPE_IA5_STRING),
[336] Fix | Delete
'directoryString' => $this->DirectoryString,
[337] Fix | Delete
),
[338] Fix | Delete
);
[339] Fix | Delete
[340] Fix | Delete
$this->AttributeValue = array('type' => FILE_ASN1_TYPE_ANY);
[341] Fix | Delete
[342] Fix | Delete
$AttributeType = array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER);
[343] Fix | Delete
[344] Fix | Delete
$AttributeTypeAndValue = array(
[345] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[346] Fix | Delete
'children' => array(
[347] Fix | Delete
'type' => $AttributeType,
[348] Fix | Delete
'value' => $this->AttributeValue,
[349] Fix | Delete
),
[350] Fix | Delete
);
[351] Fix | Delete
[352] Fix | Delete
/*
[353] Fix | Delete
In practice, RDNs containing multiple name-value pairs (called "multivalued RDNs") are rare,
[354] Fix | Delete
but they can be useful at times when either there is no unique attribute in the entry or you
[355] Fix | Delete
want to ensure that the entry's DN contains some useful identifying information.
[356] Fix | Delete
[357] Fix | Delete
- https://www.opends.org/wiki/page/DefinitionRelativeDistinguishedName
[358] Fix | Delete
*/
[359] Fix | Delete
$this->RelativeDistinguishedName = array(
[360] Fix | Delete
'type' => FILE_ASN1_TYPE_SET,
[361] Fix | Delete
'min' => 1,
[362] Fix | Delete
'max' => -1,
[363] Fix | Delete
'children' => $AttributeTypeAndValue,
[364] Fix | Delete
);
[365] Fix | Delete
[366] Fix | Delete
// http://tools.ietf.org/html/rfc5280#section-4.1.2.4
[367] Fix | Delete
$RDNSequence = array(
[368] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[369] Fix | Delete
// RDNSequence does not define a min or a max, which means it doesn't have one
[370] Fix | Delete
'min' => 0,
[371] Fix | Delete
'max' => -1,
[372] Fix | Delete
'children' => $this->RelativeDistinguishedName,
[373] Fix | Delete
);
[374] Fix | Delete
[375] Fix | Delete
$this->Name = array(
[376] Fix | Delete
'type' => FILE_ASN1_TYPE_CHOICE,
[377] Fix | Delete
'children' => array(
[378] Fix | Delete
'rdnSequence' => $RDNSequence,
[379] Fix | Delete
),
[380] Fix | Delete
);
[381] Fix | Delete
[382] Fix | Delete
// http://tools.ietf.org/html/rfc5280#section-4.1.1.2
[383] Fix | Delete
$AlgorithmIdentifier = array(
[384] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[385] Fix | Delete
'children' => array(
[386] Fix | Delete
'algorithm' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER),
[387] Fix | Delete
'parameters' => array(
[388] Fix | Delete
'type' => FILE_ASN1_TYPE_ANY,
[389] Fix | Delete
'optional' => true,
[390] Fix | Delete
),
[391] Fix | Delete
),
[392] Fix | Delete
);
[393] Fix | Delete
[394] Fix | Delete
/*
[395] Fix | Delete
A certificate using system MUST reject the certificate if it encounters
[396] Fix | Delete
a critical extension it does not recognize; however, a non-critical
[397] Fix | Delete
extension may be ignored if it is not recognized.
[398] Fix | Delete
[399] Fix | Delete
http://tools.ietf.org/html/rfc5280#section-4.2
[400] Fix | Delete
*/
[401] Fix | Delete
$Extension = array(
[402] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[403] Fix | Delete
'children' => array(
[404] Fix | Delete
'extnId' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER),
[405] Fix | Delete
'critical' => array(
[406] Fix | Delete
'type' => FILE_ASN1_TYPE_BOOLEAN,
[407] Fix | Delete
'optional' => true,
[408] Fix | Delete
'default' => false,
[409] Fix | Delete
),
[410] Fix | Delete
'extnValue' => array('type' => FILE_ASN1_TYPE_OCTET_STRING),
[411] Fix | Delete
),
[412] Fix | Delete
);
[413] Fix | Delete
[414] Fix | Delete
$this->Extensions = array(
[415] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[416] Fix | Delete
'min' => 1,
[417] Fix | Delete
// technically, it's MAX, but we'll assume anything < 0 is MAX
[418] Fix | Delete
'max' => -1,
[419] Fix | Delete
// if 'children' isn't an array then 'min' and 'max' must be defined
[420] Fix | Delete
'children' => $Extension,
[421] Fix | Delete
);
[422] Fix | Delete
[423] Fix | Delete
$SubjectPublicKeyInfo = array(
[424] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[425] Fix | Delete
'children' => array(
[426] Fix | Delete
'algorithm' => $AlgorithmIdentifier,
[427] Fix | Delete
'subjectPublicKey' => array('type' => FILE_ASN1_TYPE_BIT_STRING),
[428] Fix | Delete
),
[429] Fix | Delete
);
[430] Fix | Delete
[431] Fix | Delete
$UniqueIdentifier = array('type' => FILE_ASN1_TYPE_BIT_STRING);
[432] Fix | Delete
[433] Fix | Delete
$Time = array(
[434] Fix | Delete
'type' => FILE_ASN1_TYPE_CHOICE,
[435] Fix | Delete
'children' => array(
[436] Fix | Delete
'utcTime' => array('type' => FILE_ASN1_TYPE_UTC_TIME),
[437] Fix | Delete
'generalTime' => array('type' => FILE_ASN1_TYPE_GENERALIZED_TIME),
[438] Fix | Delete
),
[439] Fix | Delete
);
[440] Fix | Delete
[441] Fix | Delete
// http://tools.ietf.org/html/rfc5280#section-4.1.2.5
[442] Fix | Delete
$Validity = array(
[443] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[444] Fix | Delete
'children' => array(
[445] Fix | Delete
'notBefore' => $Time,
[446] Fix | Delete
'notAfter' => $Time,
[447] Fix | Delete
),
[448] Fix | Delete
);
[449] Fix | Delete
[450] Fix | Delete
$CertificateSerialNumber = array('type' => FILE_ASN1_TYPE_INTEGER);
[451] Fix | Delete
[452] Fix | Delete
$Version = array(
[453] Fix | Delete
'type' => FILE_ASN1_TYPE_INTEGER,
[454] Fix | Delete
'mapping' => array('v1', 'v2', 'v3'),
[455] Fix | Delete
);
[456] Fix | Delete
[457] Fix | Delete
// assert($TBSCertificate['children']['signature'] == $Certificate['children']['signatureAlgorithm'])
[458] Fix | Delete
$TBSCertificate = array(
[459] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[460] Fix | Delete
'children' => array(
[461] Fix | Delete
// technically, default implies optional, but we'll define it as being optional, none-the-less, just to
[462] Fix | Delete
// reenforce that fact
[463] Fix | Delete
'version' => array(
[464] Fix | Delete
'constant' => 0,
[465] Fix | Delete
'optional' => true,
[466] Fix | Delete
'explicit' => true,
[467] Fix | Delete
'default' => 'v1',
[468] Fix | Delete
) + $Version,
[469] Fix | Delete
'serialNumber' => $CertificateSerialNumber,
[470] Fix | Delete
'signature' => $AlgorithmIdentifier,
[471] Fix | Delete
'issuer' => $this->Name,
[472] Fix | Delete
'validity' => $Validity,
[473] Fix | Delete
'subject' => $this->Name,
[474] Fix | Delete
'subjectPublicKeyInfo' => $SubjectPublicKeyInfo,
[475] Fix | Delete
// implicit means that the T in the TLV structure is to be rewritten, regardless of the type
[476] Fix | Delete
'issuerUniqueID' => array(
[477] Fix | Delete
'constant' => 1,
[478] Fix | Delete
'optional' => true,
[479] Fix | Delete
'implicit' => true,
[480] Fix | Delete
) + $UniqueIdentifier,
[481] Fix | Delete
'subjectUniqueID' => array(
[482] Fix | Delete
'constant' => 2,
[483] Fix | Delete
'optional' => true,
[484] Fix | Delete
'implicit' => true,
[485] Fix | Delete
) + $UniqueIdentifier,
[486] Fix | Delete
// <http://tools.ietf.org/html/rfc2459#page-74> doesn't use the EXPLICIT keyword but if
[487] Fix | Delete
// it's not IMPLICIT, it's EXPLICIT
[488] Fix | Delete
'extensions' => array(
[489] Fix | Delete
'constant' => 3,
[490] Fix | Delete
'optional' => true,
[491] Fix | Delete
'explicit' => true,
[492] Fix | Delete
) + $this->Extensions,
[493] Fix | Delete
),
[494] Fix | Delete
);
[495] Fix | Delete
[496] Fix | Delete
$this->Certificate = array(
[497] Fix | Delete
'type' => FILE_ASN1_TYPE_SEQUENCE,
[498] Fix | Delete
'children' => array(
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function