@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
67 lines (60 loc) • 2.72 kB
JavaScript
;
/**
* Copyright © 2024 Nevis Security AG. All rights reserved.
*/
import { Version } from './Version';
/**
* The object containing information about Nevis Mobile Authentication SDK for Android.
*/
export class AndroidMetaData {
/**
* The current version of Nevis Mobile Authentication SDK for Android.
*/
/**
* The SHA-256 hash of the signing certificate of the application that includes the Nevis Mobile
* Authentication SDK for Android.
*
* This information can be used to properly configure the {@link https://docs.nevis.net/configurationguide/use-cases/Mobile-Authentication/Mobile-Authentication-Use-Cases/Mobile-Authentication-with-Deep-Links#for-android | well-known}
* file on the backend, to use {@link https://developer.android.com/training/app-links/verify-android-applinks | Android App Links}.
*/
/**
* The {@link https://docs.nevis.net/mobilesdk/guide/configuration#facet-id | facet ID} used by
* Nevis Mobile Authentication SDK for Android.
*
* The facet ID of your application has to match the list of allowed facets stored provided by
* the facet service of the backend.
*/
/**
* Default constructor for {@link AndroidMetaData}.
*
* @param mobileAuthenticationVersion the current version of Nevis Mobile Authentication SDK for Android.
* @param signingCertificateSha256 the SHA-256 hash of the signing certificate of the application.
* @param applicationFacetId the facet ID used by Nevis Mobile Authentication SDK for Android.
* @returns an {@link AndroidMetaData} instance.
*/
static create(mobileAuthenticationVersion, signingCertificateSha256, applicationFacetId) {
return new AndroidMetaDataImpl(mobileAuthenticationVersion, signingCertificateSha256, applicationFacetId);
}
/**
* Alternate constructor that creates a {@link AndroidMetaData} from a json.
*
* @param json contains the source for instance creation.
* @returns an {@link AndroidMetaData} instance.
*/
static fromJson(json) {
return AndroidMetaDataImpl.fromJson(json);
}
}
export class AndroidMetaDataImpl extends AndroidMetaData {
constructor(mobileAuthenticationVersion, signingCertificateSha256, applicationFacetId) {
super();
this.mobileAuthenticationVersion = mobileAuthenticationVersion;
this.signingCertificateSha256 = signingCertificateSha256;
this.applicationFacetId = applicationFacetId;
}
static fromJson(json) {
const mobileAuthenticationVersion = Version.fromJson(json.mobileAuthenticationVersion);
return new AndroidMetaDataImpl(mobileAuthenticationVersion, json.signingCertificateSha256, json.applicationFacetId);
}
}
//# sourceMappingURL=AndroidMetaData.js.map