private byte[] ExportKeyBlob(bool includePrivateParameters)
{
// Use generic blob type for multiple version support
string blobType = includePrivateParameters ?
Interop.BCrypt.KeyBlobType.BCRYPT_PRIVATE_KEY_BLOB :
Interop.BCrypt.KeyBlobType.BCRYPT_PUBLIC_KEY_BLOB;
using (SafeNCryptKeyHandle keyHandle = GetDuplicatedKeyHandle())
{
return CngKeyLite.ExportKeyBlob(keyHandle, blobType);
}
}