1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-03 18:18:05 +01:00

File/ASN1/Maps: CS adjustments

these are mostly backported from PR#1754. the only modified files
from that PR are:

- RSAPrivateKey
- OtherPrimeInfo
This commit is contained in:
terrafrost 2022-02-27 00:36:32 -06:00
parent f2e9dd993d
commit 5f60f96487
85 changed files with 536 additions and 536 deletions

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class AccessDescription
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'accessMethod' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'accessMethod' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'accessLocation' => GeneralName::MAP
]
];

View File

@ -27,13 +27,13 @@ use phpseclib3\File\ASN1;
abstract class AdministrationDomainName
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
// if class isn't present it's assumed to be \phpseclib3\File\ASN1::CLASS_UNIVERSAL or
// (if constant is present) \phpseclib3\File\ASN1::CLASS_CONTEXT_SPECIFIC
'class' => ASN1::CLASS_APPLICATION,
'cast' => 2,
'class' => ASN1::CLASS_APPLICATION,
'cast' => 2,
'children' => [
'numeric' => ['type' => ASN1::TYPE_NUMERIC_STRING],
'numeric' => ['type' => ASN1::TYPE_NUMERIC_STRING],
'printable' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
]
];

View File

@ -29,11 +29,11 @@ abstract class AlgorithmIdentifier
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'algorithm' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'algorithm' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'parameters' => [
'type' => ASN1::TYPE_ANY,
'type' => ASN1::TYPE_ANY,
'optional' => true
]
]
]
];
}

View File

@ -27,15 +27,15 @@ use phpseclib3\File\ASN1;
abstract class AnotherName
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'type-id' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 0,
'optional' => true,
'explicit' => true
]
'type-id' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 0,
'optional' => true,
'explicit' => true
]
]
];
}

View File

@ -27,14 +27,14 @@ use phpseclib3\File\ASN1;
abstract class Attribute
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'type' => AttributeType::MAP,
'value' => [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => AttributeValue::MAP
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => AttributeValue::MAP
]
]
];

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class AttributeTypeAndValue
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'type' => AttributeType::MAP,
'value' => AttributeValue::MAP

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class Attributes
{
const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => Attribute::MAP
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class AuthorityInfoAccessSyntax
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => AccessDescription::MAP
];
}

View File

@ -27,23 +27,23 @@ use phpseclib3\File\ASN1;
abstract class AuthorityKeyIdentifier
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'keyIdentifier' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + KeyIdentifier::MAP,
'authorityCertIssuer' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'keyIdentifier' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + KeyIdentifier::MAP,
'authorityCertIssuer' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'authorityCertSerialNumber' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + CertificateSerialNumber::MAP
'constant' => 2,
'optional' => true,
'implicit' => true
] + CertificateSerialNumber::MAP
]
];
}

View File

@ -27,17 +27,17 @@ use phpseclib3\File\ASN1;
abstract class BasicConstraints
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'cA' => [
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'cA' => [
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'pathLenConstraint' => [
'type' => ASN1::TYPE_INTEGER,
'optional' => true
]
'type' => ASN1::TYPE_INTEGER,
'optional' => true
]
]
];
}

View File

@ -27,10 +27,10 @@ use phpseclib3\File\ASN1;
abstract class BuiltInDomainDefinedAttribute
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'type' => ['type' => ASN1::TYPE_PRINTABLE_STRING],
'value' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
'type' => ['type' => ASN1::TYPE_PRINTABLE_STRING],
'value' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class BuiltInDomainDefinedAttributes
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => 4, // ub-domain-defined-attributes
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => 4, // ub-domain-defined-attributes
'children' => BuiltInDomainDefinedAttribute::MAP
];
}

View File

