![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
github.com/encryptedtimeline/easypgp
PGP library for iOS and Android available through gomobile
To use EasyPGP you would need to install gomobile tools, following tutorial.
You also need to patch gomobile to support Uint64
:
diff --git a/bind/gen.go b/bind/gen.go
index 546c5cf4..0428230f 100644
--- a/bind/gen.go
+++ b/bind/gen.go
@@ -232,7 +232,9 @@ func (g *Generator) cgoType(t types.Type) string {
return "int64_t"
case types.Uint8: // types.Byte
return "uint8_t"
- // TODO(crawshaw): case types.Uint, types.Uint16, types.Uint32, types.Uint64:
+ // TODO(crawshaw): case types.Uint, types.Uint16, types.Uint32:
+ case types.Uint64:
+ return "uint64_t"
case types.Float32:
return "float"
case types.Float64, types.UntypedFloat:
After that you can build EasyPGP.framework
:
go get github.com/lastochkanetwork/easypgp
# For iOS
gomobile bind -target=ios -o EasyPGP.framework github.com/lastochkanetwork/easypgp
# For Android
gomobile bind -target=android github.com/lastochkanetwork/easypgp
After adding EasyPGP.framework
to your project you can straight-forward use it.
Swift example:
let pubkey1 = "-----BEGIN PGP PUBLIC KEY BLOCK-----...."
let privkey1 = "-----BEGIN PGP PRIVATE KEY BLOCK-----...."
let pubkey2 = "-----BEGIN PGP PUBLIC KEY BLOCK-----...."
let privkey2 = "-----BEGIN PGP PRIVATE KEY BLOCK-----...."
let sender = EasypgpNewKeyPairWithKeys(pubkey1, privkey1)
let receiver = EasypgpNewKeyPairWithKeys(pubkey2, nil)
let receiver_with_privkey = EasypgpNewKeyPairWithKeys(pubkey2, privkey2)
let msg = EasypgpEncryptAndSign("hello, world!", receiver, sender, nil)
NSLog((msg?.cipher())!)
let decrypted = EasypgpDecryptAndVerify(msg, receiver_with_privkey, nil)
NSLog((decrypted?.text())!)
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.