Top Description Fields Constructors Methods
org.bouncycastle.bcpg

public Class ECDHPublicBCPGKey

extends ECPublicBCPGKey
Class Inheritance
Imports
java.io.IOException, java.math.BigInteger, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.math.ec.ECPoint

Base class for an ECDH Public Key. This type is for use with PublicKeyAlgorithmTags#ECDH. The specific curve is identified by providing an OID. Regarding X25519, X448, consider the following: Modern implementations use dedicated key types X25519PublicBCPGKey, X448PublicBCPGKey along with dedicated algorithm tags PublicKeyAlgorithmTags#X25519, PublicKeyAlgorithmTags#X448. If you want to be compatible with legacy applications however, you should use this class instead. Note though, that for v6 keys, X25519PublicBCPGKey or X448PublicBCPGKey MUST be used for X25519, X448.
See Also
OpenPGP - Algorithm-Specific Parts for ECDH Keys

Field Summary

Modifier and TypeField and Description
private byte
private byte
private byte
Inherited from org.bouncycastle.bcpg.ECPublicBCPGKey:
oidpoint

Constructor Summary

AccessConstructor and Description
public
ECDHPublicBCPGKey(BCPGInputStream
the stream to read the packet from.
in
)

public
ECDHPublicBCPGKey(ASN1ObjectIdentifier oid, ECPoint point, int hashAlgorithm, int symmetricKeyAlgorithm)

public
ECDHPublicBCPGKey(ASN1ObjectIdentifier oid, BigInteger point, int hashAlgorithm, int symmetricKeyAlgorithm)

Method Summary

Modifier and TypeMethod and Description
public void
public byte
public byte
public byte
private void
private void
Inherited from org.bouncycastle.bcpg.ECPublicBCPGKey:
getCurveOIDgetEncodedgetEncodedPointgetFormatreadBytesOfEncodedLength

Field Detail

hashFunctionIdback to summary
private byte hashFunctionId
reservedback to summary
private byte reserved
symAlgorithmIdback to summary
private byte symAlgorithmId

Constructor Detail

ECDHPublicBCPGKeyback to summary
public ECDHPublicBCPGKey(BCPGInputStream in) throws IOException
Parameters
in:BCPGInputStream

the stream to read the packet from.

ECDHPublicBCPGKeyback to summary
public ECDHPublicBCPGKey(ASN1ObjectIdentifier oid, ECPoint point, int hashAlgorithm, int symmetricKeyAlgorithm)
ECDHPublicBCPGKeyback to summary
public ECDHPublicBCPGKey(ASN1ObjectIdentifier oid, BigInteger point, int hashAlgorithm, int symmetricKeyAlgorithm)

Method Detail

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

Overrides org.bouncycastle.bcpg.ECPublicBCPGKey.encode.

getHashAlgorithmback to summary
public byte getHashAlgorithm()
getReservedback to summary
public byte getReserved()
getSymmetricKeyAlgorithmback to summary
public byte getSymmetricKeyAlgorithm()
verifyHashAlgorithmback to summary
private void verifyHashAlgorithm()
verifySymmetricKeyAlgorithmback to summary
private void verifySymmetricKeyAlgorithm()