# Chef-Vault examples of encrypting in recipes?

**URL:** <https://discourse.chef.io/t/chef-vault-examples-of-encrypting-in-recipes/4906>\
**Category:** Chef Infra (archive)\
**Created:** [January 16, 2014, 11:06pm UTC](https://discourse.chef.io/t/chef-vault-examples-of-encrypting-in-recipes/4906 "2014-01-16T23:06:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamil\_Markowicz](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kamil\_Markowicz](https://discourse.chef.io/u/Kamil_Markowicz)\
**Post date:** [January 16, 2014, 11:06pm UTC](https://discourse.chef.io/t/chef-vault-examples-of-encrypting-in-recipes/4906/1 "2014-01-16T23:06:14Z")

</div>

Hello,

Does anyone have any code examples of creating a new chef-vault item within  
a chef recipe, and uploading to the Chef server? Is that even possible  
without using an “admin” PEM file, and simply using the node’s PEM file?

I was successful in using chef-vault via knife, but now I have a use case  
where I need to create an user account, AND store the secret all within the  
same recipe.

Another issue I ran into - how do you guys deal with the face that new  
nodes are not authorized to access chef-vault items, due to having to  
re-run the knife command which re-runs the search for the keys of  
authorized nodes? Do you kick it off after you provision every VM?
