Documentation ¶
Index ¶
- func DecryptWith(s EncString, key SymmetricEncryptionKey) ([]byte, error)
- func DecryptWithAsymmetric(s []byte, asymmetrickey AsymmetricEncryptionKey) ([]byte, error)
- func EncryptWithAsymmetric(s []byte, asymmbetrickey AsymmetricEncryptionKey) ([]byte, error)
- func EncryptWithToString(data []byte, encType EncStringType, key SymmetricEncryptionKey) (string, error)
- func InitKeyringFromMasterKey(keyring *Keyring, accountKey EncString, accountPrivateKey EncString, ...) error
- func InitKeyringFromMasterPassword(keyring *Keyring, accountKey EncString, accountPrivateKey EncString, ...) error
- func InitKeyringFromUserSymmetricKey(keyring *Keyring, accountSymmetricKey SymmetricEncryptionKey, ...) error
- type AsymmetricEncryptionKey
- type EncString
- type EncStringType
- type KDFConfig
- type KDFType
- type Keyring
- func (keyring *Keyring) GetAccountKey() SymmetricEncryptionKey
- func (keyring *Keyring) GetSymmetricKeyForOrganization(uuid string) (SymmetricEncryptionKey, error)
- func (keyring Keyring) IsLocked() bool
- func (keyring *Keyring) Lock()
- func (keyring *Keyring) UnlockWithAccountKey(accountKey SymmetricEncryptionKey)
- type MasterKey
- type MemguardAsymmetricEncryptionKey
- type MemguardSymmetricEncryptionKey
- type MemoryAsymmetricEncryptionKey
- type MemorySymmetricEncryptionKey
- type SymmetricEncryptionKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptWith ¶
func DecryptWith(s EncString, key SymmetricEncryptionKey) ([]byte, error)
func DecryptWithAsymmetric ¶
func DecryptWithAsymmetric(s []byte, asymmetrickey AsymmetricEncryptionKey) ([]byte, error)
func EncryptWithAsymmetric ¶
func EncryptWithAsymmetric(s []byte, asymmbetrickey AsymmetricEncryptionKey) ([]byte, error)
func EncryptWithToString ¶
func EncryptWithToString(data []byte, encType EncStringType, key SymmetricEncryptionKey) (string, error)
Types ¶
type AsymmetricEncryptionKey ¶
func GenerateAsymmetric ¶
func GenerateAsymmetric(useMemguard bool) (AsymmetricEncryptionKey, error)
type EncString ¶
type EncString struct { Type EncStringType IV, CT, MAC []byte }
func EncryptWith ¶
func EncryptWith(data []byte, encType EncStringType, key SymmetricEncryptionKey) (EncString, error)
func (EncString) MarshalText ¶
func (*EncString) UnmarshalText ¶
type EncStringType ¶
type EncStringType int
const ( AesCbc256_B64 EncStringType = 0 AesCbc128_HmacSha256_B64 EncStringType = 1 AesCbc256_HmacSha256_B64 EncStringType = 2 Rsa2048_OaepSha256_B64 EncStringType = 3 Rsa2048_OaepSha1_B64 EncStringType = 4 Rsa2048_OaepSha256_HmacSha256_B64 EncStringType = 5 Rsa2048_OaepSha1_HmacSha256_B64 EncStringType = 6 )
func (EncStringType) HasMAC ¶
func (t EncStringType) HasMAC() bool
type Keyring ¶
type Keyring struct { AsymmetricEncyryptionKey AsymmetricEncryptionKey IsMemguard bool OrganizationKeys map[string]string // contains filtered or unexported fields }
func NewMemguardKeyring ¶
func NewMemguardKeyring(accountKey *MemguardSymmetricEncryptionKey) Keyring
func NewMemoryKeyring ¶
func NewMemoryKeyring(accountKey *MemorySymmetricEncryptionKey) Keyring
func (*Keyring) GetAccountKey ¶
func (keyring *Keyring) GetAccountKey() SymmetricEncryptionKey
func (*Keyring) GetSymmetricKeyForOrganization ¶
func (keyring *Keyring) GetSymmetricKeyForOrganization(uuid string) (SymmetricEncryptionKey, error)
func (*Keyring) UnlockWithAccountKey ¶
func (keyring *Keyring) UnlockWithAccountKey(accountKey SymmetricEncryptionKey)
type MasterKey ¶
type MasterKey struct {
// contains filtered or unexported fields
}
func DeriveMasterKey ¶
func MasterKeyFromBytes ¶
type MemguardAsymmetricEncryptionKey ¶
type MemguardAsymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemguardAsymmetricEncryptionKeyFromBytes ¶
func MemguardAsymmetricEncryptionKeyFromBytes(key []byte) (MemguardAsymmetricEncryptionKey, error)
func (MemguardAsymmetricEncryptionKey) PrivateBytes ¶
func (key MemguardAsymmetricEncryptionKey) PrivateBytes() ([]byte, error)
func (MemguardAsymmetricEncryptionKey) PublicBytes ¶
func (key MemguardAsymmetricEncryptionKey) PublicBytes() []byte
type MemguardSymmetricEncryptionKey ¶
type MemguardSymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemguardSymmetricEncryptionKeyFromBytes ¶
func MemguardSymmetricEncryptionKeyFromBytes(key []byte) (MemguardSymmetricEncryptionKey, error)
func (MemguardSymmetricEncryptionKey) Bytes ¶
func (key MemguardSymmetricEncryptionKey) Bytes() []byte
func (MemguardSymmetricEncryptionKey) EncryptionKeyBytes ¶
func (key MemguardSymmetricEncryptionKey) EncryptionKeyBytes() ([]byte, error)
func (MemguardSymmetricEncryptionKey) MacKeyBytes ¶
func (key MemguardSymmetricEncryptionKey) MacKeyBytes() ([]byte, error)
type MemoryAsymmetricEncryptionKey ¶
type MemoryAsymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemoryAsymmetricEncryptionKeyFromBytes ¶
func MemoryAsymmetricEncryptionKeyFromBytes(key []byte) (MemoryAsymmetricEncryptionKey, error)
func (MemoryAsymmetricEncryptionKey) PrivateBytes ¶
func (key MemoryAsymmetricEncryptionKey) PrivateBytes() ([]byte, error)
func (MemoryAsymmetricEncryptionKey) PublicBytes ¶
func (key MemoryAsymmetricEncryptionKey) PublicBytes() []byte
type MemorySymmetricEncryptionKey ¶
type MemorySymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemorySymmetricEncryptionKeyFromBytes ¶
func MemorySymmetricEncryptionKeyFromBytes(key []byte) (MemorySymmetricEncryptionKey, error)
func (MemorySymmetricEncryptionKey) Bytes ¶
func (key MemorySymmetricEncryptionKey) Bytes() []byte
func (MemorySymmetricEncryptionKey) EncryptionKeyBytes ¶
func (key MemorySymmetricEncryptionKey) EncryptionKeyBytes() ([]byte, error)
func (MemorySymmetricEncryptionKey) MacKeyBytes ¶
func (key MemorySymmetricEncryptionKey) MacKeyBytes() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.