@ -27,45 +27,45 @@ use phpseclib3\File\ASN1;
abstract class BuiltInStandardAttributes
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'country-name' => ['optional' => true] + CountryName::MAP,
'country-name' => ['optional' => true] + CountryName::MAP,
'administration-domain-name' => ['optional' => true] + AdministrationDomainName::MAP,
'network-address' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + NetworkAddress::MAP,
'terminal-identifier' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + TerminalIdentifier::MAP,
'private-domain-name' => [
'constant' => 2,
'optional' => true,
'explicit' => true
] + PrivateDomainName::MAP,
'organization-name' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + OrganizationName::MAP,
'numeric-user-identifier' => [
'constant' => 4,
'optional' => true,
'implicit' => true
] + NumericUserIdentifier::MAP,
'personal-name' => [
'constant' => 5,
'optional' => true,
'implicit' => true
] + PersonalName::MAP,
'organizational-unit-names' => [
'constant' => 6,
'optional' => true,
'implicit' => true
] + OrganizationalUnitNames::MAP
'network-address' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + NetworkAddress::MAP,
'terminal-identifier' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + TerminalIdentifier::MAP,
'private-domain-name' => [
'constant' => 2,
'optional' => true,
'explicit' => true
] + PrivateDomainName::MAP,
'organization-name' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + OrganizationName::MAP,
'numeric-user-identifier' => [
'constant' => 4,
'optional' => true,
'implicit' => true
] + NumericUserIdentifier::MAP,
'personal-name' => [
'constant' => 5,
'optional' => true,
'implicit' => true
] + PersonalName::MAP,
'organizational-unit-names' => [
'constant' => 6,
'optional' => true,
'implicit' => true
] + OrganizationalUnitNames::MAP
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class CRLDistributionPoints
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => DistributionPoint::MAP
];
}

View File

@ -29,17 +29,17 @@ abstract class CRLReason
const MAP = [
'type' => ASN1::TYPE_ENUMERATED,
'mapping' => [
'unspecified',
'keyCompromise',
'cACompromise',
'affiliationChanged',
'superseded',
'cessationOfOperation',
'certificateHold',
// Value 7 is not used.
8 => 'removeFromCRL',
'privilegeWithdrawn',
'aACompromise'
'unspecified',
'keyCompromise',
'cACompromise',
'affiliationChanged',
'superseded',
'cessationOfOperation',
'certificateHold',
// Value 7 is not used.
8 => 'removeFromCRL',
'privilegeWithdrawn',
'aACompromise'
]
];
}

View File

@ -27,11 +27,11 @@ use phpseclib3\File\ASN1;
abstract class Certificate
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'tbsCertificate' => TBSCertificate::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
'tbsCertificate' => TBSCertificate::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
]
];
}

View File

@ -27,11 +27,11 @@ use phpseclib3\File\ASN1;
abstract class CertificateList
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'tbsCertList' => TBSCertList::MAP,
'tbsCertList' => TBSCertList::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class CertificatePolicies
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => PolicyInformation::MAP
];
}

View File

@ -27,11 +27,11 @@ use phpseclib3\File\ASN1;
abstract class CertificationRequest
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'certificationRequestInfo' => CertificationRequestInfo::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
]
];
}

View File

@ -27,19 +27,19 @@ use phpseclib3\File\ASN1;
abstract class CertificationRequestInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1']
],
'subject' => Name::MAP,
'version' => [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1']
],
'subject' => Name::MAP,
'subjectPKInfo' => SubjectPublicKeyInfo::MAP,
'attributes' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + Attributes::MAP,
'attributes' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + Attributes::MAP,
]
];
}

View File

@ -27,13 +27,13 @@ use phpseclib3\File\ASN1;
abstract class CountryName
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
// if class isn't present it's assumed to be \phpseclib3\File\ASN1::CLASS_UNIVERSAL or
// (if constant is present) \phpseclib3\File\ASN1::CLASS_CONTEXT_SPECIFIC
'class' => ASN1::CLASS_APPLICATION,
'cast' => 1,
'class' => ASN1::CLASS_APPLICATION,
'cast' => 1,
'children' => [
'x121-dcc-code' => ['type' => ASN1::TYPE_NUMERIC_STRING],
'x121-dcc-code' => ['type' => ASN1::TYPE_NUMERIC_STRING],
'iso-3166-alpha2-code' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
]
];

View File

