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

◆ GetProperty()

static unsafe byte[] Internal.Cryptography.Helpers.GetProperty ( this SafeNCryptHandle ncryptHandle,
string propertyName,
CngPropertyOptions options )
inlinestatic

Definition at line 55 of file Helpers.cs.

56 {
57 global::Interop.NCrypt.ErrorCode errorCode = global::Interop.NCrypt.NCryptGetProperty(ncryptHandle, propertyName, null, 0, out var pcbResult, options);
58 switch (errorCode)
59 {
60 case global::Interop.NCrypt.ErrorCode.NTE_NOT_FOUND:
61 return null;
62 default:
63 throw errorCode.ToCryptographicException();
64 case global::Interop.NCrypt.ErrorCode.ERROR_SUCCESS:
65 {
66 byte[] array = new byte[pcbResult];
67 fixed (byte* pbOutput = array)
68 {
69 errorCode = global::Interop.NCrypt.NCryptGetProperty(ncryptHandle, propertyName, pbOutput, array.Length, out pcbResult, options);
70 }
71 switch (errorCode)
72 {
73 case global::Interop.NCrypt.ErrorCode.NTE_NOT_FOUND:
74 return null;
75 default:
76 throw errorCode.ToCryptographicException();
77 case global::Interop.NCrypt.ErrorCode.ERROR_SUCCESS:
78 Array.Resize(ref array, pcbResult);
79 return array;
80 }
81 }
82 }
83 }

References System.array, and System.options.