public byte[] Export(CngKeyBlobFormat format) { if (format == null) { throw new ArgumentNullException("format"); } KeyContainerPermission permission = this.BuildKeyContainerPermission(KeyContainerPermissionFlags.Export); if (permission != null) { permission.Demand(); } return(NCryptNative.ExportKey(this.m_keyHandle, format.Format)); }