@ -32,7 +32,7 @@ abstract class DHParameter
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'prime' => ['type' => ASN1::TYPE_INTEGER],
'base' => ['type' => ASN1::TYPE_INTEGER],
'base' => ['type' => ASN1::TYPE_INTEGER],
'privateValueLength' => [
'type' => ASN1::TYPE_INTEGER,
'optional' => true

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class DigestInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'digestAlgorithm' => AlgorithmIdentifier::MAP,
'digest' => ['type' => ASN1::TYPE_OCTET_STRING]

View File

@ -27,13 +27,13 @@ use phpseclib3\File\ASN1;
abstract class DirectoryString
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'teletexString' => ['type' => ASN1::TYPE_TELETEX_STRING],
'teletexString' => ['type' => ASN1::TYPE_TELETEX_STRING],
'printableString' => ['type' => ASN1::TYPE_PRINTABLE_STRING],
'universalString' => ['type' => ASN1::TYPE_UNIVERSAL_STRING],
'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING],
'bmpString' => ['type' => ASN1::TYPE_BMP_STRING]
'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING],
'bmpString' => ['type' => ASN1::TYPE_BMP_STRING]
]
];
}

View File

@ -27,12 +27,12 @@ use phpseclib3\File\ASN1;
abstract class DisplayText
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'ia5String' => ['type' => ASN1::TYPE_IA5_STRING],
'ia5String' => ['type' => ASN1::TYPE_IA5_STRING],
'visibleString' => ['type' => ASN1::TYPE_VISIBLE_STRING],
'bmpString' => ['type' => ASN1::TYPE_BMP_STRING],
'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING]
'bmpString' => ['type' => ASN1::TYPE_BMP_STRING],
'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING]
]
];
}

View File

@ -27,23 +27,23 @@ use phpseclib3\File\ASN1;
abstract class DistributionPoint
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'distributionPoint' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'reasons' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'cRLIssuer' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'reasons' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'cRLIssuer' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP
]
];
}

View File

@ -27,18 +27,18 @@ use phpseclib3\File\ASN1;
abstract class DistributionPointName
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'fullName' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'fullName' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'nameRelativeToCRLIssuer' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + RelativeDistinguishedName::MAP
'constant' => 1,
'optional' => true,
'implicit' => true
] + RelativeDistinguishedName::MAP
]
];
}

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class DssSigValue
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'r' => ['type' => ASN1::TYPE_INTEGER],
's' => ['type' => ASN1::TYPE_INTEGER]

View File

@ -39,7 +39,7 @@ use phpseclib3\File\ASN1;
abstract class ECParameters
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'namedCurve' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'implicitCurve' => ['type' => ASN1::TYPE_NULL],

View File

@ -27,20 +27,20 @@ use phpseclib3\File\ASN1;
abstract class EDIPartyName
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'nameAssigner' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP,
// partyName is technically required but \phpseclib3\File\ASN1 doesn't currently support non-optional constants and
// setting it to optional gets the job done in any event.
'partyName' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP
'nameAssigner' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP,
// partyName is technically required but \phpseclib3\File\ASN1 doesn't currently support non-optional constants and
// setting it to optional gets the job done in any event.
'partyName' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP
]
];
}

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class EcdsaSigValue
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'r' => ['type' => ASN1::TYPE_INTEGER],
's' => ['type' => ASN1::TYPE_INTEGER]

View File

@ -27,10 +27,10 @@ use phpseclib3\File\ASN1;
abstract class EncryptedPrivateKeyInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'encryptionAlgorithm' => AlgorithmIdentifier::MAP,
'encryptedData' => EncryptedData::MAP
'encryptedData' => EncryptedData::MAP
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class ExtKeyUsageSyntax
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => KeyPurposeId::MAP
];
}

View File

@ -33,14 +33,14 @@ use phpseclib3\File\ASN1;
abstract class Extension
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'extnId' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'extnId' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'critical' => [
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'extnValue' => ['type' => ASN1::TYPE_OCTET_STRING]
]
];

View File

@ -27,20 +27,20 @@ use phpseclib3\File\ASN1;
abstract class ExtensionAttribute
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'extension-attribute-type' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 0,
'optional' => true,
'implicit' => true
],
'extension-attribute-value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 1,
'optional' => true,
'explicit' => true
]
'extension-attribute-type' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 0,
'optional' => true,
'implicit' => true
],
'extension-attribute-value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 1,
'optional' => true,
'explicit' => true
]
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class ExtensionAttributes
{
const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => 256, // ub-extension-attributes
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => 256, // ub-extension-attributes
'children' => ExtensionAttribute::MAP
];
}

View File

