Documentation
¶
Index ¶
- type Api
- func (a *Api) Decrypt(data Buffer, key *Key) (Buffer, error)
- func (a *Api) DecryptString(data string, key *Key) (Buffer, error)
- func (a *Api) DecryptThenVerify(data Buffer, key *Key, signerCard *Card) (Buffer, error)
- func (a *Api) DecryptThenVerifyString(data string, key *Key, signerCard *Card) (Buffer, error)
- func (a *Api) Encrypt(data Buffer, recipients ...*Card) (Buffer, error)
- func (a *Api) EncryptString(data string, recipients ...*Card) (Buffer, error)
- func (a *Api) Sign(data Buffer, key *Key) (Buffer, error)
- func (a *Api) SignString(data string, key *Key) (Buffer, error)
- func (a *Api) SignThenEncrypt(data Buffer, signerKey *Key, recipients ...*Card) (Buffer, error)
- func (a *Api) SignThenEncryptString(data string, signerKey *Key, recipients ...*Card) (Buffer, error)
- func (a *Api) Verify(data Buffer, signature Buffer, signerCard *Card) (bool, error)
- func (a *Api) VerifyString(data string, signature Buffer, signerCard *Card) (bool, error)
- type AppCredentials
- type Buffer
- type Card
- func (c *Card) Encrypt(data Buffer) (Buffer, error)
- func (c *Card) EncryptString(data string) (Buffer, error)
- func (c *Card) Export() (string, error)
- func (c *Card) Verify(data Buffer, signature Buffer) (bool, error)
- func (c *Card) VerifyIdentity() (attempt *IdentityVerificationAttempt, err error)
- func (c *Card) VerifyString(data string, signature Buffer) (bool, error)
- type CardManager
- type Cards
- func (c Cards) Encrypt(data Buffer) (Buffer, error)
- func (c Cards) EncryptString(data string) (Buffer, error)
- func (c Cards) SignThenEncrypt(data Buffer, signerKey *Key) (Buffer, error)
- func (c Cards) SignThenEncryptString(data string, signerKey *Key) (Buffer, error)
- func (c Cards) ToRecipients() []virgilcrypto.PublicKey
- type ClientParams
- type Config
- type Context
- type IdentityVerificationAttempt
- type Key
- func (k *Key) Decrypt(data Buffer) (Buffer, error)
- func (k *Key) DecryptString(data string) (Buffer, error)
- func (k *Key) DecryptThenVerify(data Buffer, card *Card) (Buffer, error)
- func (k *Key) DecryptThenVerifyString(data string, card *Card) (Buffer, error)
- func (k *Key) Export(password string) (Buffer, error)
- func (k *Key) ExportPublicKey() (Buffer, error)
- func (k *Key) Save(alias string, password string) error
- func (k *Key) Sign(data Buffer) (Buffer, error)
- func (k *Key) SignString(data string) (Buffer, error)
- func (k *Key) SignThenEncrypt(data Buffer, recipients ...*Card) (Buffer, error)
- func (k *Key) SignThenEncryptString(data string, recipients ...*Card) (Buffer, error)
- type KeyManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct { Cards CardManager Keys KeyManager // contains filtered or unexported fields }
func NewWithConfig ¶
func (*Api) DecryptString ¶
Decrypt expects string, received by calling ToBase64String on Buffer, received from Encrypt or EncryptString
func (*Api) DecryptThenVerify ¶
func (*Api) DecryptThenVerifyString ¶
DecryptThenVerifyString expects data to be in base64 encoding
func (*Api) EncryptString ¶
EncryptString is the same as Encrypt but expects any string
func (*Api) SignThenEncrypt ¶
func (*Api) SignThenEncryptString ¶
type AppCredentials ¶
type Buffer ¶
type Buffer []byte
func BufferFromBase64String ¶
func BufferFromBytes ¶
func BufferFromHEXString ¶
func BufferFromString ¶
func (Buffer) ToBase64String ¶
func (Buffer) ToHEXString ¶
type Card ¶
type Card struct { *virgil.Card // contains filtered or unexported fields }
func (*Card) VerifyIdentity ¶
func (c *Card) VerifyIdentity() (attempt *IdentityVerificationAttempt, err error)
type CardManager ¶
type CardManager interface { Get(id string) (*Card, error) Create(identity string, key *Key, customFields map[string]string) (*Card, error) CreateGlobal(identity string, key *Key) (*Card, error) Import(card string) (*Card, error) ConfirmIdentity(actionId string, confirmationCode string) (validationToken string, err error) Publish(card *Card) (*Card, error) PublishGlobal(card *Card, validationToken string) (*Card, error) Revoke(card *Card, reason virgil.Enum) error RevokeGlobal(card *Card, reason virgil.Enum, key *Key, validationToken string) error Find(identities ...string) (Cards, error) FindGlobal(identityType string, identities ...string) (Cards, error) }
type Cards ¶
type Cards []*Card
func (Cards) SignThenEncrypt ¶
func (Cards) SignThenEncryptString ¶
func (Cards) ToRecipients ¶
func (c Cards) ToRecipients() []virgilcrypto.PublicKey
type ClientParams ¶
type ClientParams struct { CardServiceURL, ReadOnlyCardServiceURL, IdentityServiceURL, VRAServiceURL string }
type Config ¶
type Config struct { Token string Credentials *AppCredentials ClientParams *ClientParams KeyStoragePath string CardVerifiers map[string]Buffer KeyType virgilcrypto.KeyType SkipBuiltInVerifiers bool }
type IdentityVerificationAttempt ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func (*Key) DecryptThenVerify ¶
func (*Key) DecryptThenVerifyString ¶
func (*Key) ExportPublicKey ¶
func (*Key) SignThenEncrypt ¶
Click to show internal directories.
Click to hide internal directories.