SetaPDF_Signer_Asn1_Element Class representing an ASN.1 element.

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

Class hierarchy

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

Subtype constant

NUMERIC_STRING

Subtype constant

OBJECT_DESCRIPTOR

Subtype constant

OBJECT_IDENTIFIER

Subtype constant

OCTET_STRING

Subtype constant

PRINTABLE_STRING

Subtype constant

REAL

Subtype constant

RELATIVE_OID

Subtype constant

SEQUENCE

Subtype constant

SET

Subtype constant

T61_STRING

Subtype constant

TAG_CLASS_APPLICATION

Tag class constant

TAG_CLASS_CONTEXT_SPECIFIC

TAG_CLASS_MASK

Tag class constant

TAG_CLASS_PRIVATE

Tag class constant

TAG_CLASS_UNIVERSAL

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 Array of SetaPDF_Signer_Asn1_Element SetaPDF_Signer_Asn1_Element::$_children = array()

Array of child nodes

$_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()

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

Parses a BER encoded string or sequence.

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

Throws SetaPDF_Signer_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()

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

Returns the length byte in DER encoding.

Parameters
$length : integer
 

parse()

Parses a BER encoded string.

Parameters
$s : string
 
Exceptions

Throws SetaPDF_Signer_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 string SetaPDF_Signer_Asn1_Element::__toString ( void )

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()

Get child nodes.

Return Values

Array of SetaPDF_Signer_Asn1_Element

getIdent()

public string SetaPDF_Signer_Asn1_Element::getIdent ( void )

Get the identifier byte.

getParent()

getValue()

public string SetaPDF_Signer_Asn1_Element::getValue ( void )

Get the value.

removeChild()

Remove a child node.

Parameters
$child : SetaPDF_Signer_Asn1_Element
 

setChildren()

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

Set child nodes.

Parameters
$children : array

Array of SetaPDF_Signer_Asn1_Element instances

setIdent()

public void SetaPDF_Signer_Asn1_Element::setIdent ( string $ident )

Set the identifier byte.

Parameters
$ident : string
 

setParent()

Set parent node.

Parameters
$parent : SetaPDF_Signer_Asn1_Element
 

setValue()

public void SetaPDF_Signer_Asn1_Element::setValue ( string $value )

Set the value.

Parameters
$value : string

Value in binary form