On premises habitat builder keys

How to download private and public key using jenkins library so that i can run in multiple slaves by placing that key in hab/cache/keys folder

 Am creating jenkins Declarative pipeline since on premises depot dont have a feature to connect to plan.sh in github.