Created
July 13, 2022 20:09
-
-
Save cheeseonamonkey/f470c95867065b69def45a5e41e0fab2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("[email protected]", 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