org.freecompany.redline
Class SignatureGenerator
java.lang.Object
org.freecompany.redline.SignatureGenerator
public class SignatureGenerator
- extends Object
Generates PGP signatures for NIO channels
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SIGNATURE_SIZE
protected static final int SIGNATURE_SIZE
- See Also:
- Constant Field Values
enabled
protected final boolean enabled
headerOnlyRSAEntry
protected AbstractHeader.Entry<byte[]> headerOnlyRSAEntry
headerAndPayloadPGPEntry
protected AbstractHeader.Entry<byte[]> headerAndPayloadPGPEntry
privateKey
protected final org.bouncycastle.openpgp.PGPPrivateKey privateKey
headerOnlyKey
protected ChannelWrapper.Key<byte[]> headerOnlyKey
headerAndPayloadKey
protected ChannelWrapper.Key<byte[]> headerAndPayloadKey
SignatureGenerator
public SignatureGenerator(org.bouncycastle.openpgp.PGPPrivateKey privateKey)
SignatureGenerator
public SignatureGenerator(File privateKeyRingFile,
String privateKeyId,
String privateKeyPassphrase)
prepare
public void prepare(Signature signature)
startBeforeHeader
public void startBeforeHeader(WritableChannelWrapper output)
finishAfterHeader
public void finishAfterHeader(WritableChannelWrapper output)
finishAfterPayload
public void finishAfterPayload(WritableChannelWrapper output)
readKeyRings
protected org.bouncycastle.openpgp.PGPSecretKeyRingCollection readKeyRings(File privateKeyRingFile)
findMatchingSecretKey
protected org.bouncycastle.openpgp.PGPSecretKey findMatchingSecretKey(org.bouncycastle.openpgp.PGPSecretKeyRingCollection keyRings,
String privateKeyId)
isMatchingKeyId
protected boolean isMatchingKeyId(org.bouncycastle.openpgp.PGPSecretKey key,
String privateKeyId)
extractPrivateKey
protected org.bouncycastle.openpgp.PGPPrivateKey extractPrivateKey(org.bouncycastle.openpgp.PGPSecretKey secretKey,
String privateKeyPassphrase)
finishEntry
protected void finishEntry(WritableChannelWrapper output,
AbstractHeader.Entry<byte[]> entry,
ChannelWrapper.Key<byte[]> key)
checkEntry
protected void checkEntry(AbstractHeader.Entry<byte[]> entry)
checkKey
protected void checkKey(ChannelWrapper.Key<byte[]> key)
isEnabled
public boolean isEnabled()
getAlgorithm
protected int getAlgorithm()
Copyright © 2014. All Rights Reserved.