@ -27,10 +27,10 @@ use phpseclib3\File\ASN1;
abstract class Extensions
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
// technically, it's MAX, but we'll assume anything < 0 is MAX
'max' => -1,
'max' => -1,
// if 'children' isn't an array then 'min' and 'max' must be defined
'children' => Extension::MAP
];

View File

@ -27,58 +27,58 @@ use phpseclib3\File\ASN1;
abstract class GeneralName
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'otherName' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + AnotherName::MAP,
'rfc822Name' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 1,
'optional' => true,
'implicit' => true
],
'dNSName' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 2,
'optional' => true,
'implicit' => true
],
'x400Address' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + ORAddress::MAP,
'directoryName' => [
'constant' => 4,
'optional' => true,
'explicit' => true
] + Name::MAP,
'ediPartyName' => [
'constant' => 5,
'optional' => true,
'implicit' => true
] + EDIPartyName::MAP,
'otherName' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + AnotherName::MAP,
'rfc822Name' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 1,
'optional' => true,
'implicit' => true
],
'dNSName' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 2,
'optional' => true,
'implicit' => true
],
'x400Address' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + ORAddress::MAP,
'directoryName' => [
'constant' => 4,
'optional' => true,
'explicit' => true
] + Name::MAP,
'ediPartyName' => [
'constant' => 5,
'optional' => true,
'implicit' => true
] + EDIPartyName::MAP,
'uniformResourceIdentifier' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 6,
'optional' => true,
'implicit' => true
],
'iPAddress' => [
'type' => ASN1::TYPE_OCTET_STRING,
'constant' => 7,
'optional' => true,
'implicit' => true
],
'registeredID' => [
'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
'constant' => 8,
'optional' => true,
'implicit' => true
]
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 6,
'optional' => true,
'implicit' => true
],
'iPAddress' => [
'type' => ASN1::TYPE_OCTET_STRING,
'constant' => 7,
'optional' => true,
'implicit' => true
],
'registeredID' => [
'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
'constant' => 8,
'optional' => true,
'implicit' => true
]
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class GeneralNames
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => GeneralName::MAP
];
}

View File

@ -27,20 +27,20 @@ use phpseclib3\File\ASN1;
abstract class GeneralSubtree
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'base' => GeneralName::MAP,
'base' => GeneralName::MAP,
'minimum' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
'default' => '0'
] + BaseDistance::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true,
'default' => '0'
] + BaseDistance::MAP,
'maximum' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
] + BaseDistance::MAP
'constant' => 1,
'optional' => true,
'implicit' => true,
] + BaseDistance::MAP
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class GeneralSubtrees
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => GeneralSubtree::MAP
];
}

View File

@ -29,44 +29,44 @@ abstract class IssuingDistributionPoint
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'distributionPoint' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'onlyContainsUserCerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 1,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlyContainsCACerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 2,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlySomeReasons' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'indirectCRL' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 4,
'optional' => true,
'default' => false,
'implicit' => true
],
'distributionPoint' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'onlyContainsUserCerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 1,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlyContainsCACerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 2,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlySomeReasons' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'indirectCRL' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 4,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlyContainsAttributeCerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 5,
'optional' => true,
'default' => false,
'implicit' => true
]
]
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 5,
'optional' => true,
'default' => false,
'implicit' => true
]
]
];
}

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class KeyUsage
{
const MAP = [
'type' => ASN1::TYPE_BIT_STRING,
'type' => ASN1::TYPE_BIT_STRING,
'mapping' => [
'digitalSignature',
'nonRepudiation',

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class Name
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'rdnSequence' => RDNSequence::MAP
]

View File

@ -27,18 +27,18 @@ use phpseclib3\File\ASN1;
abstract class NameConstraints
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'permittedSubtrees' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP,
'excludedSubtrees' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP,
'excludedSubtrees' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP
]
];
}

View File

@ -27,15 +27,15 @@ use phpseclib3\File\ASN1;
abstract class NoticeReference
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'organization' => DisplayText::MAP,
'organization' => DisplayText::MAP,
'noticeNumbers' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => 200,
'children' => ['type' => ASN1::TYPE_INTEGER]
]
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => 200,
'children' => ['type' => ASN1::TYPE_INTEGER]
]
]
];
}

View File

