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

org.telegram.telegrambots.meta.api.objects.passport.EncryptedCredentials Maven / Gradle / Ivy

There is a newer version: 7.9.1
Show newest version
package org.telegram.telegrambots.meta.api.objects.passport;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
 * @author Ruben Bermudez
 * @version 4.0.0
 * Contains data required for decrypting and authenticating EncryptedPassportElement.
 * See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
 */
public class EncryptedCredentials implements BotApiObject {
    private static final String DATA_FIELD = "data";
    private static final String HASH_FIELD = "hash";
    private static final String SECRET_FIELD = "secret";

    /**
     * Base64-encoded encrypted JSON-serialized data with unique user's payload,
     * data hashes and secrets required for EncryptedPassportElement decryption and authentication
     */
    @JsonProperty(DATA_FIELD)
    private String data;
    @JsonProperty(HASH_FIELD)
    private String hash; ///< Base64-encoded data hash for data authentication
    @JsonProperty(SECRET_FIELD)
    private String secret; ///< Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption

    public EncryptedCredentials() {
    }

    public EncryptedCredentials(String data, String hash, String secret) {
        this.data = data;
        this.hash = hash;
        this.secret = secret;
    }

    public String getData() {
        return data;
    }

    public String getHash() {
        return hash;
    }

    public String getSecret() {
        return secret;
    }

    @Override
    public String toString() {
        return "EncryptedCredentials{" +
                "data='" + data + '\'' +
                ", hash='" + hash + '\'' +
                ", secret='" + secret + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy