org.spongycastle.bcpg.ExperimentalPacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcpg-jdk15on Show documentation
Show all versions of bcpg-jdk15on Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle
intended for the Android platform. Android unfortunately ships with a stripped-down version of
Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,
up-to-date version of the Bouncy Castle cryptographic libs.
The newest version!
package org.spongycastle.bcpg;
import java.io.IOException;
import org.spongycastle.util.Arrays;
/**
* basic packet for an experimental packet.
*/
public class ExperimentalPacket
extends ContainedPacket implements PublicKeyAlgorithmTags
{
private int tag;
private byte[] contents;
/**
*
* @param in
* @throws IOException
*/
ExperimentalPacket(
int tag,
BCPGInputStream in)
throws IOException
{
this.tag = tag;
this.contents = in.readAll();
}
public int getTag()
{
return tag;
}
public byte[] getContents()
{
return Arrays.clone(contents);
}
public void encode(
BCPGOutputStream out)
throws IOException
{
out.writePacket(tag, contents, true);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy