All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.openpgp.PGPPadding Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java API for handling the OpenPGP protocol. This jar contains the OpenPGP API for JDK 1.5 to JDK 1.8. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs.

There is a newer version: 1.79
Show newest version
package org.bouncycastle.openpgp;

import java.io.IOException;

import org.bouncycastle.bcpg.BCPGInputStream;
import org.bouncycastle.bcpg.Packet;
import org.bouncycastle.bcpg.PaddingPacket;

/**
 * The PGPPadding contains random data, and can be used to defend against traffic analysis on version 2 SEIPD messages
 * and Transferable Public Keys.
 * 

* Such a padding packet MUST be ignored when received. */ public class PGPPadding { private PaddingPacket p; /** * Default constructor. * * @param in * @throws IOException */ public PGPPadding( BCPGInputStream in) throws IOException { Packet packet = in.readPacket(); if (!(packet instanceof PaddingPacket)) { throw new IOException("unexpected packet in stream: " + packet); } p = (PaddingPacket)packet; } public byte[] getPadding() { return p.getPadding(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy