ExplicitlyTaggedObject
extends ASNObject
in package
Class ExplicitlyTaggedObject decorate an inner object with an additional tag that gives information about its context specific meaning.
Explanation taken from A Layman's Guide to a Subset of ASN.1, BER, and DER:
An RSA Laboratories Technical Note Burton S. Kaliski Jr. Revised November 1, 1993
[...] Explicitly tagged types are derived from other types by adding an outer tag to the underlying type. In effect, explicitly tagged types are structured types consisting of one component, the underlying type. Explicit tagging is denoted by the ASN.1 keywords [class number] EXPLICIT (see Section 5.2). [...]
Tags
Table of Contents
Properties
- $contentLength : mixed
- $decoratedObjects : array<string|int, ASNObject>
- $nrOfLengthOctets : mixed
- $tag : mixed
Methods
- __construct() : mixed
- __toString() : mixed
- fromBinary() : ASNObject
- Parse an instance of this class from its binary DER encoded representation.
- getBinary() : string
- Encode this object using DER encoding.
- getContent() : mixed
- Return the content of this object in a non encoded form.
- getIdentifier() : string
- Returns all identifier octets. If an inheriting class models a tag with the long form identifier format, it MUST reimplement this method to return all octets of the identifier.
- getObjectLength() : mixed
- Returns the length of the whole object (including the identifier and length octets).
- getTag() : mixed
- getType() : int
- Return the object type octet.
- getTypeName() : mixed
- Returns the name of the ASN.1 Type of this object.
- calculateContentLength() : int
- Must return the number of octets of the content part.
- getContentLength() : mixed
- getEncodedValue() : string
- Encode the object using DER encoding.
- getNumberOfLengthOctets() : mixed
- parseBinaryIdentifier() : mixed
- parseContentLength() : mixed
- parseIdentifier() : mixed
- setContentLength() : mixed
- createLengthPart() : mixed
Properties
$contentLength
private
mixed
$contentLength
$decoratedObjects
private
array<string|int, ASNObject>
$decoratedObjects
$nrOfLengthOctets
private
mixed
$nrOfLengthOctets
$tag
private
mixed
$tag
Methods
__construct()
public
__construct(int $tag, ASNObject ...$objects) : mixed
Parameters
- $tag : int
- $objects : ASNObject
-
,...
__toString()
public
__toString() : mixed
fromBinary()
Parse an instance of this class from its binary DER encoded representation.
public
static fromBinary(mixed &$binaryData[, mixed &$offsetIndex = 0 ]) : ASNObject
Parameters
- $binaryData : mixed
- $offsetIndex : mixed = 0
Return values
ASNObjectgetBinary()
Encode this object using DER encoding.
public
getBinary() : string
Return values
string —the full binary representation of the complete object
getContent()
Return the content of this object in a non encoded form.
public
getContent() : mixed
This can be used to print the value in human readable form.
getIdentifier()
Returns all identifier octets. If an inheriting class models a tag with the long form identifier format, it MUST reimplement this method to return all octets of the identifier.
public
getIdentifier() : string
Return values
string —Identifier as a set of octets
getObjectLength()
Returns the length of the whole object (including the identifier and length octets).
public
getObjectLength() : mixed
getTag()
public
getTag() : mixed
getType()
Return the object type octet.
public
getType() : int
This should use the class constants of Identifier.
Return values
intgetTypeName()
Returns the name of the ASN.1 Type of this object.
public
getTypeName() : mixed
Tags
calculateContentLength()
Must return the number of octets of the content part.
protected
calculateContentLength() : int
Return values
intgetContentLength()
protected
getContentLength() : mixed
getEncodedValue()
Encode the object using DER encoding.
protected
getEncodedValue() : string
Return values
string —the binary representation of an objects value
getNumberOfLengthOctets()
protected
getNumberOfLengthOctets([mixed $contentLength = null ]) : mixed
Parameters
- $contentLength : mixed = null
parseBinaryIdentifier()
protected
static parseBinaryIdentifier(mixed $binaryData, mixed &$offsetIndex) : mixed
Parameters
- $binaryData : mixed
- $offsetIndex : mixed
parseContentLength()
protected
static parseContentLength(mixed &$binaryData, mixed &$offsetIndex[, mixed $minimumLength = 0 ]) : mixed
Parameters
- $binaryData : mixed
- $offsetIndex : mixed
- $minimumLength : mixed = 0
parseIdentifier()
protected
static parseIdentifier(mixed $identifierOctet, mixed $expectedIdentifier, mixed $offsetForExceptionHandling) : mixed
Parameters
- $identifierOctet : mixed
- $expectedIdentifier : mixed
- $offsetForExceptionHandling : mixed
setContentLength()
protected
setContentLength(mixed $newContentLength) : mixed
Parameters
- $newContentLength : mixed
createLengthPart()
private
createLengthPart() : mixed