2018-09-02 15:02:26 +02:00
|
|
|
package pmcrypto
|
2018-06-04 16:05:14 -07:00
|
|
|
|
2018-06-22 16:04:20 +02:00
|
|
|
import "time"
|
|
|
|
|
|
2018-06-04 17:50:26 -07:00
|
|
|
// OpenPGP structure to manage mutiple address keys and user keys
|
2018-06-04 16:05:14 -07:00
|
|
|
type OpenPGP struct {
|
|
|
|
|
addresses []*Address
|
|
|
|
|
|
2018-06-04 17:50:26 -07:00
|
|
|
//latestServerTime unix time cache
|
|
|
|
|
latestServerTime int64
|
2018-06-22 16:04:20 +02:00
|
|
|
latestClientTime time.Time
|
2018-06-04 16:05:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// //AddAddress add a new address to key ring
|
|
|
|
|
// //add a new address into addresses list
|
|
|
|
|
// func (pgp *OpenPGP) 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 *OpenPGP) 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 *OpenPGP) CleanAddresses() (bool, error) {
|
|
|
|
|
// return true, errors.New("this is not implemented yet, will add this later")
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// //EncryptMessage encrypt message use address id
|
|
|
|
|
// func (pgp *OpenPGP) 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 *OpenPGP) DecryptMessage(encryptText string, passphras string) (string, error) {
|
|
|
|
|
// return "", errors.New("this is not implemented yet, will add this later")
|
|
|
|
|
// }
|