268 {
269 global::Interop.NCrypt.ErrorCode errorCode = global::Interop.NCrypt.NCryptGetProperty(ncryptHandle, propertyName,
null, 0, out var pcbResult,
options);
270 switch (errorCode)
271 {
272 case global::Interop.NCrypt.ErrorCode.NTE_NOT_FOUND:
273 return null;
274 default:
275 throw errorCode.ToCryptographicException();
276 case global::Interop.NCrypt.ErrorCode.ERROR_SUCCESS:
277 {
278 byte[]
array =
new byte[pcbResult];
279 fixed (
byte* pbOutput =
array)
280 {
281 errorCode = global::Interop.NCrypt.NCryptGetProperty(ncryptHandle, propertyName, pbOutput,
array.Length, out pcbResult,
options);
282 }
283 switch (errorCode)
284 {
285 case global::Interop.NCrypt.ErrorCode.NTE_NOT_FOUND:
286 return null;
287 default:
288 throw errorCode.ToCryptographicException();
289 case global::Interop.NCrypt.ErrorCode.ERROR_SUCCESS:
292 }
293 }
294 }
295 }