mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
id/crypto: add VerificationTransactionID
Signed-off-by: Sumner Evans <sumner@beeper.com>
This commit is contained in:
parent
3aec0a3a6f
commit
7469dcf919
1 changed files with 14 additions and 0 deletions
14
id/crypto.go
14
id/crypto.go
|
|
@ -9,6 +9,8 @@ package id
|
|||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"go.mau.fi/util/random"
|
||||
)
|
||||
|
||||
// OlmMsgType is an Olm message type
|
||||
|
|
@ -174,3 +176,15 @@ const (
|
|||
SecretXSUserSigning Secret = "m.cross_signing.user_signing"
|
||||
SecretMegolmBackupV1 Secret = "m.megolm_backup.v1"
|
||||
)
|
||||
|
||||
// VerificationTransactionID is a unique identifier for a verification
|
||||
// transaction.
|
||||
type VerificationTransactionID string
|
||||
|
||||
func NewVerificationTransactionID() VerificationTransactionID {
|
||||
return VerificationTransactionID(random.String(32))
|
||||
}
|
||||
|
||||
func (t VerificationTransactionID) String() string {
|
||||
return string(t)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue