public abstract class AbstractAsset extends Object
Asset can be represented by a JSON string. For example, the web site https://www.google.com can be represented by
{"namespace": "web", "site": "https://www.google.com"}
The Android app with package name com.google.test that is signed by a certificate with sha256 fingerprint 11:22:33 can be represented by
{"namespace": "android_app", "package_name": "com.google.test", "sha256_cert_fingerprints": ["11:22:33"]}
Given a signed APK, Java 7's commandline keytool can compute the fingerprint using:
keytool -list -printcert -jarfile signed_app.apk
Constructor and Description |
---|
AbstractAsset() |
Modifier and Type | Method and Description |
---|---|
static AbstractAsset |
create(String assetJson)
Creates a new Asset from its JSON string representation.
|
abstract boolean |
followInsecureInclude()
If this is the source asset of a statement file, should the retriever follow
any insecure (non-HTTPS) include statements made by the asset.
|
abstract int |
lookupKey()
Returns a key that can be used by
AbstractAssetMatcher to lookup the asset. |
abstract String |
toJson()
Returns a JSON string representation of this asset.
|
public abstract String toJson()
public abstract int lookupKey()
AbstractAssetMatcher
to lookup the asset.
An asset will match an AssetMatcher
only if the value of this method is equal to
AssetMatcher.getMatchedLookupKey()
.
public static AbstractAsset create(String assetJson) throws AssociationServiceException
AssociationServiceException
- if the assetJson is not well formatted.public abstract boolean followInsecureInclude()