Skip to content
Mo McRoberts edited this page Aug 7, 2011 · 1 revision

Decode a BER-encoded ASN.1 structure.

Synopsis

uses('asn1');

public static function array [[ASN1]]::decodeBER(string [in] $binary)

Description

ASN1::decodeBER() provides limited support for decoding a binary ASN.1 structure which was encoded using the Basic Encoding Rules (BER), such as X.509 certificate data. Each member of the returned array is itself an associative array with the following fields: $type, $pc, $class, $len, and $data (note that $data is base-64 encoded). For entries which are sequences, the $sequence member is an indexed array of structures. For entries which are bit-strings, the $value member is set to the value of the bit-string, and the $unused member is set to the number of leading unused bits in the string.

Parameters

Name Direction Type Description
$binary in string The BER-encoded ASN.1 structure

Return Value

An indexed array representing the ASN.1 structure.

Clone this wiki locally