SetaPDF_Signer_Asn1_Element Class representing an ASN.1 element.

File: /SetaPDF v2/Signer/Asn1/Element.php

Class hierarchy

Implements

Summary

Constants

BIT_STRING

Subtype constant

BMPSTRING

Subtype constant

BOOLEAN

Subtype constant

ENUMERATED

Subtype constant

EXTERNAL

Subtype constant

GENERALIZED_TIME

Subtype constant

GENERAL_STRING

Subtype constant

GRAPHIC_STRING

Subtype constant

IA5_STRING

Subtype constant

INTEGER

Subtype constant

IS_CONSTRUCTED

Constructed?

NULL

public const SetaPDF_Signer_Asn1_Element::NULL = ''

Subtype constant

NUMERIC_STRING

Subtype constant

OBJECT_DESCRIPTOR

Subtype constant

OBJECT_IDENTIFIER

Subtype constant

OCTET_STRING

Subtype constant

PRINTABLE_STRING

Subtype constant

REAL

public const SetaPDF_Signer_Asn1_Element::REAL = ' '

Subtype constant

RELATIVE_OID

Subtype constant

SEQUENCE

Subtype constant

SET

public const SetaPDF_Signer_Asn1_Element::SET = ''

Subtype constant

T61_STRING

Subtype constant

TAG_CLASS_APPLICATION

Tag class constant

TAG_CLASS_CONTEXT_SPECIFIC

Tag class constant

TAG_CLASS_MASK

Tag class constant

TAG_CLASS_PRIVATE

Tag class constant

TAG_CLASS_UNIVERSAL

public const SetaPDF_Signer_Asn1_Element::TAG_CLASS_UNIVERSAL = '' . "\0" . ''

Tag class constant

TAG_MASK

Tag mask

UNIVERSAL_STRING

Subtype constant

UTC_TIME

Subtype constant

UTF8_STRING

Subtype constant

VIDEOTEXT_STRING

Subtype constant

VISIBLE_STRING

Subtype constant


Properties

$_children

protected array SetaPDF_Signer_Asn1_Element::$_children = array()

Array of child nodes

Array of SetaPDF_Signer_Asn1_Element

$_ident

protected string SetaPDF_Signer_Asn1_Element::$_ident = '' . "\0" . ''

The ident tag

$_value

protected string SetaPDF_Signer_Asn1_Element::$_value = ''

The byte value


Static Methods

_parse()

protected static SetaPDF_Signer_Asn1_Element::_parse (
string $s [, integer &$p = 0 [, boolean $outer = false ]]
): array

Parses a BER encoded string or sequence.

Parameters
$s : string
 
$p : integer
 
$outer : boolean
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

findByOid()

Finds a node by OID.

Parameters
$oid : string

OID in dot form

$value : SetaPDF_Signer_Asn1_Element

Root node to start from

findByPath()

Finds a node by a path.

Parameters
$path : string

A string defining the path of the node (e.g. 1/2/3/5)

$value : SetaPDF_Signer_Asn1_Element
 

lengthToDer()

public static SetaPDF_Signer_Asn1_Element::lengthToDer (
integer $length
): string

Returns the length byte in DER encoding.

Parameters
$length : integer
 

parse()

Parses a BER encoded string.

Parameters
$s : string
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception


Methods

__construct()

public SetaPDF_Signer_Asn1_Element::__construct (
string $ident [, string $value = '' [, array $children = array ( ) ]]
)

The constructor.

Parameters
$ident : string

The identifier byte

$value : string

The value in binary form

$children : array

Array of SetaPDF_Signer_Asn1_Element instances

__toString()

public SetaPDF_Signer_Asn1_Element::__toString (
void
): string

Returns the BER encoded string.

addChild()

Add a child node.

Parameters
$child : SetaPDF_Signer_Asn1_Element
 

getChild()

Get a child by Id.

Parameters
$id : integer
 

getChildCount()

Get the child count.

getChildren()

getIdent()

public SetaPDF_Signer_Asn1_Element::getIdent (
void
): string

Get the identifier byte.

getParent()

getValue()

public SetaPDF_Signer_Asn1_Element::getValue (
void
): string

Get the value.

removeChild()

Remove a child node.

Parameters
$child : SetaPDF_Signer_Asn1_Element
 

setChildren()

public SetaPDF_Signer_Asn1_Element::setChildren (
[ SetaPDF_Signer_Asn1_Element[] $children = array ( ) ]
): void

Set child nodes.

Parameters
$children : SetaPDF_Signer_Asn1_Element[]

Array of SetaPDF_Signer_Asn1_Element instances

setIdent()

public SetaPDF_Signer_Asn1_Element::setIdent (
string $ident
): void

Set the identifier byte.

Parameters
$ident : string
 

setParent()

Set parent node.

Parameters
$parent : SetaPDF_Signer_Asn1_Element
 

setValue()

public SetaPDF_Signer_Asn1_Element::setValue (
string $value
): void

Set the value.

Parameters
$value : string

Value in binary form