Created
June 6, 2013 23:22
-
-
Save kbsriram/5725808 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
package org.ppdrive.crypto; | |
import org.bouncyrattle.bcpg.ContainedPacket; | |
import org.bouncyrattle.bcpg.PublicKeyEncSessionPacket; | |
import org.bouncyrattle.openpgp.PGPException; | |
import org.bouncyrattle.openpgp.PGPPublicKey; | |
import org.bouncyrattle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator; | |
class CAnonymousPublicKeyKeyEncryptionMethodGenerator | |
extends BcPublicKeyKeyEncryptionMethodGenerator | |
{ | |
CAnonymousPublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key) | |
{ | |
super(key); | |
m_pubkey = key; | |
} | |
// generate a wildcard keyid rather than embedding it into | |
// the content. | |
@Override | |
public ContainedPacket generate(int encAlg, byte[] sessionInfo) | |
throws PGPException | |
{ | |
return new PublicKeyEncSessionPacket | |
(0l, m_pubkey.getAlgorithm(), | |
processSessionInfo | |
(encryptSessionInfo | |
(m_pubkey, sessionInfo))); | |
} | |
private final PGPPublicKey m_pubkey; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment