Top Description Fields Constructors Methods
org.bouncycastle.bcpg

public abstract Class OctetArrayBCPGKey

extends BCPGObject
implements BCPGKey
Class Inheritance
All Implemented Interfaces
org.bouncycastle.bcpg.BCPGKey, org.bouncycastle.util.Encodable
Known Direct Subclasses
org.bouncycastle.bcpg.UnknownBCPGKey, org.bouncycastle.bcpg.X25519PublicBCPGKey, org.bouncycastle.bcpg.X25519SecretBCPGKey, org.bouncycastle.bcpg.X448PublicBCPGKey, org.bouncycastle.bcpg.X448SecretBCPGKey, org.bouncycastle.bcpg.Ed25519PublicBCPGKey, org.bouncycastle.bcpg.Ed25519SecretBCPGKey, org.bouncycastle.bcpg.Ed448PublicBCPGKey, org.bouncycastle.bcpg.Ed448SecretBCPGKey
Imports
java.io.IOException, org.bouncycastle.util.Arrays

Public/Secret BCPGKey which is encoded as an array of octets rather than an MPI.

Field Summary

Modifier and TypeField and Description
private final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
OctetArrayBCPGKey(int length, byte[] key)

Method Summary

Modifier and TypeMethod and Description
public void
public byte[]
public String
getFormat()

Implements org.bouncycastle.bcpg.BCPGKey.getFormat.

Return the base format for this key - in the case of the symmetric keys it will generally be raw indicating that the key is just a straight byte representation, for an asymmetric key the format will be PGP, indicating the key is a string of MPIs or octets encoded in PGP format.

public byte[]

Field Detail

keyback to summary
private final byte[] key

Constructor Detail

OctetArrayBCPGKeyback to summary
pack-priv OctetArrayBCPGKey(int length, BCPGInputStream in) throws IOException
OctetArrayBCPGKeyback to summary
pack-priv OctetArrayBCPGKey(int length, byte[] key)

Method Detail

encodeback to summary
public void encode(BCPGOutputStream out) throws IOException

Implements abstract org.bouncycastle.bcpg.BCPGObject.encode.

Annotations
@Override
getEncodedback to summary
public byte[] getEncoded()

Overrides org.bouncycastle.bcpg.BCPGObject.getEncoded.

Implements org.bouncycastle.bcpg.BCPGKey.getEncoded, org.bouncycastle.util.Encodable.getEncoded.

return the standard PGP encoding of the key.

Returns:byte[]

Doc from org.bouncycastle.bcpg.BCPGKey.getEncoded.

byte[]

Annotations
@Override
See Also
org.bouncycastle.bcpg.BCPGKey#getEncoded()
getFormatback to summary
public String getFormat()

Implements org.bouncycastle.bcpg.BCPGKey.getFormat.

Doc from org.bouncycastle.bcpg.BCPGKey.getFormat.

Return the base format for this key - in the case of the symmetric keys it will generally be raw indicating that the key is just a straight byte representation, for an asymmetric key the format will be PGP, indicating the key is a string of MPIs or octets encoded in PGP format.

Returns:String

"RAW" or "PGP"

Annotations
@Override
getKeyback to summary
public byte[] getKey()