Merge pull request #1137 from Ryan-Everett-arm/key-management-buffer-protection

Add buffer copying to the Key Management API