Top Description Fields Constructors Methods
org.bouncycastle.openpgp.examples

public Class DSAElGamalKeyRingGenerator

extends Object
Class Inheritance
Imports
java.io.FileOutputStream, .IOException, .OutputStream, java.math.BigInteger, java.security.InvalidAlgorithmParameterException, .KeyPair, .KeyPairGenerator, .NoSuchAlgorithmException, .NoSuchProviderException, .Security, java.util.Date, javax.crypto.spec.DHParameterSpec, org.bouncycastle.bcpg.ArmoredOutputStream, .CompressionAlgorithmTags, .HashAlgorithmTags, .SymmetricKeyAlgorithmTags, org.bouncycastle.bcpg.sig.Features, .KeyFlags, org.bouncycastle.jce.provider.BouncyCastleProvider, org.bouncycastle.openpgp.PGPException, .PGPKeyPair, .PGPKeyRingGenerator, .PGPPublicKey, .PGPSignature, .PGPSignatureSubpacketGenerator, org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor, .PGPContentSignerBuilder, .PGPDigestCalculator, org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder, .JcaPGPDigestCalculatorProviderBuilder, .JcaPGPKeyPair, .JcePBESecretKeyEncryptorBuilder

A simple utility class that generates a public/secret keyring containing a DSA signing key and an El Gamal key for encryption.

usage: DSAElGamalKeyRingGenerator [-a] identity passPhrase

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].

Field Summary

Modifier and TypeField and Description
private static final int[]
private static final int[]
private static final int
private static final int[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
exportKeyPair(OutputStream secretOut, OutputStream publicOut, KeyPair dsaKp, KeyPair elgKp, String identity, char[] passPhrase, boolean armor)

private static KeyPair
private static KeyPair
private static PGPSignatureSubpacketGenerator
private static PGPSignatureSubpacketGenerator
public static void
main(String[] args)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COMPback to summary
private static final int[] COMP
HASH_PREFERENCESback to summary
private static final int[] HASH_PREFERENCES
SIG_HASHback to summary
private static final int SIG_HASH
SYM_PREFERENCESback to summary
private static final int[] SYM_PREFERENCES

Constructor Detail

DSAElGamalKeyRingGeneratorback to summary
public DSAElGamalKeyRingGenerator()

Method Detail

exportKeyPairback to summary
private static void exportKeyPair(OutputStream secretOut, OutputStream publicOut, KeyPair dsaKp, KeyPair elgKp, String identity, char[] passPhrase, boolean armor) throws IOException, PGPException
generateDSAKeyPairback to summary
private static KeyPair generateDSAKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException
generateElGamalKeyPairback to summary
private static KeyPair generateElGamalKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException
getEncryptionKeyHashedSubpacketsback to summary
private static PGPSignatureSubpacketGenerator getEncryptionKeyHashedSubpackets()
getPrimaryKeyHashedSubpacketsback to summary
private static PGPSignatureSubpacketGenerator getPrimaryKeyHashedSubpackets()
mainback to summary
public static void main(String[] args) throws Exception