// internal methods internal void SetCredentials(MongoCryptSafeHandle handle, Status status) { unsafe { fixed(byte *p = _credentialsBytes) { IntPtr ptr = (IntPtr)p; using (PinnedBinary pinned = new PinnedBinary(ptr, (uint)_credentialsBytes.Length)) { handle.Check(status, Library.mongocrypt_setopt_kms_providers(handle, pinned.Handle)); } } } }