@ -27,11 +27,11 @@ use phpseclib3\File\ASN1;
abstract class ORAddress
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'built-in-standard-attributes' => BuiltInStandardAttributes::MAP,
'built-in-domain-defined-attributes' => ['optional' => true] + BuiltInDomainDefinedAttributes::MAP,
'extension-attributes' => ['optional' => true] + ExtensionAttributes::MAP
'built-in-standard-attributes' => BuiltInStandardAttributes::MAP,
'built-in-domain-defined-attributes' => ['optional' => true] + BuiltInDomainDefinedAttributes::MAP,
'extension-attributes' => ['optional' => true] + ExtensionAttributes::MAP
]
];
}

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class OneAsymmetricKey
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'type' => ASN1::TYPE_INTEGER,

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class OrganizationalUnitNames
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => 4, // ub-organizational-units
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => 4, // ub-organizational-units
'children' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
];
}

View File

@ -30,9 +30,9 @@ abstract class OtherPrimeInfo
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'prime' => ['type' => ASN1::TYPE_INTEGER], // ri
'exponent' => ['type' => ASN1::TYPE_INTEGER], // di
'coefficient' => ['type' => ASN1::TYPE_INTEGER] // ti
'prime' => ['type' => ASN1::TYPE_INTEGER], // ri
'exponent' => ['type' => ASN1::TYPE_INTEGER], // di
'coefficient' => ['type' => ASN1::TYPE_INTEGER] // ti
]
];
}

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class PBEParameter
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'salt' => ['type' => ASN1::TYPE_OCTET_STRING],
'iterationCount' => ['type' => ASN1::TYPE_INTEGER]

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class PBES2params
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'keyDerivationFunc' => AlgorithmIdentifier::MAP,
'encryptionScheme' => AlgorithmIdentifier::MAP

View File

@ -29,14 +29,14 @@ use phpseclib3\File\ASN1;
abstract class PBKDF2params
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
// technically, this is a CHOICE in RFC2898 but the other "choice" is, currently, more of a placeholder
// in the RFC
'salt' => ['type' => ASN1::TYPE_OCTET_STRING],
'iterationCount' => ['type' => ASN1::TYPE_INTEGER],
'keyLength' => [
'type' => ASN1::TYPE_INTEGER,
'type' => ASN1::TYPE_INTEGER,
'optional' => true
],
'prf' => AlgorithmIdentifier::MAP + ['optional' => true]

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class PBMAC1params
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'keyDerivationFunc' => AlgorithmIdentifier::MAP,
'messageAuthScheme' => AlgorithmIdentifier::MAP

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class PKCS9String
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'ia5String' => ['type' => ASN1::TYPE_IA5_STRING],
'ia5String' => ['type' => ASN1::TYPE_IA5_STRING],
'directoryString' => DirectoryString::MAP
]
];

View File

@ -29,9 +29,9 @@ abstract class Pentanomial
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'k1' => ['type' => ASN1::TYPE_INTEGER], // k1 > 0
'k2' => ['type' => ASN1::TYPE_INTEGER], // k2 > k1
'k3' => ['type' => ASN1::TYPE_INTEGER], // k3 > h2
'k1' => ['type' => ASN1::TYPE_INTEGER], // k1 > 0
'k2' => ['type' => ASN1::TYPE_INTEGER], // k2 > k1
'k3' => ['type' => ASN1::TYPE_INTEGER], // k3 > h2
]
];
}

View File

@ -27,32 +27,32 @@ use phpseclib3\File\ASN1;
abstract class PersonalName
{
const MAP = [
'type' => ASN1::TYPE_SET,
'type' => ASN1::TYPE_SET,
'children' => [
'surname' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 0,
'optional' => true,
'implicit' => true
],
'given-name' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 1,
'optional' => true,
'implicit' => true
],
'initials' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 2,
'optional' => true,
'implicit' => true
],
'surname' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 0,
'optional' => true,
'implicit' => true
],
'given-name' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 1,
'optional' => true,
'implicit' => true
],
'initials' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 2,
'optional' => true,
'implicit' => true
],
'generation-qualifier' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 3,
'optional' => true,
'implicit' => true
]
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 3,
'optional' => true,
'implicit' => true
]
]
];
}

View File

