Package org.bouncycastle.bcpg
Class ECDHPublicBCPGKey
- java.lang.Object
-
- org.bouncycastle.bcpg.BCPGObject
-
- org.bouncycastle.bcpg.ECPublicBCPGKey
-
- org.bouncycastle.bcpg.ECDHPublicBCPGKey
-
- All Implemented Interfaces:
BCPGKey,org.bouncycastle.util.Encodable
public class ECDHPublicBCPGKey extends ECPublicBCPGKey
Base class for an ECDH Public Key. This type is for use withPublicKeyAlgorithmTags.ECDH. The specific curve is identified by providing an OID. Regarding X25519, X448, consider the following: Modern implementations use dedicated key typesX25519PublicBCPGKey,X448PublicBCPGKeyalong with dedicated algorithm tagsPublicKeyAlgorithmTags.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,X25519PublicBCPGKeyorX448PublicBCPGKeyMUST be used for X25519, X448.
-
-
Constructor Summary
Constructors Constructor Description ECDHPublicBCPGKey(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, java.math.BigInteger point, int hashAlgorithm, int symmetricKeyAlgorithm)ECDHPublicBCPGKey(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, org.bouncycastle.math.ec.ECPoint point, int hashAlgorithm, int symmetricKeyAlgorithm)ECDHPublicBCPGKey(BCPGInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(BCPGOutputStream out)bytegetHashAlgorithm()bytegetReserved()bytegetSymmetricKeyAlgorithm()-
Methods inherited from class org.bouncycastle.bcpg.ECPublicBCPGKey
getCurveOID, getEncoded, getEncodedPoint, getFormat, readBytesOfEncodedLength
-
-
-
-
Constructor Detail
-
ECDHPublicBCPGKey
public ECDHPublicBCPGKey(BCPGInputStream in) throws java.io.IOException
- Parameters:
in- the stream to read the packet from.- Throws:
java.io.IOException
-
ECDHPublicBCPGKey
public ECDHPublicBCPGKey(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, org.bouncycastle.math.ec.ECPoint point, int hashAlgorithm, int symmetricKeyAlgorithm)
-
ECDHPublicBCPGKey
public ECDHPublicBCPGKey(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, java.math.BigInteger point, int hashAlgorithm, int symmetricKeyAlgorithm)
-
-
Method Detail
-
getReserved
public byte getReserved()
-
getHashAlgorithm
public byte getHashAlgorithm()
-
getSymmetricKeyAlgorithm
public byte getSymmetricKeyAlgorithm()
-
encode
public void encode(BCPGOutputStream out) throws java.io.IOException
- Overrides:
encodein classECPublicBCPGKey- Throws:
java.io.IOException
-
-