Merge branch '2.0' into 3.0

This commit is contained in:
terrafrost 2022-12-17 11:25:26 -06:00
commit 5335dbde3e
44 changed files with 1587 additions and 0 deletions

View File

@ -1,5 +1,13 @@
# Changelog
## 3.0.18 - 2022-12-17
- fix for PHP 8.2 deprecations (#1869, #1873)
- SSH2: if logging in with rsa-sha2-256/512 fails, try ssh-rsa (#1865)
- SSH/Agent: add support for named pipes on windows (for pageant) (#1866)
- Crypt/Base: add a function to check continuous buffer status (#1870)
- OpenSSL 3.0.1+ deprecated some algorithms (RC2, RC4, DES, Blowfish)
## 3.0.17 - 2022-10-24
- X509: make it so CRLs, CSRs and SPKACs can support PSS keys (#1837)
@ -163,6 +171,15 @@
- Salsa20 / ChaCha20
- namespace changed from `phpseclib\` to `\phpseclib3` to facilitate phpseclib 2 shim (phpseclib2_compat)
## 2.0.40 - 2022-12-17
- fix for PHP 8.2 deprecations (#1869)
- SSH2: if logging in with rsa-sha2-256/512 fails, try ssh-rsa (#1865)
- SSH/Agent: add support for named pipes on windows (for pageant) (#1866)
- Crypt/Base: add a function to check continuous buffer status (#1870)
- OpenSSL 3.0.1+ deprecated some algorithms (RC2, RC4, DES, Blowfish)
>>>>>>> 2.0
## 2.0.39 - 2022-10-24
- SFTP: fix deprecated implicit float to int on 32-bit PHP 8.1 (#1841)

View File

@ -0,0 +1,37 @@
<?php
/**
* AttCertIssuer
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttCertIssuer
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttCertIssuer
{
public const MAP = [
'type' => ASN1::TYPE_CHOICE,
'children' => [
'v1Form' => GeneralNames::MAP,
'v2Form' => [
'constant' => 0,
'optional' => true,
] + V2Form::MAP,
],
];
}

View File

@ -0,0 +1,34 @@
<?php
/**
* AttCertValidityPeriod
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttCertValidityPeriod
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttCertValidityPeriod
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'notBeforeTime' => ['type' => ASN1::TYPE_GENERALIZED_TIME],
'notAfterTime' => ['type' => ASN1::TYPE_GENERALIZED_TIME],
],
];
}

View File

@ -0,0 +1,31 @@
<?php
/**
* AttCertVersion
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttCertVersion
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttCertVersion
{
public const MAP = [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v2'],
];
}

View File

@ -0,0 +1,31 @@
<?php
/**
* AttCertVersion
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttCertVersion
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttCertVersionV1
{
public const MAP = [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1'],
];
}

View File

@ -0,0 +1,49 @@
<?php
/**
* AttributeCertificateInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttributeCertificateInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttributeCertificateInfo
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'optional' => true,
'default' => 'v2',
] + AttCertVersion::MAP,
'holder' => Holder::MAP,
'issuer' => AttCertIssuer::MAP,
'signature' => AlgorithmIdentifier::MAP,
'serialNumber' => CertificateSerialNumber::MAP,
'attrCertValidityPeriod' => AttCertValidityPeriod::MAP,
'attributes' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 0,
'max' => -1,
'children' => Attribute::MAP,
],
'issuerUniqueID' => ['optional' => true] + UniqueIdentifier::MAP,
'extensions' => ['optional' => true] + Extensions::MAP,
],
];
}

View File

@ -0,0 +1,61 @@
<?php
/**
* AttributeCertificateInfoV1
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttributeCertificateInfoV1
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttributeCertificateInfoV1
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'optional' => true,
'default' => 'v1',
] + AttCertVersionV1::MAP,
'subject' => [
'type' => ASN1::TYPE_CHOICE,
'children' => [
'baseCertificateID' => [
'constant' => 0,
'optional' => true,
] + IssuerSerial::MAP,
'subjectName' => [
'constant' => 1,
'optional' => true,
] + GeneralNames::MAP,
],
],
'issuer' => GeneralNames::MAP,
'signature' => AlgorithmIdentifier::MAP,
'serialNumber' => CertificateSerialNumber::MAP,
'attCertValidityPeriod' => AttCertValidityPeriod::MAP,
'attributes' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 0,
'max' => -1,
'children' => Attribute::MAP,
],
'issuerUniqueID' => ['optional' => true] + UniqueIdentifier::MAP,
'extensions' => ['optional' => true] + Extensions::MAP,
],
];
}

View File

@ -0,0 +1,35 @@
<?php
/**
* AttributeCertificateV1
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttributeCertificateV1
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttributeCertificateV1
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'acinfo' => AttributeCertificateInfoV1::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING],
],
];
}

View File

@ -0,0 +1,35 @@
<?php
/**
* AttributeCertificateV2
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* AttributeCertificateV2
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class AttributeCertificateV2
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'acinfo' => AttributeCertificateInfo::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING],
],
];
}

View File

@ -0,0 +1,31 @@
<?php
/**
* CMSVersion
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* CMSVersion
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class CMSVersion
{
public const MAP = [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v0', 'v1', 'v2', 'v4', 'v5'],
];
}

View File

@ -0,0 +1,53 @@
<?php
/**
* CertificateChoices
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* CertificateChoices
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class CertificateChoices
{
public const MAP = [
'type' => ASN1::TYPE_CHOICE,
'children' => [
'certificate' => Certificate::MAP,
'extendedCertificate' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
] + ExtendedCertificate::MAP,
'v1AttrCert' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
] + AttributeCertificateV1::MAP,
'v2AttrCert' => [
'constant' => 2,
'optional' => true,
'implicit' => true,
] + AttributeCertificateV2::MAP,
'other' => [
'constant' => 3,
'optional' => true,
'implicit' => true,
] + OtherCertificateFormat::MAP,
],
];
}

View File

@ -0,0 +1,33 @@
<?php
/**
* CertificateSet
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* CertificateSet
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class CertificateSet
{
public const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => CertificateChoices::MAP,
];
}

View File

@ -0,0 +1,35 @@
<?php
/**
* CompressedData
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* CompressedData
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class CompressedData
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => CMSVersion::MAP,
'compressionAlgorithms' => CompressionAlgorithmIdentifiers::MAP,
'encapContentInfo' => EncapsulatedContentInfo::MAP,
],
];
}

View File

@ -0,0 +1,27 @@
<?php
/**
* CompressionAlgorithmIdentifier
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* CompressionAlgorithmIdentifier
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class CompressionAlgorithmIdentifier extends AlgorithmIdentifier
{
}

View File

@ -0,0 +1,39 @@
<?php
/**
* ContentInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ContentInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ContentInfo
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'contentType' => ContentType::MAP,
'content' => [
'type' => ASN1::TYPE_ANY,
'constant' => 0,
'optional' => true,
'explicit' => true,
],
],
];
}

View File

@ -0,0 +1,30 @@
<?php
/**
* ContentType
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ContentType
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ContentType
{
public const MAP = [
'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
];
}

View File

@ -0,0 +1,27 @@
<?php
/**
* DigestAlgorithmIdentifier
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* DigestAlgorithmIdentifier
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class DigestAlgorithmIdentifier extends AlgorithmIdentifier
{
}

View File

@ -0,0 +1,33 @@
<?php
/**
* DigestAlgorithmIdentifiers
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* DigestAlgorithmIdentifiers
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class DigestAlgorithmIdentifiers extends AlgorithmIdentifier
{
public const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => DigestAlgorithmIdentifier::MAP
];
}

View File

@ -0,0 +1,34 @@
<?php
/**
* ESSCertID
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ESSCertID
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ESSCertID
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'certHash' => Hash::MAP, // sha1 hash of the entire cert
'issuerSerial' => ['optional' => true] + IssuerSerial::MAP,
],
];
}

View File

@ -0,0 +1,38 @@
<?php
/**
* ESSCertIDv2
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ESSCertIDv2
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ESSCertIDv2
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'hashAlgorithm' => [
'optional' => true,
'default' => ['algorithm' => 'id-sha256', 'parameters' => ['null' => '']],
] + AlgorithmIdentifier::MAP,
'certHash' => Hash::MAP,
'issuerSerial' => ['optional' => true] + IssuerSerial::MAP,
],
];
}

View File

@ -0,0 +1,39 @@
<?php
/**
* EncapsulatedContentInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* EncapsulatedContentInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class EncapsulatedContentInfo
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'eContentType' => ContentType::MAP,
'eContent' => [
'type' => ASN1::TYPE_OCTET_STRING,
'constant' => 0,
'optional' => true,
'explicit' => true,
],
],
];
}

View File

@ -0,0 +1,37 @@
<?php
/**
* ExtendedCertificate
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ExtendedCertificate
*
* mapping is from <ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-6.asc>
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ExtendedCertificate
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'extendedCertificateInfo' => ExtendedCertificateInfo::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'attributes' => ['type' => ASN1::TYPE_BIT_STRING],
],
];
}

View File

@ -0,0 +1,35 @@
<?php
/**
* ExtendedCertificateInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ExtendedCertificateInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ExtendedCertificateInfo
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => ['type' => ASN1::TYPE_INTEGER],
'certificate' => Certificate::MAP,
'attributes' => Attributes::MAP,
],
];
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Hash
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* Hash
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class Hash
{
public const MAP = ['type' => ASN1::TYPE_OCTET_STRING];
}

View File

@ -0,0 +1,44 @@
<?php
/**
* Holder
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* Holder
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class Holder
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'baseCertificateID' => [
'constant' => 0,
'optional' => true,
] + IssuerSerial::MAP,
'entityName' => [
'constant' => 1,
'optional' => true,
] + GeneralNames::MAP,
'objectDigestInfo' => [
'constant' => 2,
'optional' => true,
] + ObjectDigestInfo::MAP,
],
];
}

View File

@ -0,0 +1,34 @@
<?php
/**
* IssuerAndSerialNumber
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* IssuerAndSerialNumber
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class IssuerAndSerialNumber
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'issuer' => Name::MAP,
'serialNumber' => CertificateSerialNumber::MAP,
],
];
}

View File

@ -0,0 +1,34 @@
<?php
/**
* IssuerSerial
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* IssuerSerial
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class IssuerSerial
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'issuer' => GeneralNames::MAP,
'serialNumber' => CertificateSerialNumber::MAP,
],
];
}

View File

@ -0,0 +1,46 @@
<?php
/**
* ObjectDigestInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* ObjectDigestInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class ObjectDigestInfo
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'digestedObjectType' => [
'type' => ASN1::TYPE_ENUMERATED,
'children' => [
'publicKey',
'publicKeyCert',
'otherObjectTypes',
],
],
'otherObjectTypeID' => [
'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
'optiona' => true,
],
'digestAlgorithm' => AlgorithmIdentifier::MAP,
'objectDigest' => ['type' => ASN1::TYPE_BIT_STRING],
],
];
}

View File

@ -0,0 +1,34 @@
<?php
/**
* OtherCertificateFormat
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* OtherCertificateFormat
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class OtherCertificateFormat
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'otherCertFormat' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'otherCert' => ['type' => ASN1::TYPE_ANY],
],
];
}

View File

@ -0,0 +1,34 @@
<?php
/**
* OtherRevocationInfoFormat
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* OtherRevocationInfoFormat
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class OtherRevocationInfoFormat
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'otherRevInfoFormat' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'otherRevInfo' => ['type' => ASN1::TYPE_ANY],
],
];
}

View File

@ -0,0 +1,38 @@
<?php
/**
* RevocationInfoChoice
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* RevocationInfoChoice
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class RevocationInfoChoice
{
public const MAP = [
'type' => ASN1::TYPE_CHOICE,
'children' => [
'crl' => CertificateList::MAP,
'other' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
] + OtherRevocationInfoFormat::MAP,
],
];
}

View File

@ -0,0 +1,33 @@
<?php
/**
* RevocationInfoChoices
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* RevocationInfoChoices
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class RevocationInfoChoices
{
public const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => RevocationInfoChoice::MAP,
];
}

View File

@ -0,0 +1,27 @@
<?php
/**
* SignatureAlgorithmIdentifier
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignatureAlgorithmIdentifier
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignatureAlgorithmIdentifier extends AlgorithmIdentifier
{
}

View File

@ -0,0 +1,28 @@
<?php
/**
* SignatureValue
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignatureValue
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignatureValue
{
public const MAP = ['type' => ASN1::TYPE_OCTET_STRING];
}

View File

@ -0,0 +1,33 @@
<?php
/**
* SignedAttributes
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignedAttributes
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignedAttributes
{
public const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => Attribute::MAP,
];
}

View File

@ -0,0 +1,46 @@
<?php
/**
* SignedData
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignedData
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignedData
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => CMSVersion::MAP,
'digestAlgorithms' => DigestAlgorithmIdentifiers::MAP,
'encapContentInfo' => EncapsulatedContentInfo::MAP,
'certificates' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
] + CertificateSet::MAP,
'crls' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
] + RevocationInfoChoices::MAP,
'signerInfos' => SignerInfos::MAP,
],
];
}

View File

@ -0,0 +1,37 @@
<?php
/**
* SignerIdentifier
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignerIdentifier
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignerIdentifier
{
public const MAP = [
'type' => ASN1::TYPE_CHOICE,
'children' => [
'issuerAndSerialNumber' => IssuerAndSerialNumber::MAP,
'subjectKeyIdentifier' => [
'constant' => 0,
'optional' => true,
] + SubjectKeyIdentifier::MAP,
],
];
}

View File

@ -0,0 +1,47 @@
<?php
/**
* SignerInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignerInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignerInfo
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => CMSVersion::MAP,
'sid' => SignerIdentifier::MAP,
'digestAlgorithm' => DigestAlgorithmIdentifier::MAP,
'signedAttrs' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
] + SignedAttributes::MAP,
'signatureAlgorithm' => SignatureAlgorithmIdentifier::MAP,
'signature' => SignatureValue::MAP,
'unsignedAttrs' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
] + UnsignedAttributes::MAP,
],
];
}

View File

@ -0,0 +1,33 @@
<?php
/**
* SignerInfo
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SignerInfo
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SignerInfos
{
public const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => SignerInfo::MAP,
];
}

View File

@ -0,0 +1,44 @@
<?php
/**
* SigningCertificate
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SigningCertificate
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SigningCertificate
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'certs' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => ESSCertID::MAP,
],
'policies' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => PolicyInformation::MAP,
],
],
];
}

View File

@ -0,0 +1,44 @@
<?php
/**
* SigningCertificate
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SigningCertificate
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SigningCertificate
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'certs' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => ESSCertIDv2::MAP,
],
'policies' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => PolicyInformation::MAP,
],
],
];
}

View File

@ -0,0 +1,28 @@
<?php
/**
* SubjectKeyIdentifier
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* SubjectKeyIdentifier
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class SubjectKeyIdentifier
{
public const MAP = ['type' => ASN1::TYPE_OCTET_STRING];
}

View File

@ -0,0 +1,33 @@
<?php
/**
* UnsignedAttributes
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* UnsignedAttributes
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class UnsignedAttributes
{
public const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => Attribute::MAP,
];
}

View File

@ -0,0 +1,41 @@
<?php
/**
* V2Form
*
* PHP version 5
*
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
declare(strict_types=1);
namespace phpseclib3\File\ASN1\Maps;
use phpseclib3\File\ASN1;
/**
* V2Form
*
* @author Jim Wigginton <terrafrost@php.net>
*/
abstract class V2Form
{
public const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'issuerName' => ['optional' => true] + GeneralNames::MAP,
'baseCertificateID' => [
'constant' => 0,
'optional' => true,
] + IssuerSerial::MAP,
'objectDigestInfo' => [
'constant' => 1,
'optional' => true,
] + ObjectDigestInfo::MAP,
],
];
}