value = $value; } } /** * Gets the byte array stored as value. * * @return array byte array */ public function getValue() { return $this->value; } /** * Encodes the contents of this ASN1 Octet String. * * @return array DER encoding of this octet string */ public function encodeDER() { $bytes = array(); $this->append($bytes, ASN1DER::encodeType(ASN1_TAG_OCTET_STRING)); $this->append($bytes, ASN1DER::encodeLength(count($this->value))); $this->append($bytes, $this->value); return $bytes; } /** * Decodes an ASN.1 Octet String from the given byte stream. * * @param $bytes V bytes of this ASN.1 Octet String TLV * @return void */ public function decodeDER($bytes) { $this->value = $bytes; } } ?>