Commit graph

140 commits

Author SHA1 Message Date
Aron Wussler
958f3166e5 Fix examples documentation 2020-01-10 00:53:13 +01:00
Yanfeng Zhang
5c496d0505 Add build script and fix helper for mobile (#32)
* update build and fix helper for mobile

* Update readme, changelog and script cleanup

Co-authored-by: wussler <aron@wussler.it>
2020-01-06 13:21:44 +01:00
wussler
54f45d0471
Openpgp security update (V2) (#31)
* Change keyring unlock functionalities

* Add keyring#Lock, keyring#CheckIntegrity, tests

* Update helpers, fix bugs

* Update go.mod with ProtonMail/crypto commit

* Change key management system

* Clear keys from memory + tests

* Create SessionKey with direct encryption for datapackets. Move symmetrickey to password.

* Fix upstream dependencies

* Update module to V2, documentation

* Add linter

* Add v2 folder to .gitignore

* Minor changes to KeyID getters

* Remove old changelog

* Improve docs, remove compilation script
2019-12-27 19:35:43 +01:00
wussler
136c0a5495
Change time global handling (#29)
* Reverse time

* Change time handling global

* Remove debug functions

* Remove *pgp methods
2019-10-22 18:44:45 +02:00
Yanfeng Zhang
d398098113
Merge pull request #26 from ProtonMail/wrapper-ios
Add wrappers for iOS
2019-09-12 11:05:37 -07:00
Aron Wussler
5249d26588 Add text messages encryption 2019-09-12 11:58:09 +02:00
Aron Wussler
4a41ea9e27 Add wrappers for iOS 2019-09-12 11:57:59 +02:00
wussler
6136f75860 Remove JSON handling functions; export KeyRing.ReadFrom (#24) 2019-09-03 17:42:10 +02:00
wussler
52ecc1ce36
When keyring is empty KeyRing.FirstKey returns nil (#25) 2019-08-30 12:22:50 +02:00
wussler
72e33612c4
Edits for bridge (#22)
* Edits for bridge

* Add keyring method to extract first key, improve docs
2019-08-29 17:45:13 +02:00
wussler
4ef79f1d12 Rename conflicting methods (#20) 2019-08-19 12:06:30 +02:00
Daniel Huigens
7e8dd9ab95 Update ProtonMail/crypto 2019-08-14 17:34:13 +02:00
wussler
9195b9ae92
Fix compilation for gomobile iOS (#17)
* Move signature verification to errors

* Move cleartext messages to ClearTextMessage struct

* Fix documentation
2019-07-02 07:36:02 -07:00
wussler
552ce9554f
Add encryption and decryption for attachment tests (#16) 2019-06-13 01:26:13 -07:00
wussler
b30f047e53
Change verification system, add tests for issue 11 (#13) 2019-06-04 18:10:31 +02:00
Daniel Huigens
781681b548 Use Entitiy.EncryptionKey instead of reimplementing it
This fixes us sometimes using subkeys whose key flags allow
encryption but don't have a valid algorithm for encryption,
or that are expired, etc.
2019-06-04 16:45:33 +02:00
wussler
e65ed17b41
Refactor api (#6)
* Refactor library, remove duplicates

* Rebuild structure to use Messages and Signature models

* Use PGPSplitMessage

* Remove signature model

* Various fixes

* Add helpers with tests

* Fixes, add some docs, add tests

* Add attachment helpers

* Add helpers Symmetric encryption

* Edit docs + examples

* Rename kr to keyRing

* Various fixes for documentation

* Edit JSON handling functions, add decrypt keyring via token

* Add proposal changes doc

* Fix CI

* Drop *Message functions, join CleartextMessage and BinaryMessage

* Change canonicalization and trimming only to text signatures

* Add cleartextsignature, detach signature from message model, move helpers

* Documentation, remove optional parameters

* Move verification to separate model

* Don't return message in VerifyDetached

* Update table of contents in readme

* Appease golint

* Run go fmt

* Rename Encrypt/DecryptMessageWithPassword to ..WithToken

These functions shouldn't be used with user-provided passwords,
as they don't do any key-stretching.

* Change key generation usernames
2019-06-03 17:00:01 +02:00
Daniel Huigens
82d49bf235 Update dependencies 2019-05-21 16:09:42 +02:00
Daniel Huigens
def57f1f88
Switch to Go modules (#7) 2019-05-21 15:43:33 +02:00
wussler
fe48d5db5b
Update changelog, add versioning 2019-05-16 11:39:54 +02:00
Daniel Huigens
4ef882c564 More documentation fixes 2019-05-15 15:17:03 +02:00
wussler
388fa872e7 Rename functions, clarify examples (#3) 2019-05-15 14:56:49 +02:00
wussler
b3047cee4d Improve docs for keyrings (#2) 2019-05-15 14:36:04 +02:00
Daniel Huigens
7d9930b8e0 Improve documentation and naming
- Rename pmmime to gomime
- Rename pmKeyObject to pgpKeyObject
2019-05-15 14:34:22 +02:00
Daniel Huigens
30ee92e63b Rename pmcrypto.go to gopenpgp.go 2019-05-15 13:51:42 +02:00
wussler
b074657c90 Add tests, remove duplicate signing functions (#1) 2019-05-15 13:48:47 +02:00
Daniel Huigens
3e4e36b766 Update armor header URL 2019-05-15 11:37:57 +02:00
Daniel Huigens
e93f676571 Fix examples 2019-05-15 11:37:03 +02:00
Daniel Huigens
31e0d8a31a Merge branch 'signature-examples' into HEAD 2019-05-15 11:26:21 +02:00
Aron Wussler
60339e9764 Add examples for signatures 2019-05-15 11:25:33 +02:00
Daniel Huigens
d4cdec5229 Move subtle.go to its own package 2019-05-15 00:35:39 +02:00
Daniel Huigens
784c5cfc2e Update build.sh 2019-05-14 22:56:05 +02:00
Daniel Huigens
f08f01b7d9 Update installation instructions and examples; add TOC 2019-05-14 22:56:05 +02:00
Daniel Huigens
b2bab445eb Add Travis CI 2019-05-14 22:56:05 +02:00
Daniel Huigens
8a2433205e Update default armor headers 2019-05-14 22:56:05 +02:00
Daniel Huigens
1376870ff3 Merge branch 'gopenpgp' into 'master'
Rename go-pm-crypto to gopenpgp; prepare move to GitHub

See merge request ProtonMail/go-pm-crypto!22
2019-05-14 16:14:01 +00:00
Daniel Huigens
bb1be4a43b Rename PmCrypto to GopenPGP 2019-05-14 18:12:35 +02:00
Daniel Huigens
37cbb276fd Add LICENSE 2019-05-14 18:09:06 +02:00
Daniel Huigens
5942df2944 Remove notes.txt 2019-05-14 18:09:06 +02:00
Daniel Huigens
12e9d5dc19 Remove dist; .gitlab-ci.yml 2019-05-14 18:09:06 +02:00
Daniel Huigens
536a499f94 Rename go-pm-mime to go-mime 2019-05-14 18:09:06 +02:00
Daniel Huigens
da2e0f77f0 Rename package to gopenpgp 2019-05-14 18:09:06 +02:00
Daniel Huigens
7519408c0c Merge branch 'detached-signature-tests' into 'master'
Add signature tests, fix tests

See merge request ProtonMail/go-pm-crypto!18
2019-05-14 16:08:25 +00:00
Aron Wussler
b42e382224 Add signature tests, fix tests 2019-05-14 16:08:25 +00:00
Daniel Huigens
4081e693fc Fix build
`errors` import was missing due to conflicting PRs.
2019-05-14 16:51:02 +02:00
Daniel Huigens
0931705fce Merge branch 'addexamples' into 'master'
Add examples

See merge request ProtonMail/go-pm-crypto!20
2019-05-14 14:44:08 +00:00
Daniel Huigens
e4814f20a6 Merge branch 'linter' into 'master'
Add Linter

See merge request ProtonMail/go-pm-crypto!13
2019-05-14 14:42:38 +00:00
Aron Wussler
78e3abb0d8 go vet and lint
* Naming
    * If this is not some OpenPGP standard I follow rule that `DES` should be
      upper case as it is abreviation and `Triple` should be camel-case as it
      is normal word hence `TripleDES`
    * rename `errors2` -> `errorsPGP`
* long lines
    * https://github.com/golang/go/wiki/CodeReviewComments#line-length
    * I bit improved long lines based on my folding
    * reuse type in definition if possible i.e. `a string, b string, c string` -> `a,b,c string`
    * `if long_statetent(); err!=nil {` -> `long_statement;↵ if err!=nil {`
    * spaces around operators (e.g. `a + b` -> `a+b`)
* removing empty lines on start and end of scope
* comments
    * on all exported functions
    * start with function name
* import:
    * order in alphabet
    * separate native, golang.org/x/ and our libs
2019-05-14 14:42:38 +00:00
William Gotti
0421e1c829 Add Encrypt/Decrypt examples 2019-05-14 15:45:15 +02:00
Aron Wussler
8f830e09ac Add key generation examples 2019-05-14 15:45:15 +02:00