The tl;dr version:
Programmer: store this key securely Library: stores key on the heap Library maintainer: working as designed.
Programmer: store this key securely Library: stores key on the heap Library maintainer: working as designed.
Many things like https and ssh servers store secrets on the heap when they are in use.