Is buying and smoking CBD allowed in Germany?

I'm confused about it, every piece of information about it seems confusing on the internet

I ran into some CBD online stores and even a 24-hour machine that I could buy cbd there

  • is it allowed for everyone or do I need a prescription for that?
  • if it's allowed, if the police see me carrying CBD I would have to prove to them that it's not THC?