gamecenter-identity-verifier-js
Version:
A small library to verify the identity of apple-gamecenter's local player for consuming it in node.js backend server. A rewrite to typescript of maeltm/node-gamecenter-identity-verifier
21 lines (20 loc) • 743 B
TypeScript
export type idToken = {
playerId: string;
bundleId: string;
timestamp: number;
salt: string;
signature: string;
publicKey: string;
};
type cacheEntry = {
data: string;
expires: number;
};
export declare const _cache: NodeJS.Dict<cacheEntry>;
export declare function convertX509CertToPEM(X509Cert: string): string;
export declare function getHttpCached(url: string): Promise<string>;
export declare function convertTimestampToBigEndian(timestamp: number): Buffer<ArrayBuffer>;
export declare function verifyIdToken(publicKeyPEM: string, idToken: idToken): boolean;
export declare function assertValid(input: any | idToken): idToken;
export declare function verify(idToken: idToken): Promise<boolean>;
export {};