Pure-MoonBit OpenPGP implementation (RFC 4880/9580): email encryption, decryption, signing and verification, interoperable with GnuPG and gopenpgp.
moon add justinwongcn/moonpgpimport {
"justinwongcn/moonpgp",
"justinwongcn/moonpgp/mime",
"justinwongcn/moonpgp/mail",
}git clone https://github.com/justinwongcn/moonpgp
cd moonpgp
moon run cmd/main -- helpmoon check --target all --deny-warn
moon build --target all
moon test --target native
moon fmt --checklet DEFAULT_MAX_DECOMPRESSED_BYTES : Intfn decrypt_and_verify(message : String, decryption_keys : Array[PrivateKey], verifier : PublicKey?, max_decompressed? : Int) -> (Bytes, VerifyStatus) raisefn decrypt_binary_with_password(data : BytesView, passphrase : String, argon2_max_memory_kib? : Int, max_decompressed? : Int) -> Bytes raisefn decrypt_binary_with_private_key(data : BytesView, key : PrivateKey, max_decompressed? : Int) -> Bytes raisefn decrypt_with_password(message : String, passphrase : String, argon2_max_memory_kib? : Int, max_decompressed? : Int) -> Bytes raisefn decrypt_with_private_key(message : String, key : PrivateKey, max_decompressed? : Int) -> Bytes raisefn encrypt_to_recipients(plaintext : BytesView, recipients : Array[PublicKey], file_name? : String, compress? : CompressedAlgo) -> String raisefn encrypt_to_session_key(plaintext : BytesView, sk : SessionKey, file_name? : String, compress? : CompressedAlgo) -> String raisefn encrypt_with_password(plaintext : BytesView, passphrase : String, file_name? : String, aead? : Bool, argon2? : Bool, argon2_memory_exp? : Int, compress? : CompressedAlgo) -> String raisefn encrypt_with_password_argon2(plaintext : BytesView, passphrase : String, file_name? : String, passes? : Int, parallelism? : Int, memory_exp? : Int, compress? : CompressedAlgo) -> String raisefn encrypt_with_password_v6(plaintext : BytesView, passphrase : String, file_name? : String, aead? : AeadMode, argon2? : Bool, passes? : Int, parallelism? : Int, memory_exp? : Int, compress? : CompressedAlgo) -> String raisefn recover_session_key_with_password(message : String, passphrase : String, argon2_max_memory_kib? : Int) -> SessionKey raisefn sign_and_encrypt(data : BytesView, signer : PrivateKey, recipients : Array[PublicKey], text_mode? : Bool, compress? : CompressedAlgo, created? : Int, file_name? : String) -> String raisefn sign_cleartext_with(text : String, key : PrivateKey, hash : HashId, created? : Int) -> String raisefn sign_detached(data : BytesView, key : PrivateKey, text_mode? : Bool, created? : Int) -> String raisefn sign_inline(data : BytesView, key : PrivateKey, text_mode? : Bool, created? : Int, file_name? : String) -> String raisefn verify_detached(data : BytesView, armored_signature : String, verifier : PublicKey) -> VerifyStatus raisefn verify_inline(message : String, verifier : PublicKey, max_decompressed? : Int) -> (Bytes, VerifyStatus) raisefn verify_key_signature(sig : SignaturePacket, signer_pub : PublicKeyPacket, certified_pub : PublicKeyPacket, user_id? : String, direct? : Bool) -> Bool raiseInstall
Download zipPure-MoonBit OpenPGP implementation (RFC 4880/9580): email encryption, decryption, signing and verification, interoperable with GnuPG and gopenpgp.