Documentation ¶
Index ¶
- Constants
- func Base64UrlDecode(text string) []byte
- func Base64UrlEncode(data []byte) string
- func CreateAuthVerifier(password string, salt []byte, iterations uint32) string
- func CreateBioAuthHash(bioKey []byte) []byte
- func CreateEncryptionParams(password string, salt []byte, iterations uint32, dataKey []byte) (encryptionParams []byte, err error)
- func DecryptAesV1(data []byte, key []byte) ([]byte, error)
- func DecryptAesV1Full(data []byte, key []byte, usePadding bool) ([]byte, error)
- func DecryptAesV2(data []byte, key []byte) ([]byte, error)
- func DecryptEc(data []byte, private *ecdh.PrivateKey) (decrypted []byte, err error)
- func DecryptEncryptionParams(decodedParams []byte, password string) (params []byte, err error)
- func DecryptRsa(data []byte, privateKey *rsa.PrivateKey) (result []byte, err error)
- func DeriveKeyHashV1(password string, salt []byte, iterations uint32) []byte
- func DeriveKeyHashV2(domain string, password string, salt []byte, iterations uint32) []byte
- func DeriveKeyV1(password string, salt []byte, iterations uint32) []byte
- func EcSharedKey(public1 *ecdh.PublicKey, private2 *ecdh.PrivateKey) (key []byte, err error)
- func EncryptAesV1(data []byte, key []byte) ([]byte, error)
- func EncryptAesV1Full(data []byte, key []byte, iv []byte, usePadding bool) ([]byte, error)
- func EncryptAesV2(data []byte, key []byte) ([]byte, error)
- func EncryptAesV2Full(data []byte, key []byte, nonce []byte) ([]byte, error)
- func EncryptEc(data []byte, public *ecdh.PublicKey) (encrypted []byte, err error)
- func EncryptRsa(data []byte, publicKey *rsa.PublicKey) ([]byte, error)
- func GenerateAesKey() []byte
- func GenerateEcKey() (private *ecdh.PrivateKey, public *ecdh.PublicKey, err error)
- func GenerateRsaKey() (private *rsa.PrivateKey, public *rsa.PublicKey, err error)
- func GenerateUid() []byte
- func GetEcPublicKey(privateKey *ecdh.PrivateKey) *ecdh.PublicKey
- func GetKeeperFileFullPath(filename string) string
- func GetLogger() *zap.Logger
- func GetRandomBytes(size int) []byte
- func GetRsaPublicKey(privateKey *rsa.PrivateKey) *rsa.PublicKey
- func LoadEcPrivateKey(data []byte) (*ecdh.PrivateKey, error)
- func LoadEcPublicKey(data []byte) (publicKey *ecdh.PublicKey, err error)
- func LoadRsaPrivateKey(privateKeyData []byte) (privateKey *rsa.PrivateKey, err error)
- func LoadRsaPublicKey(publicKey []byte) (*rsa.PublicKey, error)
- func SetLogger(logger *zap.Logger)
- func SetNoLogger()
- func SliceForeach[T any](s []T, ef func(T))
- func SliceReduce[T any, A any](s []T, ini A, rf func(T, A) A) (res A)
- func SliceSelect[TI any, TO any](si []TI, sf func(TI) TO) (result []TO)
- func SliceWhere[T any](s []T, wf func(T) bool) (result []T)
- func UnloadEcPrivateKey(private *ecdh.PrivateKey) []byte
- func UnloadEcPublicKey(public *ecdh.PublicKey) []byte
- func UnloadRsaPrivateKey(privateKey *rsa.PrivateKey) []byte
- func UnloadRsaPublicKey(publicKey *rsa.PublicKey) []byte
- type AuthorizedCommand
- type IKeeperCommand
- type IKeeperResponse
- type KeeperApiCommand
- type KeeperApiError
- type KeeperApiErrorResponse
- type KeeperApiResponse
- type KeeperError
- type KeeperInvalidDeviceToken
- type RegionRedirectError
- type Set
- func (s Set[K]) Add(key K)
- func (s Set[K]) Copy() Set[K]
- func (s Set[K]) Delete(key K)
- func (s Set[K]) Difference(other []K)
- func (s Set[K]) Enumerate(cb func(K) bool)
- func (s Set[K]) EqualTo(other Set[K]) (result bool)
- func (s Set[K]) Has(key K) (ok bool)
- func (s Set[K]) Intersect(other []K)
- func (s Set[K]) ToArray() (result []K)
- func (s Set[K]) Union(other []K)
- type StreamCryptor
Constants ¶
View Source
const DefaultBlockSize = 16
Variables ¶
This section is empty.
Functions ¶
func Base64UrlDecode ¶
func Base64UrlEncode ¶
func CreateAuthVerifier ¶
func CreateBioAuthHash ¶
func CreateEncryptionParams ¶
func DecryptAesV1Full ¶
func DecryptEc ¶
func DecryptEc(data []byte, private *ecdh.PrivateKey) (decrypted []byte, err error)
func DecryptEncryptionParams ¶
func DecryptRsa ¶
func DecryptRsa(data []byte, privateKey *rsa.PrivateKey) (result []byte, err error)
func DeriveKeyHashV2 ¶
func EcSharedKey ¶
func EncryptAesV1Full ¶
func EncryptAesV2Full ¶
func GenerateAesKey ¶
func GenerateAesKey() []byte
func GenerateEcKey ¶
func GenerateEcKey() (private *ecdh.PrivateKey, public *ecdh.PublicKey, err error)
func GenerateRsaKey ¶
func GenerateRsaKey() (private *rsa.PrivateKey, public *rsa.PublicKey, err error)
func GenerateUid ¶
func GenerateUid() []byte
func GetEcPublicKey ¶
func GetEcPublicKey(privateKey *ecdh.PrivateKey) *ecdh.PublicKey
func GetKeeperFileFullPath ¶
func GetRandomBytes ¶
func GetRsaPublicKey ¶
func GetRsaPublicKey(privateKey *rsa.PrivateKey) *rsa.PublicKey
func LoadEcPrivateKey ¶
func LoadEcPrivateKey(data []byte) (*ecdh.PrivateKey, error)
func LoadRsaPrivateKey ¶
func LoadRsaPrivateKey(privateKeyData []byte) (privateKey *rsa.PrivateKey, err error)
func SetNoLogger ¶
func SetNoLogger()
func SliceForeach ¶
func SliceForeach[T any](s []T, ef func(T))
func SliceReduce ¶
func SliceSelect ¶
func SliceWhere ¶
func UnloadEcPrivateKey ¶
func UnloadEcPrivateKey(private *ecdh.PrivateKey) []byte
func UnloadEcPublicKey ¶
func UnloadRsaPrivateKey ¶
func UnloadRsaPrivateKey(privateKey *rsa.PrivateKey) []byte
func UnloadRsaPublicKey ¶
Types ¶
type AuthorizedCommand ¶
type AuthorizedCommand struct { KeeperApiCommand SessionToken string `json:"session_token"` Username string `json:"username"` }
func (*AuthorizedCommand) GetAuthorizedCommand ¶
func (command *AuthorizedCommand) GetAuthorizedCommand() *AuthorizedCommand
type IKeeperCommand ¶
type IKeeperCommand interface { CommandName() string GetAuthorizedCommand() *AuthorizedCommand }
type IKeeperResponse ¶
type IKeeperResponse interface {
GetKeeperApiResponse() *KeeperApiResponse
}
type KeeperApiCommand ¶
type KeeperApiError ¶
type KeeperApiError struct { KeeperError // contains filtered or unexported fields }
func NewKeeperApiError ¶
func NewKeeperApiError(resultCode string, message string) *KeeperApiError
func (*KeeperApiError) Error ¶
func (e *KeeperApiError) Error() string
func (*KeeperApiError) ResultCode ¶
func (e *KeeperApiError) ResultCode() string
type KeeperApiErrorResponse ¶
type KeeperApiErrorResponse struct { KeeperApiResponse Error string `json:"error"` KeyId int32 `json:"key_id"` RegionHost string `json:"region_host"` AdditionalInfo string `json:"additional_info"` }
type KeeperApiResponse ¶
type KeeperApiResponse struct { Result string `json:"result"` ResultCode string `json:"result_code"` Message string `json:"message"` Command string `json:"command"` }
func (*KeeperApiResponse) GetKeeperApiResponse ¶
func (rs *KeeperApiResponse) GetKeeperApiResponse() *KeeperApiResponse
func (*KeeperApiResponse) IsSuccess ¶
func (rs *KeeperApiResponse) IsSuccess() bool
type KeeperError ¶
type KeeperError struct {
// contains filtered or unexported fields
}
func NewKeeperError ¶
func NewKeeperError(message string) *KeeperError
func (*KeeperError) Error ¶
func (e *KeeperError) Error() string
func (*KeeperError) Message ¶
func (e *KeeperError) Message() string
type KeeperInvalidDeviceToken ¶
type KeeperInvalidDeviceToken struct {
KeeperError
}
func NewKeeperInvalidDeviceToken ¶
func NewKeeperInvalidDeviceToken(additionalInfo string) *KeeperInvalidDeviceToken
func (*KeeperInvalidDeviceToken) Error ¶
func (e *KeeperInvalidDeviceToken) Error() string
type RegionRedirectError ¶
type RegionRedirectError struct { KeeperError // contains filtered or unexported fields }
func NewKeeperRegionRedirect ¶
func NewKeeperRegionRedirect(regionHost string, additionalInfo string) *RegionRedirectError
func (*RegionRedirectError) Error ¶
func (e *RegionRedirectError) Error() string
func (*RegionRedirectError) RegionHost ¶
func (e *RegionRedirectError) RegionHost() string
type Set ¶
type Set[K comparable] map[K]struct{}
func MakeSet ¶
func MakeSet[K comparable](keys []K) Set[K]
func NewSet ¶
func NewSet[K comparable]() Set[K]
func (Set[K]) Difference ¶
func (s Set[K]) Difference(other []K)
type StreamCryptor ¶
func NewAesStreamDecryptor ¶
func NewAesStreamDecryptor(reader io.Reader, key []byte) StreamCryptor
func NewAesStreamEncryptor ¶
func NewAesStreamEncryptor(reader io.Reader, key []byte) StreamCryptor
Click to show internal directories.
Click to hide internal directories.