FIRGameCenterAuthCredential.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthCredential.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** @class FIRGameCenterAuthCredential
  20. @brief Internal implementation of FIRAuthCredential for Game Center credentials.
  21. */
  22. @interface FIRGameCenterAuthCredential : FIRAuthCredential <NSSecureCoding>
  23. /** @property playerID
  24. @brief The ID of the Game Center local player.
  25. */
  26. @property(nonatomic, readonly) NSString *playerID;
  27. /** @property teamPlayerID
  28. @brief The team player ID of the Game Center local player.
  29. */
  30. @property(nonatomic, readonly) NSString *teamPlayerID;
  31. /** @property gamePlayerID
  32. @brief The game player ID of the Game Center local player.
  33. */
  34. @property(nonatomic, readonly) NSString *gamePlayerID;
  35. /** @property publicKeyURL
  36. @brief The URL for the public encryption key.
  37. */
  38. @property(nonatomic, readonly) NSURL *publicKeyURL;
  39. /** @property signature
  40. @brief The verification signature data generated.
  41. */
  42. @property(nonatomic, readonly) NSData *signature;
  43. /** @property salt
  44. @brief A random string used to compute the hash and keep it randomized.
  45. */
  46. @property(nonatomic, readonly) NSData *salt;
  47. /** @property timestamp
  48. @brief The date and time that the signature was created.
  49. */
  50. @property(nonatomic, readonly) uint64_t timestamp;
  51. /** @property displayName
  52. @brief The display name of the local Game Center player.
  53. */
  54. @property(nonatomic, readonly) NSString *displayName;
  55. /** @fn initWithPlayerID:publicKeyURL:signature:salt:timestamp:displayName:
  56. @brief Designated initializer.
  57. @param publicKeyURL The URL for the public encryption key.
  58. @param signature The verification signature generated.
  59. @param salt A random string used to compute the hash and keep it randomized.
  60. @param timestamp The date and time that the signature was created.
  61. @param displayName The display name of the Game Center player.
  62. */
  63. - (nullable instancetype)initWithPlayerID:(NSString *)playerID
  64. teamPlayerID:(nullable NSString *)teamPlayerID
  65. gamePlayerID:(nullable NSString *)gamePlayerID
  66. publicKeyURL:(NSURL *)publicKeyURL
  67. signature:(NSData *)signature
  68. salt:(NSData *)salt
  69. timestamp:(uint64_t)timestamp
  70. displayName:(NSString *)displayName NS_DESIGNATED_INITIALIZER;
  71. /** @fn initWithProvider:
  72. @brief Initializer with a provider name.
  73. @param provider The provider name.
  74. */
  75. - (nullable instancetype)initWithProvider:(NSString *)provider NS_UNAVAILABLE;
  76. @end
  77. NS_ASSUME_NONNULL_END