forked from apple/unityplugins
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple bugs in GKLocalPlayer.FetchItems. Also test it during au…
…thentication in the sample app. (apple#30)
- Loading branch information
1 parent
676672b
commit 73e5e56
Showing
4 changed files
with
58 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 11 additions & 26 deletions
37
...GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/GKIdentityVerificationResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,31 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using Apple.Core.Runtime; | ||
|
||
namespace Apple.GameKit.Players | ||
{ | ||
[StructLayout(LayoutKind.Sequential)] | ||
public struct GKIdentityVerificationResponse | ||
public class GKIdentityVerificationResponse | ||
{ | ||
/// <summary> | ||
/// The URL for the public encryption key. | ||
/// </summary> | ||
public string PublicKeyUrl; | ||
internal IntPtr Signature; | ||
internal int SignatureLength; | ||
internal IntPtr Salt; | ||
internal int SaltLength; | ||
/// <summary> | ||
/// The signature’s creation date and time. | ||
/// </summary> | ||
public ulong Timestamp; | ||
public string PublicKeyUrl { get; set; } | ||
|
||
/// <summary> | ||
/// The verification signature data that GameKit generates. | ||
/// </summary> | ||
/// <returns></returns> | ||
public byte[] GetSignature() | ||
{ | ||
var signature = new byte[SignatureLength]; | ||
Marshal.Copy(Signature, signature, 0, SignatureLength); | ||
|
||
return signature; | ||
} | ||
public NSData Signature { get; set; } | ||
public byte[] GetSignature() => Signature.Bytes; | ||
|
||
/// <summary> | ||
/// A random NSString that GameKit uses to compute the hash and randomize it. | ||
/// </summary> | ||
/// <returns></returns> | ||
public byte[] GetSalt() | ||
{ | ||
var salt = new byte[SaltLength]; | ||
Marshal.Copy(Salt, salt, 0, SaltLength); | ||
public NSData Salt { get; set; } | ||
public byte[] GetSalt() => Salt.Bytes; | ||
|
||
return salt; | ||
} | ||
/// <summary> | ||
/// The signature's creation date and time. | ||
/// </summary> | ||
public UInt64 Timestamp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters