SetaPDF_Signer_Asn1_Element Class representing an ASN.1 element.

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

Class hierarchy

Summary

Constants

BIT_STRING

const SetaPDF_Signer_Asn1_Element::BIT_STRING = ''

Subtype constant

BMPSTRING

const SetaPDF_Signer_Asn1_Element::BMPSTRING = ''

Subtype constant

BOOLEAN

const SetaPDF_Signer_Asn1_Element::BOOLEAN = ''

Subtype constant

ENUMERATED

const SetaPDF_Signer_Asn1_Element::ENUMERATED = ' '

Subtype constant

EXTERNAL

const SetaPDF_Signer_Asn1_Element::EXTERNAL = ''

Subtype constant

GENERALIZED_TIME

const SetaPDF_Signer_Asn1_Element::GENERALIZED_TIME = ''

Subtype constant

GENERAL_STRING

const SetaPDF_Signer_Asn1_Element::GENERAL_STRING = ''

Subtype constant

GRAPHIC_STRING

const SetaPDF_Signer_Asn1_Element::GRAPHIC_STRING = ''

Subtype constant

IA5_STRING

const SetaPDF_Signer_Asn1_Element::IA5_STRING = ''

Subtype constant

INTEGER

const SetaPDF_Signer_Asn1_Element::INTEGER = ''

Subtype constant

IS_CONSTRUCTED

const SetaPDF_Signer_Asn1_Element::IS_CONSTRUCTED = ' '

Constructed?

NULL

const SetaPDF_Signer_Asn1_Element::NULL = ''

Subtype constant

NUMERIC_STRING

const SetaPDF_Signer_Asn1_Element::NUMERIC_STRING = ''

Subtype constant

OBJECT_DESCRIPTOR

const SetaPDF_Signer_Asn1_Element::OBJECT_DESCRIPTOR = ''

Subtype constant

OBJECT_IDENTIFIER

const SetaPDF_Signer_Asn1_Element::OBJECT_IDENTIFIER = ''

Subtype constant

OCTET_STRING

const SetaPDF_Signer_Asn1_Element::OCTET_STRING = ''

Subtype constant

PRINTABLE_STRING

const SetaPDF_Signer_Asn1_Element::PRINTABLE_STRING = ''

Subtype constant

REAL

const SetaPDF_Signer_Asn1_Element::REAL = ' '

Subtype constant

RELATIVE_OID

const SetaPDF_Signer_Asn1_Element::RELATIVE_OID = ' '

Subtype constant

SEQUENCE

const SetaPDF_Signer_Asn1_Element::SEQUENCE = ''

Subtype constant

SET

const SetaPDF_Signer_Asn1_Element::SET = ''

Subtype constant

T61_STRING

const SetaPDF_Signer_Asn1_Element::T61_STRING = ''

Subtype constant

TAG_CLASS_APPLICATION

const SetaPDF_Signer_Asn1_Element::TAG_CLASS_APPLICATION = '@'

Tag class constant

TAG_CLASS_CONTEXT_SPECIFIC

const SetaPDF_Signer_Asn1_Element::TAG_CLASS_CONTEXT_SPECIFIC =

Tag class constant

TAG_CLASS_MASK

const SetaPDF_Signer_Asn1_Element::TAG_CLASS_MASK =

Tag class constant

TAG_CLASS_PRIVATE

const SetaPDF_Signer_Asn1_Element::TAG_CLASS_PRIVATE =

Tag class constant

TAG_CLASS_UNIVERSAL

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

Tag class constant

TAG_MASK

const SetaPDF_Signer_Asn1_Element::TAG_MASK = ''

Tag mask

UNIVERSAL_STRING

const SetaPDF_Signer_Asn1_Element::UNIVERSAL_STRING = ''

Subtype constant

UTC_TIME

const SetaPDF_Signer_Asn1_Element::UTC_TIME = ''

Subtype constant

UTF8_STRING

const SetaPDF_Signer_Asn1_Element::UTF8_STRING = ' '

Subtype constant

VIDEOTEXT_STRING

const SetaPDF_Signer_Asn1_Element::VIDEOTEXT_STRING = ''

Subtype constant

VISIBLE_STRING

const SetaPDF_Signer_Asn1_Element::VISIBLE_STRING = ''

Subtype constant


Properties

$_children

protected array SetaPDF_Signer_Asn1_Element::$_children = array()

Array of SetaPDF_Signer_Asn1_Element

Array of child nodes

$_ident

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

The ident tag

$_parent

protected SetaPDF_Signer_Asn1_Element SetaPDF_Signer_Asn1_Element::$_parent

The parent node

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

Get child nodes.

Return Values

Array of SetaPDF_Signer_Asn1_Element

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 (
[ array $children = array ( ) ]
): void

Set child nodes.

Parameters
$children : array

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