Rsa Key Pair Generator Java
Rsa Key Pair Generator Java 4,3/5 5467 reviews
  1. Windows Generate Rsa Key Pair
  2. Rsa Key Pair Generator Java Free
  3. Online Rsa Key Generator
  4. Generate Rsa Key Pair Javascript

The Java KeyPairGenerator class (java.security.KeyPairGenerator) is used to generate asymmetric encryption / decryption key pairs. An asymmetric key pair consists of two keys. An asymmetric key pair consists of two keys. Feb 02, 2013  Java Code for RSA Key Generation. The following are top voted examples for showing how to use java.security.KeyPairGenerator.These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.

The following are Jave code examples for showing how to use getInstance of the java.security.KeyPairGenerator class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.

Options are displayed, and you can transfer data by selecting the content. Is mobiletrans safe to use. MobileTrans provides many features as it supports different networks and also different mobiles.

Permalink

Join GitHub today

Download windows 8 oem. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up
Branch:master
Generator
Find file Copy path

Windows Generate Rsa Key Pair

Fetching contributors…

Rsa Key Pair Generator Java Free

Rsa Key Pair Generator Java

Online Rsa Key Generator

packageorg.jdamico.bc.openpgp.utils;
importjava.io.IOException;
importjava.io.OutputStream;
importjava.security.InvalidKeyException;
importjava.security.NoSuchProviderException;
importjava.security.PrivateKey;
importjava.security.PublicKey;
importjava.security.SignatureException;
importjava.security.interfaces.RSAPrivateCrtKey;
importjava.util.Date;
importorg.bouncycastle.bcpg.ArmoredOutputStream;
importorg.bouncycastle.bcpg.HashAlgorithmTags;
importorg.bouncycastle.bcpg.RSASecretBCPGKey;
importorg.bouncycastle.openpgp.PGPEncryptedData;
importorg.bouncycastle.openpgp.PGPException;
importorg.bouncycastle.openpgp.PGPKeyPair;
importorg.bouncycastle.openpgp.PGPPrivateKey;
importorg.bouncycastle.openpgp.PGPPublicKey;
importorg.bouncycastle.openpgp.PGPSecretKey;
importorg.bouncycastle.openpgp.PGPSignature;
importorg.bouncycastle.openpgp.operator.PGPDigestCalculator;
importorg.bouncycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder;
importorg.bouncycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder;
importorg.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyConverter;
importorg.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder;
/**
* A simple utility class that generates a RSA PGPPublicKey/PGPSecretKey pair.
* <p>
* usage: RSAKeyPairGenerator [-a] identity passPhrase
* <p>
* Where identity is the name to be associated with the public key. The keys are placed
* in the files pub.[asc bpg] and secret.[asc bpg].
*/
publicclassRSAKeyPairGenerator
{
publicvoidexportKeyPair(
OutputStreamsecretOut,
OutputStreampublicOut,
PublicKeypublicKey,
PrivateKeyprivateKey,
Stringidentity,
char[] passPhrase,
booleanarmor)
throwsIOException, InvalidKeyException, NoSuchProviderException, SignatureException, PGPException
{
if (armor)
{
secretOut =newArmoredOutputStream(secretOut);
}
PGPPublicKey a = (newJcaPGPKeyConverter().getPGPPublicKey(PGPPublicKey.RSA_GENERAL, publicKey, newDate()));
RSAPrivateCrtKey rsK = (RSAPrivateCrtKey)privateKey;
RSASecretBCPGKey privPk =newRSASecretBCPGKey(rsK.getPrivateExponent(), rsK.getPrimeP(), rsK.getPrimeQ());
PGPPrivateKey b =newPGPPrivateKey(a.getKeyID(), a.getPublicKeyPacket(), privPk);
PGPDigestCalculator sha1Calc =newJcaPGPDigestCalculatorProviderBuilder().build().get(HashAlgorithmTags.SHA1);
PGPKeyPair keyPair =newPGPKeyPair(a,b);
PGPSecretKey secretKey =newPGPSecretKey(PGPSignature.DEFAULT_CERTIFICATION, keyPair, identity, sha1Calc, null, null, newJcaPGPContentSignerBuilder(keyPair.getPublicKey().getAlgorithm(), HashAlgorithmTags.SHA1), newJcePBESecretKeyEncryptorBuilder(PGPEncryptedData.CAST5, sha1Calc).setProvider('BC').build(passPhrase));
secretKey.encode(secretOut);
secretOut.close();
if (armor)
{
publicOut =newArmoredOutputStream(publicOut);
}
PGPPublicKey key = secretKey.getPublicKey();
key.encode(publicOut);
publicOut.close();
}
}

Generate Rsa Key Pair Javascript

  • Copy lines
  • Copy permalink