@ -27,16 +27,16 @@ use phpseclib3\File\ASN1;
abstract class PolicyInformation
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'policyIdentifier' => CertPolicyId::MAP,
'policyQualifiers' => [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 0,
'max' => -1,
'optional' => true,
'children' => PolicyQualifierInfo::MAP
]
'type' => ASN1::TYPE_SEQUENCE,
'min' => 0,
'max' => -1,
'optional' => true,
'children' => PolicyQualifierInfo::MAP
]
]
];
}

View File

@ -27,15 +27,15 @@ use phpseclib3\File\ASN1;
abstract class PolicyMappings
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'issuerDomainPolicy' => CertPolicyId::MAP,
'subjectDomainPolicy' => CertPolicyId::MAP
]
]
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'issuerDomainPolicy' => CertPolicyId::MAP,
'subjectDomainPolicy' => CertPolicyId::MAP
]
]
];
}

View File

@ -27,10 +27,10 @@ use phpseclib3\File\ASN1;
abstract class PolicyQualifierInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'policyQualifierId' => PolicyQualifierId::MAP,
'qualifier' => ['type' => ASN1::TYPE_ANY]
'qualifier' => ['type' => ASN1::TYPE_ANY]
]
];
}

View File

@ -27,10 +27,10 @@ use phpseclib3\File\ASN1;
abstract class PostalAddress
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'optional' => true,
'min' => 1,
'max' => -1,
'min' => 1,
'max' => -1,
'children' => DirectoryString::MAP
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class PrivateDomainName
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'numeric' => ['type' => ASN1::TYPE_NUMERIC_STRING],
'numeric' => ['type' => ASN1::TYPE_NUMERIC_STRING],
'printable' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
]
];

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class PrivateKeyInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'type' => ASN1::TYPE_INTEGER,

View File

@ -27,18 +27,18 @@ use phpseclib3\File\ASN1;
abstract class PrivateKeyUsagePeriod
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'notBefore' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
'type' => ASN1::TYPE_GENERALIZED_TIME],
'notAfter' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
'type' => ASN1::TYPE_GENERALIZED_TIME]
'constant' => 0,
'optional' => true,
'implicit' => true,
'type' => ASN1::TYPE_GENERALIZED_TIME],
'notAfter' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
'type' => ASN1::TYPE_GENERALIZED_TIME]
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class PublicKeyAndChallenge
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'spki' => SubjectPublicKeyInfo::MAP,
'spki' => SubjectPublicKeyInfo::MAP,
'challenge' => ['type' => ASN1::TYPE_IA5_STRING]
]
];

View File

@ -30,7 +30,7 @@ use phpseclib3\File\ASN1;
abstract class PublicKeyInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'publicKeyAlgorithm' => AlgorithmIdentifier::MAP,
'publicKey' => ['type' => ASN1::TYPE_BIT_STRING]

View File

@ -29,10 +29,10 @@ use phpseclib3\File\ASN1;
abstract class RC2CBCParameter
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'rc2ParametersVersion' => [
'type' => ASN1::TYPE_INTEGER,
'type' => ASN1::TYPE_INTEGER,
'optional' => true
],
'iv' => ['type' => ASN1::TYPE_OCTET_STRING]

View File

@ -33,10 +33,10 @@ use phpseclib3\File\ASN1;
abstract class RDNSequence
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
// RDNSequence does not define a min or a max, which means it doesn't have one
'min' => 0,
'max' => -1,
'min' => 0,
'max' => -1,
'children' => RelativeDistinguishedName::MAP
];
}

View File

@ -34,14 +34,14 @@ abstract class RSAPrivateKey
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['two-prime', 'multi']
],
'modulus' => ['type' => ASN1::TYPE_INTEGER], // n
'publicExponent' => ['type' => ASN1::TYPE_INTEGER], // e
'modulus' => ['type' => ASN1::TYPE_INTEGER], // n
'publicExponent' => ['type' => ASN1::TYPE_INTEGER], // e
'privateExponent' => ['type' => ASN1::TYPE_INTEGER], // d
'prime1' => ['type' => ASN1::TYPE_INTEGER], // p
'prime2' => ['type' => ASN1::TYPE_INTEGER], // q
'exponent1' => ['type' => ASN1::TYPE_INTEGER], // d mod (p-1)
'exponent2' => ['type' => ASN1::TYPE_INTEGER], // d mod (q-1)
'coefficient' => ['type' => ASN1::TYPE_INTEGER], // (inverse of q) mod p
'prime1' => ['type' => ASN1::TYPE_INTEGER], // p
'prime2' => ['type' => ASN1::TYPE_INTEGER], // q
'exponent1' => ['type' => ASN1::TYPE_INTEGER], // d mod (p-1)
'exponent2' => ['type' => ASN1::TYPE_INTEGER], // d mod (q-1)
'coefficient' => ['type' => ASN1::TYPE_INTEGER], // (inverse of q) mod p
'otherPrimeInfos' => OtherPrimeInfos::MAP + ['optional' => true]
]
];

