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

◆ SetProperty()

unsafe void System.Security.Cryptography.CngKey.SetProperty ( CngProperty property)
inline

Definition at line 261 of file CngKey.cs.

262 {
263 byte[] valueWithoutCopying = property.GetValueWithoutCopying();
264 if (valueWithoutCopying == null)
265 {
266 throw global::Interop.NCrypt.ErrorCode.NTE_INVALID_PARAMETER.ToCryptographicException();
267 }
268 fixed (byte* pbInput = valueWithoutCopying.MapZeroLengthArrayToNonNullPointer())
269 {
270 global::Interop.NCrypt.ErrorCode errorCode = global::Interop.NCrypt.NCryptSetProperty(_keyHandle, property.Name, pbInput, valueWithoutCopying.Length, property.Options);
271 if (errorCode != 0)
272 {
273 throw errorCode.ToCryptographicException();
274 }
275 }
276 }
readonly SafeNCryptKeyHandle _keyHandle
Definition CngKey.cs:11

References System.Security.Cryptography.CngKey._keyHandle, System.Security.Cryptography.CngProperty.Name, and System.Security.Cryptography.CngProperty.Options.

Referenced by Internal.Cryptography.BasicSymmetricCipherNCrypt.BasicSymmetricCipherNCrypt(), and Internal.Cryptography.BasicSymmetricCipherNCrypt.Reset().