Documentation
¶
Index ¶
- Variables
- func ConvertPemToPublicKey(publicKeyPem string) (*rsa.PublicKey, error)
- func ErrMissingField(field string) *logical.Response
- func GenerateOTP(length int) (string, error)
- func New(text string) error
- func NewUUID() string
- func StringInSlice(a string, list []string) bool
- func UUIDExists(ctx context.Context, req *logical.Request, uuid string) bool
- func ValidateData(ctx context.Context, req *logical.Request, uuid string, derivationPath string) error
- func ValidateFields(req *logical.Request, data *framework.FieldData) error
- func ValidationErr(msg string) error
- func VerifyECDSASignedMessage(signature string, rawData string, publickKeyHash string) bool
- func VerifyJWTSignature(jwtToken string, dataToValidate map[string]string, publicKeyEncoded string, ...) (bool, string)
- func VerifyRSASignedMessage(signatureEncoded string, data string, publicKeyEncoded string) bool
- func VerifyTokenClaims(tokenClaims jwt.MapClaims, unsignedData map[string]string) bool
- type GuardianEmails
- type LastRecoverySaveLocation
- type MAILFormatUpdates
- type MailFormatGuardian
- type MailFormatGuardianAdditionLink
- type MailFormatGuardianVerified
- type MailFormatVerification
- type MailFormatVetoed
- type RecoveryDetails
- type RestorationIdentifiers
- type User
- type UserDetails
- type VaultStatus
- type WalletIdentifierStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var PurposeType = []string{
"ADD_PRIMARY_EMAIL",
"ADD_MOBILE_NUMBER",
"VERIFY_EMAIL_FOR_WALLET_RESTORATION",
"ADD_WALLET_THIRD_SHARD",
"VERIFY_EMAIL_OTP",
"VERIFY_MOBILE_OTP",
"VERIFY_MOBILE_FOR_WALLET_RESTORATION",
}
Functions ¶
func ConvertPemToPublicKey ¶
converts pem format to rsa public key
func ErrMissingField ¶
ErrMissingField returns a logical response error that prints a consistent error message for when a required field is missing.
func GenerateOTP ¶
GenerateOTP - generate random number of length passed
func StringInSlice ¶
func UUIDExists ¶
UUIDExists checks if uuid exists or not
func ValidateData ¶
func ValidateData(ctx context.Context, req *logical.Request, uuid string, derivationPath string) error
ValidateData - validates data provided provided to create signature
func ValidateFields ¶
ValidateFields verifies that no bad arguments were given to the request.
func ValidationErr ¶
ValidationErr returns an error that corresponds to a validation error.
func VerifyJWTSignature ¶
func VerifyRSASignedMessage ¶
verifies if data is signed using passed public key
Types ¶
type GuardianEmails ¶
type MAILFormatUpdates ¶
type MailFormatGuardian ¶
type MailFormatVerification ¶
type MailFormatVetoed ¶
type RecoveryDetails ¶
type RestorationIdentifiers ¶
type User ¶
type User struct {
Username string `json:"username"`
UUID string `json:"uuid"`
Mnemonic string `json:"mnemonic"`
Passphrase string `json:"passphrase"`
}
User -- stores data related to user
type UserDetails ¶
type UserDetails struct {
UserEmail string `json:"useremail"`
UnverifiedUserEmail string `json:"tempuseremail"`
Guardians []string `json:"guardians"`
UnverifiedGuardians []string `json:"unverifiedGuardians"`
GuardianEmailOTPGenerateTimestamp []int64 `json:"guardianEmailOTPGenerateTimestamp"`
GuardiansAddLinkInitiation []int64 `json:"guardiansAddLinkInitiation"`
GuardiansUpdateStatus []bool `json:"guardiansUpdateStatus"`
UserMobile string `json:"usermobile"`
UnverifiedUserMobile string `json:"tempusermobile"`
UserRSAPublicKey string `json:"userRSAPublicKey"`
UserECDSAPublicKey string `json:"userECDSAPublicKey"`
WalletThirdShard string `json:"secret"`
LastRecoverySavedAt LastRecoverySaveLocation `json:"lastRecoverySavedAt"`
UnverifiedWalletThirdShard string `json:"unverifiedSecret"`
Identifier string `json:"identifier"`
IsRestoreInProgress bool `json:"isrestoreinprogress"`
EmailVerificationState bool `json:"emailverificationstate"`
MobileVerificationState bool `json:"mobileverificationstate"`
PrimaryEmailVerificationOTP string `json:"primaryEmailVerificationOTP"`
GuardianIdentifiers []string `json:"guardianIdentifiers"`
MobileVerificationOTP string `json:"mobileverificationotp"`
PrimaryEmailOTPGenerateTimestamp int64 `json:"primaryEmailOTPGenerateTimestamp"`
MobileOTPGenerateTimestamp int64 `json:"mobileotpgeneratedtimestamp"`
RestoreInitiationTimestamp int64 `json:"restoreinitiationtimestamp"`
WalletIdentifierStoredAt string `json:"walletIdentifierStoredAt"`
SignedConsentForPrivateKey string `json:"signedConsentForPrivateKey"`
SignedConsentForMnemonics string `json:"signedConsentForMnemonics"`
LastVetoedBy string `json:"lastVetoedBy"`
RsaEncryptedMnemonicEncryptionAESKey string `json:"rsaEncryptedMnemonicEncryptionAESKey"`
UserWalletAddress string `json:"userWalletAddress"`
LastVetoedAt int64 `json:"lastVetoedAt"`
}
type VaultStatus ¶
type VaultStatus struct {
Identifier string `json:"identifier"`
UserEmail string `json:"userEmail"`
Guardians []GuardianEmails `json:"guardians"`
UserMobile string `json:"userMobile"`
UserRSAPublicKey bool `json:"userRSAPublicKey"`
UserECDSAPublicKey bool `json:"userECDSAPublicKey"`
WalletThirdShard bool `json:"secret"`
LastRecoverySavedAt LastRecoverySaveLocation `json:"lastRecoverySavedAt"`
IsRestoreInProgress bool `json:"isRestoreInProgress"`
RestoreInitiationTimestamp int64 `json:"restoreInitiationTimestamp"`
RestoreCompletionTimestamp int64 `json:"restoreCompletionTimestamp"`
SignedConsentForPrivateKey bool `json:"signedConsentForPrivateKey"`
SignedConsentForMnemonics bool `json:"signedConsentForMnemonics"`
LastVetoedBy string `json:"lastVetoedBy"`
LastVetoedAt int64 `json:"lastVetoedAt"`
RestorationLockedUntil int64 `json:"restorationLockedUntil"`
}
type WalletIdentifierStorage ¶
type WalletIdentifierStorage struct {
WalletIdentifier string `json:"walletIdentifier"`
}
Click to show internal directories.
Click to hide internal directories.