Remove dependency on pkeyData

Remove dependency on pkeyData
Memory fixes

Memory fixes
add identity check

add identity check
fixed identity error
Merge pull request #179 from AzureAD/dev

Dev