The following theorem can be found in Murphy's C*-algebra and operator theory book. I changed the letters in the theorem according to your question.
> **Theorem**. Let $A$ be a C*-subalgebra for a C*-algebra $B$. Then $A$ is hereditary in $B$ if and only if $aba'\in A$ for all $a,a'\in A$ and $b\in B$.