public class Security extends Object
| Constructor and Description |
|---|
Security() |
| Modifier and Type | Method and Description |
|---|---|
static PublicKey |
generatePublicKey(String encodedPublicKey)
Generates a PublicKey instance from a string containing the
Base64-encoded public key.
|
static boolean |
verify(PublicKey publicKey,
String signedData,
String signature)
Verifies that the signature from the server matches the computed
signature on the data.
|
static boolean |
verifyPurchase(String base64PublicKey,
String signedData,
String signature)
Verifies that the data was signed with the given signature, and returns
the verified purchase.
|
public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature)
PurchaseState
and product ID of the purchase.base64PublicKey - the base64-encoded public key to use for verifying.signedData - the signed JSON string (signed, not encrypted)signature - the signature for the data, signed with the private keypublic static PublicKey generatePublicKey(String encodedPublicKey)
encodedPublicKey - Base64-encoded public keyIllegalArgumentException - if encodedPublicKey is invalidpublic static boolean verify(PublicKey publicKey, String signedData, String signature)
publicKey - public key associated with the developer accountsignedData - signed data from serversignature - server signatureCopyright © 2016 Creative Mobile. All rights reserved.