Skip to content

Instantly share code, notes, and snippets.

@cheeseonamonkey
Created July 13, 2022 20:09
Show Gist options
  • Save cheeseonamonkey/f470c95867065b69def45a5e41e0fab2 to your computer and use it in GitHub Desktop.
Save cheeseonamonkey/f470c95867065b69def45a5e41e0fab2 to your computer and use it in GitHub Desktop.
import java.security.*
import org.pgpainless.*
import org.pgpainless.key.generation.type.rsa.RsaLength
fun main() {
println("\n_________________________\nHello beautiful! ;)\n_________________________\n")
/*
//keypair no libraries
val keyGen :KeyPairGenerator =
KeyPairGenerator.getInstance("RSA")
//1024 bit encryption
keyGen.initialize(1024)
//
val keyPair = keyGen.generateKeyPair()
println("PRIVATE:\n${keyPair.private}\n\n")
println("PUBLIC:\n${keyPair.public}\n\n")
*/
//
//pgp painless:
val keyRing = PGPainless.generateKeyRing().simpleRsaKeyRing("corn@hole.com", RsaLength._2048)
println("\n\nPRIVATE:\n________\n${keyRing.secretKey}\n")
println("\n\nPUBLIC:\n________\n${keyRing.publicKey}\n")
println("\n\nCERT:\n________\n${PGPainless.extractCertificate(keyRing)}\n")
println("\n\nPUBLIC:\n________\n${PGPainless.asciiArmor(keyRing)}\n")
println("")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment