CLASS_UNIVERSAL
CLASS_UNIVERSAL
Pure-PHP ASN.1 Parser
_decode_ber(string $encoded, integer $start, integer $encoded_pos) : array
Parse BER-encoding (Helper function)
Sometimes we want to get the BER encoding of a particular tag. $start lets us do that without having to reencode. $encoded is passed by reference for the recursive calls done for self::TYPE_BIT_STRING and self::TYPE_OCTET_STRING. In those cases, the indefinite length is used.
string | $encoded | |
integer | $start | |
integer | $encoded_pos |
asn1map(array $decoded, array $mapping, array $special = array()) : array
ASN.1 Map
Provides an ASN.1 semantic mapping ($mapping) from a parsed BER-encoding to a human readable format.
"Special" mappings may be applied on a per tag-name basis via $special.
array | $decoded | |
array | $mapping | |
array | $special |
encodeDER(string $source, string $mapping, $special = array()) : string
ASN.1 Encode
DER-encodes an ASN.1 semantic mapping ($mapping). Some libraries would probably call this function an ASN.1 compiler.
"Special" mappings can be applied via $special.
string | $source | |
string | $mapping | |
$special |
_encodeLength(integer $length) : string
DER-encode the length
DER supports lengths up to (28)127, however, we'll only support lengths up to (28)4. See X.690 paragraph 8.1.3 for more information.
integer | $length |