// Path: fidoclient/src/main/java/com/yalin/fidoclient/constants/Constants.java
// public interface Constants {
//     String ACTION_FIDO_OPERATION = "org.fidoalliance.intent.FIDO_OPERATION";
// 
//     String PERMISSION_FIDO_CLIENT = "org.fidoalliance.uaf.permissions.FIDO_CLIENT";
// 
//     String FIDO_CLIENT_INTENT_MIME = "application/fido.uaf_client+json";
//     String FIDO_ASM_INTENT_MIME = "application/fido.uaf_asm+json";
// 
//     int CHALLENGE_MAX_LEN = 64;
//     int CHALLENGE_MIN_LEN = 8;
// 
//     int USERNAME_MAX_LEN = 128;
// 
//     int APP_ID_MAX_LEN = 512;
// 
//     int SERVER_DATA_MAX_LEN = 1536;
// 
//     int KEY_ID_MAX_LEN = 2048;
//     int KEY_ID_MIN_LEN = 32;
// 
//     String APP_ID_PREFIX = "https://";
// 
//     String BASE64_REGULAR = "^[a-zA-Z0-9-_]+={0,2}$";
// }
// 
// Path: fidoclient/src/main/java/com/yalin/fidoclient/msg/client/UAFIntentType.java
// public enum UAFIntentType {
//     DISCOVER,
//     DISCOVER_RESULT,
// 
//     //Perform a no-op check if a message could be processed.
//     CHECK_POLICY,
// 
//     //Check Policy results.
//     CHECK_POLICY_RESULT,
// 
//     //Process a Registration, Authentication, Transaction Confirmation or Deregistration message.
//     UAF_OPERATION,
// 
//     //UAF Operation results.
//     UAF_OPERATION_RESULT,
// 
//     //Inform the FIDO UAF Client of the completion status of a Registration, Authentication,
//     // Transaction Confirmation or Deregistration message.
//     UAF_OPERATION_COMPLETION_STATUS
// 
// 
// }


import android.content.Intent;
import android.os.Bundle;
import com.yalin.fidoclient.constants.Constants;
import com.yalin.fidoclient.msg.client.UAFIntentType;
/*
 * Copyright 2016 YaLin Jin
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.yalin.fidoclient.api;



/**
 * Created by YaLin on 2016/1/13.
 */
public class UAFIntent {
    public static final String UAF_INTENT_TYPE_KEY = "UAFIntentType";
    public static final String DISCOVERY_DATA_KEY = "discoveryData";
    public static final String COMPONENT_NAME_KEY = "componentName";
    public static final String ERROR_CODE_KEY = "errorCode";
    public static final String MESSAGE_KEY = "message";
    public static final String ORIGIN_KEY = "origin";
    public static final String CHANNEL_BINDINGS_KEY = "channelBindings";
    public static final String RESPONSE_CODE_KEY = "responseCode";

    /**
     * This Android intent invokes the FIDO UAF Client to discover the available authenticators and capabilties.
     * The FIDO UAF Client generally will not show a UI associated with the handling of this intent,
     * but immediately return the JSON structure. The calling application cannot depend on this however,
     * as the FIDO UAF Client may show a UI for privacy purposes,
     * allowing the user to choose whether and which authenticators to disclose to the calling application.
     * <p/>
     * This intent must be invoked with startActivityForResult().
     *
     * @return
     */
    public static Intent getDiscoverIntent() {
// Path: fidoclient/src/main/java/com/yalin/fidoclient/constants/Constants.java
// public interface Constants {
//     String ACTION_FIDO_OPERATION = "org.fidoalliance.intent.FIDO_OPERATION";
// 
//     String PERMISSION_FIDO_CLIENT = "org.fidoalliance.uaf.permissions.FIDO_CLIENT";
// 
//     String FIDO_CLIENT_INTENT_MIME = "application/fido.uaf_client+json";
//     String FIDO_ASM_INTENT_MIME = "application/fido.uaf_asm+json";
// 
//     int CHALLENGE_MAX_LEN = 64;
//     int CHALLENGE_MIN_LEN = 8;
// 
//     int USERNAME_MAX_LEN = 128;
// 
//     int APP_ID_MAX_LEN = 512;
// 
//     int SERVER_DATA_MAX_LEN = 1536;
// 
//     int KEY_ID_MAX_LEN = 2048;
//     int KEY_ID_MIN_LEN = 32;
// 
//     String APP_ID_PREFIX = "https://";
// 
//     String BASE64_REGULAR = "^[a-zA-Z0-9-_]+={0,2}$";
// }
// 
// Path: fidoclient/src/main/java/com/yalin/fidoclient/msg/client/UAFIntentType.java
// public enum UAFIntentType {
//     DISCOVER,
//     DISCOVER_RESULT,
// 
//     //Perform a no-op check if a message could be processed.
//     CHECK_POLICY,
// 
//     //Check Policy results.
//     CHECK_POLICY_RESULT,
// 
//     //Process a Registration, Authentication, Transaction Confirmation or Deregistration message.
//     UAF_OPERATION,
// 
//     //UAF Operation results.
//     UAF_OPERATION_RESULT,
// 
//     //Inform the FIDO UAF Client of the completion status of a Registration, Authentication,
//     // Transaction Confirmation or Deregistration message.
//     UAF_OPERATION_COMPLETION_STATUS
// 
// 
// }


// Path: fidoclient/src/main/java/com/yalin/fidoclient/api/UAFIntent.java
import android.content.Intent;
import android.os.Bundle;
import com.yalin.fidoclient.constants.Constants;
import com.yalin.fidoclient.msg.client.UAFIntentType;

/*
 * Copyright 2016 YaLin Jin
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.yalin.fidoclient.api;



/**
 * Created by YaLin on 2016/1/13.
 */
public class UAFIntent {
    public static final String UAF_INTENT_TYPE_KEY = "UAFIntentType";
    public static final String DISCOVERY_DATA_KEY = "discoveryData";
    public static final String COMPONENT_NAME_KEY = "componentName";
    public static final String ERROR_CODE_KEY = "errorCode";
    public static final String MESSAGE_KEY = "message";
    public static final String ORIGIN_KEY = "origin";
    public static final String CHANNEL_BINDINGS_KEY = "channelBindings";
    public static final String RESPONSE_CODE_KEY = "responseCode";

    /**
     * This Android intent invokes the FIDO UAF Client to discover the available authenticators and capabilties.
     * The FIDO UAF Client generally will not show a UI associated with the handling of this intent,
     * but immediately return the JSON structure. The calling application cannot depend on this however,
     * as the FIDO UAF Client may show a UI for privacy purposes,
     * allowing the user to choose whether and which authenticators to disclose to the calling application.
     * <p/>
     * This intent must be invoked with startActivityForResult().
     *
     * @return
     */
    public static Intent getDiscoverIntent() {
        Intent intent = new Intent(Constants.ACTION_FIDO_OPERATION);