passport

package
v0.0.0-...-c5c7da2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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 (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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL