Issue #3: mobile client fallback version

This commit is contained in:
Jakub Lehotsky 2018-11-05 22:55:45 +01:00
parent 0bf075d49d
commit fdd1a727cb
15 changed files with 367 additions and 1321 deletions

View file

@ -1,39 +1,15 @@
// Package crypto contains all methods and classes needed for manipulation
// with underlying cryptographic operations. It uses lowlevel openpgp functions
// and provides higher level views. It uses models of messages, attachments
// and other higher-level entities
package crypto
import "time"
// PmCrypto structure to manage multiple address keys and user keys
// Called PGP crypto because it cannot have the same name as the package by gomobile's ridiculous rules.
// PmCrypto structure is used to manage server time shift. It should be also used for any
// other specific general cryptographic entities.
type PmCrypto struct {
//latestServerTime unix time cache
latestServerTime int64
latestClientTime time.Time
}
// //AddAddress add a new address to key ring
// //add a new address into addresses list
// func (pgp *PmCrypto) AddAddress(address *Address) (bool, error) {
// return true, errors.New("this is not implemented yet, will add this later")
// }
// //RemoveAddress remove address from the keyring
// //
// //#remove a exsit address from the list based on address id
// func (pgp *PmCrypto) RemoveAddress(addressID string) (bool, error) {
// return true, errors.New("this is not implemented yet, will add this later")
// }
// //CleanAddresses clear all addresses in keyring
// func (pgp *PmCrypto) CleanAddresses() (bool, error) {
// return true, errors.New("this is not implemented yet, will add this later")
// }
// //EncryptMessage encrypt message use address id
// func (pgp *PmCrypto) EncryptMessage(addressID string, plainText string, passphrase string, trim bool) (string, error) {
// return "", errors.New("this is not implemented yet, will add this later")
// }
// //DecryptMessage decrypt message, this will lookup all keys
// func (pgp *PmCrypto) DecryptMessage(encryptText string, passphras string) (string, error) {
// return "", errors.New("this is not implemented yet, will add this later")
// }