Lines Matching refs:encoded

8  * ASN.1 provides the semantics for data encoded using various schemes.  The most commonly
9 * utilized scheme is DER or the "Distinguished Encoding Rules". PEM's are base64 encoded
132 private static $encoded;
191 * @param Element|string $encoded
194 public static function decodeBER($encoded)
196 if ($encoded instanceof Element) {
197 $encoded = $encoded->element;
200 self::$encoded = $encoded;
202 $decoded = self::decode_ber($encoded);
214 * $encoded is passed by reference for the recursive calls done for self::TYPE_BIT_STRING and
217 * @param string $encoded
222 private static function decode_ber($encoded, $start = 0, $encoded_pos = 0)
226 if (!isset($encoded[$encoded_pos])) {
229 $type = ord($encoded[$encoded_pos++]);
239 if (!isset($encoded[$encoded_pos])) {
242 $temp = ord($encoded[$encoded_pos++]);
258 if (!isset($encoded[$encoded_pos])) {
261 $length = ord($encoded[$encoded_pos++]);
266 $length = strlen($encoded) - $encoded_pos;
271 $temp = substr($encoded, $encoded_pos, $length);
282 if ($length > (strlen($encoded) - $encoded_pos)) {
286 $content = substr($encoded, $encoded_pos, $length);
457 /* Each character string type shall be encoded as if it had been declared:
529 if (isset($decoded['constant']) || !array_key_exists($intype, self::ANY_MAP) || (ord(self::$encoded[$decoded['start']]) & 0x20)) {
530 return new Element(substr(self::$encoded, $decoded['start'], $decoded['length']));
750 arbitrarily any trailing 0 bits to (or from) values that are being encoded or decoded. Application designers should
1449 /* X.509 certs are assumed to be base64 encoded but sometimes they'll have additional things in them