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 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)
Types ¶
type AsymmetricEncryptionKey ¶
func GenerateAsymmetric ¶ added in v0.1.4
func GenerateAsymmetric(useMemguard bool) (AsymmetricEncryptionKey, error)
type EncString ¶
type EncString struct { Type EncStringType IV, CT, MAC []byte }
func EncryptWith ¶
func EncryptWith(data []byte, typ 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 ¶ added in v0.2.0
func NewMemguardKeyring(accountKey *MemguardSymmetricEncryptionKey) Keyring
func NewMemoryKeyring ¶ added in v0.2.0
func NewMemoryKeyring(accountKey *MemorySymmetricEncryptionKey) Keyring
func (*Keyring) GetAccountKey ¶ added in v0.2.0
func (keyring *Keyring) GetAccountKey() SymmetricEncryptionKey
func (*Keyring) GetSymmetricKeyForOrganization ¶
func (keyring *Keyring) GetSymmetricKeyForOrganization(uuid string) (SymmetricEncryptionKey, error)
func (*Keyring) UnlockWithAccountKey ¶ added in v0.2.0
func (keyring *Keyring) UnlockWithAccountKey(accountKey SymmetricEncryptionKey)
type MasterKey ¶
type MasterKey struct {
// contains filtered or unexported fields
}
func DeriveMasterKey ¶
func MasterKeyFromBytes ¶ added in v0.1.4
type MemguardAsymmetricEncryptionKey ¶ added in v0.2.0
type MemguardAsymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemguardAssymmetricEncryptionKeyFromBytes ¶ added in v0.2.0
func MemguardAssymmetricEncryptionKeyFromBytes(key []byte) (MemguardAsymmetricEncryptionKey, error)
func (MemguardAsymmetricEncryptionKey) PrivateBytes ¶ added in v0.2.0
func (key MemguardAsymmetricEncryptionKey) PrivateBytes() ([]byte, error)
func (MemguardAsymmetricEncryptionKey) PublicBytes ¶ added in v0.2.0
func (key MemguardAsymmetricEncryptionKey) PublicBytes() []byte
type MemguardSymmetricEncryptionKey ¶ added in v0.2.0
type MemguardSymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemguardSymmetricEncryptionKeyFromBytes ¶ added in v0.2.0
func MemguardSymmetricEncryptionKeyFromBytes(key []byte) (MemguardSymmetricEncryptionKey, error)
func (MemguardSymmetricEncryptionKey) Bytes ¶ added in v0.2.0
func (key MemguardSymmetricEncryptionKey) Bytes() []byte
func (MemguardSymmetricEncryptionKey) EncryptionKeyBytes ¶ added in v0.2.0
func (key MemguardSymmetricEncryptionKey) EncryptionKeyBytes() ([]byte, error)
func (MemguardSymmetricEncryptionKey) MacKeyBytes ¶ added in v0.2.0
func (key MemguardSymmetricEncryptionKey) MacKeyBytes() ([]byte, error)
type MemoryAsymmetricEncryptionKey ¶ added in v0.2.0
type MemoryAsymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemoryAssymmetricEncryptionKeyFromBytes ¶ added in v0.2.0
func MemoryAssymmetricEncryptionKeyFromBytes(key []byte) (MemoryAsymmetricEncryptionKey, error)
func (MemoryAsymmetricEncryptionKey) PrivateBytes ¶ added in v0.2.0
func (key MemoryAsymmetricEncryptionKey) PrivateBytes() ([]byte, error)
func (MemoryAsymmetricEncryptionKey) PublicBytes ¶ added in v0.2.0
func (key MemoryAsymmetricEncryptionKey) PublicBytes() []byte
type MemorySymmetricEncryptionKey ¶ added in v0.2.0
type MemorySymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func MemorySymmetricEncryptionKeyFromBytes ¶ added in v0.2.0
func MemorySymmetricEncryptionKeyFromBytes(key []byte) (MemorySymmetricEncryptionKey, error)
func (MemorySymmetricEncryptionKey) Bytes ¶ added in v0.2.0
func (key MemorySymmetricEncryptionKey) Bytes() []byte
func (MemorySymmetricEncryptionKey) EncryptionKeyBytes ¶ added in v0.2.0
func (key MemorySymmetricEncryptionKey) EncryptionKeyBytes() ([]byte, error)
func (MemorySymmetricEncryptionKey) MacKeyBytes ¶ added in v0.2.0
func (key MemorySymmetricEncryptionKey) MacKeyBytes() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.