View File

@ -29,8 +29,8 @@ abstract class RSAPublicKey
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'modulus' => ['type' => ASN1::TYPE_INTEGER],
'publicExponent' => ['type' => ASN1::TYPE_INTEGER]
'modulus' => ['type' => ASN1::TYPE_INTEGER],
'publicExponent' => ['type' => ASN1::TYPE_INTEGER]
]
];
}

View File

@ -29,9 +29,9 @@ use phpseclib3\File\ASN1;
abstract class RSASSA_PSS_params
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'hashAlgorithm' => [
'hashAlgorithm' => [
'constant' => 0,
'optional' => true,
'explicit' => true,
@ -43,19 +43,19 @@ abstract class RSASSA_PSS_params
'explicit' => true,
//'default' => 'mgf1SHA1Identifier'
] + MaskGenAlgorithm::MAP,
'saltLength' => [
'type' => ASN1::TYPE_INTEGER,
'saltLength' => [
'type' => ASN1::TYPE_INTEGER,
'constant' => 2,
'optional' => true,
'explicit' => true,
'default' => 20
'default' => 20
],
'trailerField' => [
'type' => ASN1::TYPE_INTEGER,
'trailerField' => [
'type' => ASN1::TYPE_INTEGER,
'constant' => 3,
'optional' => true,
'explicit' => true,
'default' => 1
'default' => 1
]
]
];

View File

@ -27,7 +27,7 @@ use phpseclib3\File\ASN1;
abstract class ReasonFlags
{
const MAP = [
'type' => ASN1::TYPE_BIT_STRING,
'type' => ASN1::TYPE_BIT_STRING,
'mapping' => [
'unused',
'keyCompromise',

View File

@ -33,9 +33,9 @@ use phpseclib3\File\ASN1;
abstract class RelativeDistinguishedName
{
const MAP = [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => AttributeTypeAndValue::MAP
];
}

View File

@ -27,13 +27,13 @@ use phpseclib3\File\ASN1;
abstract class RevokedCertificate
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'userCertificate' => CertificateSerialNumber::MAP,
'revocationDate' => Time::MAP,
'crlEntryExtensions' => [
'optional' => true
] + Extensions::MAP
]
'userCertificate' => CertificateSerialNumber::MAP,
'revocationDate' => Time::MAP,
'crlEntryExtensions' => [
'optional' => true
] + Extensions::MAP
]
];
}

View File

@ -27,11 +27,11 @@ use phpseclib3\File\ASN1;
abstract class SignedPublicKeyAndChallenge
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'publicKeyAndChallenge' => PublicKeyAndChallenge::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
]
];
}

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class SpecifiedECDomain
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'type' => ASN1::TYPE_INTEGER,

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class SubjectDirectoryAttributes
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => Attribute::MAP
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class SubjectInfoAccessSyntax
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'type' => ASN1::TYPE_SEQUENCE,
'min' => 1,
'max' => -1,
'children' => AccessDescription::MAP
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class SubjectPublicKeyInfo
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'algorithm' => AlgorithmIdentifier::MAP,
'algorithm' => AlgorithmIdentifier::MAP,
'subjectPublicKey' => ['type' => ASN1::TYPE_BIT_STRING]
]
];

View File

