Commit graph

25 commits

Author SHA1 Message Date
Aron Wussler
0d1ce13767
Add parsing and serializing interfaces for keyrings (#275)
* Add parsing and serializing interfaces for keyrings

* Make error check more compact
2024-04-08 11:38:52 +02:00
Aron Wussler
a065bf20b0 Update go-crypto 2022-08-19 11:20:08 +02:00
marin thiercelin
5558d4a177
Fix: use verifyTime in the config time instead of Now()
When decrypting message, we have to use verifyTime in the config
otherwise signatures not valid at verifyTime but valid at Now()
will be seen as valid.
2021-09-23 17:14:19 +02:00
Daniel Huigens
9126511a96
Update go-crypto (#129)
* Update go-crypto

* Edit changelog

Co-authored-by: Aron Wussler <aron@wussler.it>
2021-04-28 18:33:14 +02:00
Aditya Wasan
3dd1711707
Add methods to get key capabilities (#125)
* Add methods to get key capabilities

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

* Use correct indetity to check for flags

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

* Fix lint

Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>

* Remove CanCertify and update CanSign to use SigningKey

Signed-off-by: GitHub <noreply@github.com>

* keyring: implement CanSign and CanEncrypt

Signed-off-by: GitHub <noreply@github.com>

* key/keyring: add tests for key capabilities

Signed-off-by: GitHub <noreply@github.com>

* Apply suggestions from code review

Renames CanSign to CanVerify and adds an extended test for public-only keys to confirm CanVerify is true for them.

Co-authored-by: wussler <aron@wussler.it>

Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: wussler <aron@wussler.it>
2021-04-09 12:32:10 +02:00
marinthiercelin
e0deea82a3
add signcryption methods to the keyrings (#109)
* add signcryption methods to the keyrings

* added signing and verifying keyrings

* added nil checks

* added unit test for signcrypt

* updated changelog

* switched the keyrings in the api

* update the error messages

* changed the names of the keyRing variable
2020-12-17 12:58:25 +01:00
Daniel Huigens
d0daa53ca6
Update x/crypto fork to github.com/ProtonMail/go-crypto (#106) 2020-12-08 18:34:39 +01:00
wussler
371d429001
WIP: Add compression to API (#91)
* Add compression to API

* Add docs

* Use defaults for a simpler interface

* Update x/crypto

* Fix ecdsa key types for lib update
2020-11-04 17:40:45 +01:00
zugzwang
dcc82c9fc3
Implement GetArmoredWithCustomHeaders (#48)
* Implement GetArmoredWithCustomHeaders

ArmorWithTypeAndCustomHeaders can be reused by other PGP armoured
objects.

* Update linting, and lint accordingly

`godot` has been improved and `goerr113` has been added (and ignored
here).

* Add custom headers for keys

* Minor comment changes

Co-authored-by: Aron Wussler <aron@wussler.it>
2020-05-06 18:50:18 +02: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
wussler
6136f75860 Remove JSON handling functions; export KeyRing.ReadFrom (#24) 2019-09-03 17:42:10 +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
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
wussler
388fa872e7 Rename functions, clarify examples (#3) 2019-05-15 14:56:49 +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
wussler
b074657c90 Add tests, remove duplicate signing functions (#1) 2019-05-15 13:48:47 +02:00
Daniel Huigens
da2e0f77f0 Rename package to gopenpgp 2019-05-14 18:09:06 +02:00
Aron Wussler
b42e382224 Add signature tests, fix tests 2019-05-14 16:08:25 +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
e1098f7d34 refactor functions and merge in keyring 2019-05-14 08:07:49 +00:00
Aron Wussler
8af460ba61 Create key.go unit tests 2019-05-13 14:06:54 +00:00
Aron Wussler
fd27ec08fb Fix existing tests, move large constants to files 2019-05-09 18:19:14 +02:00
Jakub Lehotsky
b218f523af Methods use + unit tests update 2019-01-11 00:23:00 +01:00
Jakub Lehotsky
36f8e2d437 Issue #3 - forgotten added new files 2018-11-05 23:01:53 +01:00