
com.jsuereth.pgp.cli.EncryptFile.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!
package bleep.plugin.pgp
package cli
import java.io.File
case class EncryptFile(file: File, 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)
key.encryptFile(file, new File(file.getAbsolutePath + ".asc"))
}
override def isReadOnly: Boolean = true
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy