com.jsuereth.pgp.cli.EncryptMessage.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bleep-plugin-pgp_2.13 Show documentation
Show all versions of bleep-plugin-pgp_2.13 Show documentation
A bleeping fast scala build tool!
The newest version!
package bleep.plugin.pgp
package cli
case class EncryptMessage(msg: String, pubKey: String) extends PgpCommand {
def run(ctx: PgpCommandContext): Unit = {
val key = (for {
keyring <- ctx.publicKeyRing findPubKeyRing pubKey
encKey <- keyring.encryptionKeys.headOption
} yield encKey) getOrElse sys.error("Could not find encryption key for: " + pubKey)
ctx.output(key.encryptString(msg))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy