Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetProperty()

static unsafe byte[] System.Security.Cryptography.CngKeyLite.GetProperty ( SafeNCryptHandle ncryptHandle,
string propertyName,
CngPropertyOptions options )
inlinestaticprivate

Definition at line 267 of file CngKeyLite.cs.

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:
290 Array.Resize(ref array, pcbResult);
291 return array;
292 }
293 }
294 }
295 }

References System.array, and System.options.

Referenced by System.Security.Cryptography.CngKeyLite.GetPropertyAsString().