@ -27,32 +27,32 @@ use phpseclib3\File\ASN1;
abstract class TBSCertList
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1', 'v2', 'v3'],
'optional' => true,
'default' => 'v2'
],
'signature' => AlgorithmIdentifier::MAP,
'issuer' => Name::MAP,
'thisUpdate' => Time::MAP,
'nextUpdate' => [
'optional' => true
] + Time::MAP,
'version' => [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1', 'v2', 'v3'],
'optional' => true,
'default' => 'v2'
],
'signature' => AlgorithmIdentifier::MAP,
'issuer' => Name::MAP,
'thisUpdate' => Time::MAP,
'nextUpdate' => [
'optional' => true
] + Time::MAP,
'revokedCertificates' => [
'type' => ASN1::TYPE_SEQUENCE,
'optional' => true,
'min' => 0,
'max' => -1,
'children' => RevokedCertificate::MAP
],
'crlExtensions' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + Extensions::MAP
'type' => ASN1::TYPE_SEQUENCE,
'optional' => true,
'min' => 0,
'max' => -1,
'children' => RevokedCertificate::MAP
],
'crlExtensions' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + Extensions::MAP
]
];
}

View File

@ -28,42 +28,42 @@ abstract class TBSCertificate
{
// assert($TBSCertificate['children']['signature'] == $Certificate['children']['signatureAlgorithm'])
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
// technically, default implies optional, but we'll define it as being optional, none-the-less, just to
// reenforce that fact
'version' => [
'type' => ASN1::TYPE_INTEGER,
'constant' => 0,
'optional' => true,
'explicit' => true,
'mapping' => ['v1', 'v2', 'v3'],
'default' => 'v1'
],
'serialNumber' => CertificateSerialNumber::MAP,
'signature' => AlgorithmIdentifier::MAP,
'issuer' => Name::MAP,
'validity' => Validity::MAP,
'subject' => Name::MAP,
'version' => [
'type' => ASN1::TYPE_INTEGER,
'constant' => 0,
'optional' => true,
'explicit' => true,
'mapping' => ['v1', 'v2', 'v3'],
'default' => 'v1'
],
'serialNumber' => CertificateSerialNumber::MAP,
'signature' => AlgorithmIdentifier::MAP,
'issuer' => Name::MAP,
'validity' => Validity::MAP,
'subject' => Name::MAP,
'subjectPublicKeyInfo' => SubjectPublicKeyInfo::MAP,
// implicit means that the T in the TLV structure is to be rewritten, regardless of the type
'issuerUniqueID' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + UniqueIdentifier::MAP,
'subjectUniqueID' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + UniqueIdentifier::MAP,
'issuerUniqueID' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + UniqueIdentifier::MAP,
'subjectUniqueID' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + UniqueIdentifier::MAP,
// <http://tools.ietf.org/html/rfc2459#page-74> doesn't use the EXPLICIT keyword but if
// it's not IMPLICIT, it's EXPLICIT
'extensions' => [
'constant' => 3,
'optional' => true,
'explicit' => true
] + Extensions::MAP
'extensions' => [
'constant' => 3,
'optional' => true,
'explicit' => true
] + Extensions::MAP
]
];
}

View File

@ -27,9 +27,9 @@ use phpseclib3\File\ASN1;
abstract class Time
{
const MAP = [
'type' => ASN1::TYPE_CHOICE,
'type' => ASN1::TYPE_CHOICE,
'children' => [
'utcTime' => ['type' => ASN1::TYPE_UTC_TIME],
'utcTime' => ['type' => ASN1::TYPE_UTC_TIME],
'generalTime' => ['type' => ASN1::TYPE_GENERALIZED_TIME]
]
];

View File

@ -27,16 +27,16 @@ use phpseclib3\File\ASN1;
abstract class UserNotice
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'noticeRef' => [
'optional' => true,
'implicit' => true
] + NoticeReference::MAP,
'explicitText' => [
'optional' => true,
'implicit' => true
] + DisplayText::MAP
'optional' => true,
'implicit' => true
] + NoticeReference::MAP,
'explicitText' => [
'optional' => true,
'implicit' => true
] + DisplayText::MAP
]
];
}

View File

@ -27,10 +27,10 @@ use phpseclib3\File\ASN1;
abstract class Validity
{
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'notBefore' => Time::MAP,
'notAfter' => Time::MAP
'notAfter' => Time::MAP
]
];
}

View File

@ -29,7 +29,7 @@ use phpseclib3\File\ASN1;
abstract class netscape_cert_type
{
const MAP = [
'type' => ASN1::TYPE_BIT_STRING,
'type' => ASN1::TYPE_BIT_STRING,
'mapping' => [
'SSLClient',
'SSLServer',