Documentation
¶
Index ¶
- func DecryptCredentials(ecreds tg.EncryptedCredentials, priv *rsa.PrivateKey, nonce string) (*tgpassport.Credentials, error)
- func DecryptData[T tgpassport.DataType](creds tgpassport.DataCredentials, data string) (*T, error)
- func DecryptFile(creds tgpassport.FileCredentials, fileData []byte) ([]byte, error)
- func SetPassportDataErrors(ctx context.Context, a *api.API, userID int, errs []tg.PassportElementError) error
- type RequestParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptCredentials ¶
func DecryptCredentials(ecreds tg.EncryptedCredentials, priv *rsa.PrivateKey, nonce string) (*tgpassport.Credentials, error)
DecryptCredentials decrypts telegram encrypted passport credentials.
func DecryptData ¶
func DecryptData[T tgpassport.DataType](creds tgpassport.DataCredentials, data string) (*T, error)
DecryptData decrypts base64-encoded encrypted data.
func DecryptFile ¶
func DecryptFile(creds tgpassport.FileCredentials, fileData []byte) ([]byte, error)
DecryptFile decrypts encrypted file data.
func SetPassportDataErrors ¶
func SetPassportDataErrors(ctx context.Context, a *api.API, userID int, errs []tg.PassportElementError) error
SetPassportDataErrors informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed.
Types ¶
type RequestParams ¶
type RequestParams struct { BotID int Scope tgpassport.Scope // Public key of the bot. PublicKey string // Bot-specified nonce. // For security purposes it should be a cryptographically secure unique identifier of the request. Nonce string }
RequestParams contains parameters to request information.
func (*RequestParams) Deeplink ¶
func (p *RequestParams) Deeplink() (deeplinks.Deeplink, error)
Deeplink generates request deeplink.
func (*RequestParams) Query ¶
func (p *RequestParams) Query() (url.Values, error)
Query generates query part of the request URI.
func (*RequestParams) URI ¶
func (p *RequestParams) URI() (string, error)
URI generates request URI.
Click to show internal directories.
Click to hide internal directories.