Top Description Constructors Methods
org.bouncycastle.openpgp.examples

public Class DirectKeySignature

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .FileInputStream, .FileOutputStream, java.security.Security, java.util.Iterator, org.bouncycastle.bcpg.ArmoredOutputStream, org.bouncycastle.bcpg.sig.NotationData, org.bouncycastle.jce.provider.BouncyCastleProvider, org.bouncycastle.openpgp.PGPPrivateKey, .PGPPublicKey, .PGPPublicKeyRing, .PGPSecretKey, .PGPSecretKeyRing, .PGPSignature, .PGPSignatureGenerator, .PGPSignatureSubpacketGenerator, .PGPSignatureSubpacketVector, .PGPUtil, org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator, .JcaPGPContentSignerBuilder, .JcePBESecretKeyDecryptorBuilder

A simple utility class that directly signs a public key and writes the signed key to "SignedKey.asc" in the current working directory.

To sign a key: DirectKeySignature secretKeyFile secretKeyPass publicKeyFile(key to be signed) NotationName NotationValue.

To display a NotationData packet from a publicKey previously signed: DirectKeySignature signedPublicKeyFile.

Note

this example will silently overwrite files, nor does it pay any attention to the specification of "_CONSOLE" in the filename. It also expects that a single pass phrase will have been used.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
main(String[] args)

private static byte[]
signPublicKey(PGPSecretKey secretKey, String secretKeyPass, PGPPublicKey keyToBeSigned, String notationName, String notationValue)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DirectKeySignatureback to summary
public DirectKeySignature()

Method Detail

mainback to summary
public static void main(String[] args) throws Exception
signPublicKeyback to summary
private static byte[] signPublicKey(PGPSecretKey secretKey, String secretKeyPass, PGPPublicKey keyToBeSigned, String notationName, String notationValue) throws Exception