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
- type MasterKey
- 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 ¶
type AsymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func AssymmetricEncryptionKeyFromBytes ¶
func AssymmetricEncryptionKeyFromBytes(key []byte) (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 { AccountKey *SymmetricEncryptionKey AsymmetricEncyryptionKey AsymmetricEncryptionKey OrganizationKeys map[string]string }
func NewKeyring ¶
func NewKeyring(accountKey *SymmetricEncryptionKey) Keyring
func (*Keyring) GetSymmetricKeyForOrganization ¶
func (keyring *Keyring) GetSymmetricKeyForOrganization(uuid string) (SymmetricEncryptionKey, error)
type MasterKey ¶
type MasterKey struct {
// contains filtered or unexported fields
}
func DeriveMasterKey ¶
type SymmetricEncryptionKey ¶
type SymmetricEncryptionKey struct {
// contains filtered or unexported fields
}
func SymmetricEncryptionKeyFromBytes ¶
func SymmetricEncryptionKeyFromBytes(key []byte) (SymmetricEncryptionKey, error)
func (SymmetricEncryptionKey) Bytes ¶
func (key SymmetricEncryptionKey) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.