All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mosip.certify.proof.ProofValidator Maven / Gradle / Ivy

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */
package io.mosip.certify.proof;

import io.mosip.certify.core.dto.CredentialProof;

public interface ProofValidator {

    /**
     * Proof type supported by the implementation class.
     * @return Returns the supported proof type
     */
    String getProofType();

    /**
     * Validates the input proof.
     * @param clientId Client ID as in the bearer access token
     * @param cNonce valid client nonce as generated by the server(authorization/VCI)
     * @param credentialProof proof from the credential request.
     * @return true if proof passes all the validation else false
     */
    boolean validate(String clientId, String cNonce, CredentialProof credentialProof);

    /**
     * Extracts the holders public key for VC cryptographic binding from the proof header
     * @param credentialProof proof from the credential request.
     * @return public key as did:jwk equivalent
     */
    String getKeyMaterial(CredentialProof credentialProof);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy